Skip to main content

Testing eWallet

Description

Testing and development with Xendit eWallets does not require an activated account. Once you register for a free Xendit account, you can begin simulating eWallet payments via API immediately.

Testing eWallet Payments

  1. To do eWallet testing with Xendit, first create a secret API key for development mode. Make sure to assign permission for Money-In as WRITE
  2. Set up your preferrred callback URL in the Callbacks section of the Settings tab
  3. Follow and refer to our API Reference for details on request requirements

Testing One-Time Payment Flow

Step 1: Create an eWallet Charge

Send a ‘POST’ request to Create eWallet Charge API using your development API key

info

To simulate and test errors/failures scenarios, please use the corresponding values for the amount parameter as specified in the Testing Scenarios for eWallet Charge Endpoint section below.

POST https://api.xendit.co/ewallets/charges
{
"reference_id": "order-id-123",
"currency": "IDR",
"amount": 25000,
"checkout_method": "ONE_TIME_PAYMENT",
"channel_code": "ID_DANA",
"channel_properties": {
"success_redirect_url": "https://redirect.me/payment"
}
}

If successful, you will receive a PENDING response

{
"id": "ewc_8c0a48ab-dad1-45f9-b57b-b994ab504989",
"business_id": "5abe2389ewpejrt238",
"reference_id": "order-id-123",
"status": "PENDING",
"currency": "IDR",
"charge_amount": 25000,
"capture_amount": 25000,
"refunded_amount": null,
"checkout_method": "ONE_TIME_PAYMENT",
"channel_code": "ID_DANA",
"channel_properties": {
"success_redirect_url": "https://redirect.me/payment"
},
"actions": {
"desktop_web_checkout_url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=12345",
"mobile_web_checkout_url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=12345",
"mobile_deeplink_checkout_url": null,
"qr_checkout_string": null
},
"is_redirect_required": true,
"callback_url": "https://calling-back.com/xendit/dana",
"created": "2021-03-14T06:43:24.899492Z",
"updated": "2021-03-14T06:43:24.899492Z",
"void_status": null,
"voided_at": null,
"capture_now": true,
"customer_id": null,
"payment_method_id": null,
"failure_code": null,
"basket": null,
"metadata": null
}

Step 2: Simulate an eWallet Payment

Open the URL returned under the actions parameter from the above response (e.g. https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=12345) and proceed to simulate a payment

info

Note that the payment simulation URL is only valid for 10 minutes.

If successful, you will be redirected to the success_redirect_url and receive a successful payment callback

{
"event": "ewallet.capture",
"business_id": "5abe2389ewpejrt238",
"created": "2021-03-14T06:43:24.899492Z",
"data": {
"id": "ewc_8c0a48ab-dad1-45f9-b57b-b994ab504989",
"business_id": "5abe2389ewpejrt238",
"reference_id": "order-id-123",
"status": "SUCCEEDED",
"currency": "IDR",
"charge_amount": 25000,
"capture_amount": 25000,
"refunded_amount": null,
"checkout_method": "ONE_TIME_PAYMENT",
"channel_code": "ID_DANA",
"channel_properties": {
"success_redirect_url": "https://redirect.me/payment"
},
"actions": {
"desktop_web_checkout_url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=12345",
"mobile_web_checkout_url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=12345",
"mobile_deeplink_checkout_url": null,
"qr_checkout_string": null
},
"is_redirect_required": true,
"callback_url": "https://calling-back.com/xendit/dana",
"created": "2021-03-14T06:43:24.899492Z",
"updated": "2021-03-14T06:43:24.899492Z",
"void_status": null,
"voided_at": null,
"capture_now": true,
"customer_id": null,
"payment_method_id": null,
"failure_code": null,
"basket": null,
"metadata": null
}
}

Testing Tokenized Payment Flow

Step 1: Create a Customer Object

Send a ‘POST’ request to Create Customer Object API using your development API key

POST https://api.xendit.co/customers
{
"reference_id": "customer-id-123",
"mobile_number": "+6208774494404",
"given_names": "John Doe"
}

If successful, you will receive the customer_id in the response

{
"id": "b7c308fe-2836-41c8-98ae-0d23ed4d8450",
"reference_id": "customer-id-123",
"given_names": "John Doe",
"email": null,
"mobile_number": "+628774494404",
"description": null,
"middle_name": null,
"surname": null,
"phone_number": null,
"nationality": null,
"date_of_birth": null,
"metadata": null,
"employment": null,
"addresses": null,
"source_of_wealth": null
}

Step 2: Create an eWallet Payment Method

Send a ‘POST’ request to Create Payment Method API using the customer_id from above

POST https://api.xendit.co/v2/payment_methods
{
"type": "EWALLET",
"reusability": "MULTIPLE_USE",
"ewallet": {
"channel_code": "OVO",
"channel_properties": {
"mobile_number": "+628774494404",
"success_return_url": "https://your-redirect-website.com/success",
"failure_return_url": "https://your-redirect-website.com/failure"
}
},
"customer_id": "b7c308fe-2836-41c8-98ae-0d23ed4d8450"
}

If successful, you will receive a REQUIRES_ACTION response

{
"id": "pm-123123123-f4d9-421c-9f0b-ab3b2b6bbc39",
"type": "EWALLET",
"reusability": "MULTIPLE_USE",
"customer_id": "b7c308fe-2836-41c8-98ae-0d23ed4d8450",
"business_id": "5f27a14a9bf05c73123123123",
"status": "REQUIRES_ACTION",
"country": "ID",
"actions": [
{
"action": "AUTH",
"url_type": "WEB",
"url": "https://link-web-staging.xendit.co/oauth/lat-b32caa2d-a36b-4e50-a1da/confirm",
"method": "GET"
}
],
"created": "2022-01-29T09:12:33.001Z",
"updated": "2022-01-29T09:12:33.001Z",
"metadata": null,
"ewallet": {
"channel_code": "OVO",
"channel_properties": {
"mobile_number": "+628774494404",
"success_return_url": "https://your-redirect-website.com/success",
"failure_return_url": "https://your-redirect-website.com/failure"
},
"account": {
"account_details": null,
"name": null,
"balance": null,
"point_balance": null
}
},
"direct_debit": null,
"card": null,
"over_the_counter": null,
"virtual_account": null,
"qr_code": null
}

Step 3: Simulate an eWallet Account Linking

Open the URL returned under the actions parameter from the above response (e.g. https://link-web-staging.xendit.co/oauth/lat-b32caa2d-a36b-4e50-a1da/confirm) and proceed to simulate an account linking

If successful, you will be redirected to the success_return_url and receive a successful account linking callback

{
"id": "pm-123123123-f4d9-421c-9f0b-ab3b2b6bbc39",
"event": "payment_method.activated",
"business_id": "5f27a14a9bf05c73123123123",
"created": "2022-01-29T09:13:33.001Z",
"data": {
"id": "pm-123123123-f4d9-421c-9f0b-ab3b2b6bbc39",
"type": "EWALLET",
"country": "ID",
"customer_id": "b7c308fe-2836-41c8-98ae-0d23ed4d8450",
"business_id": "5f27a14a9bf05c73123123123",
"reusability": "MULTIPLE_USE",
"status": "ACTIVE",
"actions": [],
"created": "2022-01-29T09:12:33.001Z",
"updated": "2022-01-29T09:12:33.001Z",
"metadata": null,
"ewallet": {
"channel_code": "OVO",
"channel_properties": {
"mobile_number": "+628774494404",
"success_return_url": "https://your-redirect-website.com/success",
"failure_return_url": "https://your-redirect-website.com/failure"
},
"account": {
"name": null,
"account_details": null,
"balance": 666666,
"point_balance": 666666
}
},
"direct_debit": null,
"card": null,
"over_the_counter": null,
"virtual_account": null,
"qr_code": null
}
}

Step 4: Create an eWallet Charge

Send a ‘POST’ request to Create eWallet Charge API using the payment_method_id from above

POST https://api.xendit.co/ewallets/charges
{
"reference_id": "order-id-123",
"currency": "IDR",
"amount": 25000,
"checkout_method": "TOKENIZED_PAYMENT",
"channel_code": "ID_OVO",
"channel_properties": {
"success_redirect_url": "https://redirect.me/payment"
},
"payment_method_id": "pm-123123123-f4d9-421c-9f0b-ab3b2b6bbc39"
}

If successful, you will receive a PENDING response

{
"id": "ewc_8c0a48ab-dad1-45f9-b57b-b994ab504989",
"business_id": "5abe2389ewpejrt238",
"reference_id": "order-id-123",
"status": "PENDING",
"currency": "IDR",
"charge_amount": 25000,
"capture_amount": 25000,
"refunded_amount": null,
"checkout_method": "TOKENIZED_PAYMENT",
"channel_code": "ID_OVO",
"channel_properties": {
"success_redirect_url": "https://redirect.me/payment"
},
"actions": {
"desktop_web_checkout_url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=12345",
"mobile_web_checkout_url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=12345",
"mobile_deeplink_checkout_url": null,
"qr_checkout_string": null
},
"is_redirect_required": true,
"callback_url": "https://calling-back.com/xendit/dana",
"created": "2022-03-14T06:43:24.899492Z",
"updated": "2022-03-14T06:43:24.899492Z",
"void_status": null,
"voided_at": null,
"capture_now": true,
"customer_id": "b7c308fe-2836-41c8-98ae-0d23ed4d8450",
"payment_method_id": "pm-123123123-f4d9-421c-9f0b-ab3b2b6bbc39",
"failure_code": null,
"basket": null,
"metadata": null
}

Step 5: Simulate an eWallet Payment (Only Applicable for Non-Auto Debit Flow)

info

Redirecting the end user to authorize a subsequent payment after the initial account linking is only applicable for eWallets with redirection as the default tokenization flow. For eWallets with auto debit as the default tokenization flow, a payment callback is sent without the need to redirect the end user to a payment simulation URL.

Indonesia

ValueOVODANAShopeePay (ID)
Default Tokenization FlowRedirectionAuto DebitRedirection

Philippines

ValuePayMayaGrabPayShopeePay (PH)
Default Tokenization FlowAuto DebitAuto DebitAuto Debit

Open the URL returned under the actions parameter from the above response (e.g. https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=12345) and proceed to simulate a payment

info

Note that the payment simulation URL is only valid for 10 minutes.

If successful, you will be redirected to the success_redirect_url and receive a successful payment callback

{
"event": "ewallet.capture",
"business_id": "5abe2389ewpejrt238",
"created": "2022-03-14T06:43:24.899492Z",
"data": {
"id": "ewc_8c0a48ab-dad1-45f9-b57b-b994ab504989",
"business_id": "5abe2389ewpejrt238",
"reference_id": "order-id-123",
"status": "SUCCEEDED",
"currency": "IDR",
"charge_amount": 25000,
"capture_amount": 25000,
"refunded_amount": null,
"checkout_method": "TOKENIZED_PAYMENT",
"channel_code": "ID_OVO",
"channel_properties": {
"success_redirect_url": "https://redirect.me/payment"
},
"actions": {
"desktop_web_checkout_url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=12345",
"mobile_web_checkout_url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=12345",
"mobile_deeplink_checkout_url": null,
"qr_checkout_string": null
},
"is_redirect_required": true,
"callback_url": "https://calling-back.com/xendit/dana",
"created": "2022-03-14T06:43:24.899492Z",
"updated": "2022-03-14T06:43:24.899492Z",
"void_status": null,
"voided_at": null,
"capture_now": true,
"customer_id": "b7c308fe-2836-41c8-98ae-0d23ed4d8450",
"payment_method_id": "pm-123123123-f4d9-421c-9f0b-ab3b2b6bbc39",
"failure_code": null,
"basket": null,
"metadata": null
}
}

Testing Scenarios for eWallet Charge Endpoint

Positive Scenarios

ScenarioCriteriaExpected Result
Successful paymentAny number other than 10100-10102 and 20101-20111A response with “PENDING” as the payment status will be returned immediately. Once end user authorizes the payment, completed or failed, a callback will be returned with “SUCCEEDED” or “FAILED” status

Negative Scenarios

ScenarioCriteriaExpected Result
eWallet payment channel hasn't been activated. Activate eWallet via Xendit DashboardAmount = 10100API Response Error 403 CHANNEL_NOT_ACTIVATED
eWallet provider service is unavailableAmount = 10101API Response Error 503 CHANNEL_UNAVAILABLE
Xendit service is experiencing unexpected errors (rarely happen)Amount = 10102API Response Error 500 SERVER_ERROR
Customer's account has been restricted by eWallet providerAmount = 20103ACCOUNT_ACCESS_BLOCKED failure code via callback
Customer's should contact the provider for resolutionAmount = 20104INVALID_MERCHANT_CREDENTIALS failure code via callback
Merchant credentials met with an error with the eWallet provider. Please contact Xendit customer support to resolve this issueAmount = 20104INVALID_MERCHANT_CREDENTIALS failure code via callback
Customer declined the payment requestAmount = 20105USER_DECLINED_PAYMENT failure code via callback
Customer's account detail is invalidAmount = 20106INVALID_ACCOUNT_DETAILS failure code via callback
Customer's account has reached maximum transaction limitAmount = 20107MAXIMUM_LIMIT_REACHED failure code via callback
Customer's device cannot be reached. Common reasons include unstable network, device error or jailbroken device.Amount = 20108USER_UNREACHABLE failure code via callback
eWallet provider service is experiencing unexpected issuesAmount = 20109CHANNEL_UNAVAILABLE failure code via callback
Insufficient balance on customer's walletAmount = 20110INSUFFICIENT_BALANCE failure code via callback
Customer's account has not been activated. Activate account before retryingAmount = 20111ACCOUNT_NOT_ACTIVATED failure code via callback