To simulate payment with eWallet in Test Mode, first you must be aware that eWallet has 2 type of flow (for further reference can go to this docs):
1. No Redirection Payment Flow/ Push Notification Flow:
- OVO
- JeniusPay
2. Redirection Payment Flow:
- DANA
- ShopeePay (ID & PH)
- LinkAja
- AstraPay
- GCash
- Paymaya
- GrabPay
Here are the steps on how to create eWallet charge and simulate payment in test mode:
1. Create secret API Key on your dashboard in test mode
Reference can be found in this doc.
2. Set your test callback URL in Dashboard - Settings - Callbacks in eWallet payment status and make sure upon "test and save" it returns 2XX
3. Create eWallet Charge using endpoint:
POST https://api.xendit.co/ewallets/charges
4. Input you secret API key in Authorization
5. In Body Request you can input the parameters which are required or optional based on each eWallet partners (this example is for DANA):
{
"reference_id": "test123",
"currency": "IDR",
"amount": 1000,
"checkout_method": "ONE_TIME_PAYMENT",
"channel_code": "ID_DANA",
"channel_properties": {
"success_redirect_url": "https://yourwebsiteurl/",
"failure_redirect_url": "https://yourwebsiteurl/"
},
"metadata": {
"branch_area": "PLUIT",
"branch_city": "JAKARTA"
}
}
{
"id": "ewc_57395955-790c-46c2-8f84-0a16673b6e91",
"business_id": "6253abec9547485c4a83xxx",
"reference_id": "test123",
"status": "PENDING",
"currency": "IDR",
"charge_amount": 1000,
"capture_amount": 1000,
"payer_charged_currency": null,
"payer_charged_amount": null,
"refunded_amount": null,
"checkout_method": "ONE_TIME_PAYMENT",
"channel_code": "ID_DANA",
"channel_properties": {
"success_redirect_url": "https://yourwebsiteurl/",
"failure_redirect_url": "https://yourwebsiteurl/"
},
"actions": {
"desktop_web_checkout_url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=ce838ropvgtcs06rtg9g",
"mobile_web_checkout_url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=ce838ropvgtcs06rtg9g",
"mobile_deeplink_checkout_url": null,
"qr_checkout_string": null
},
"is_redirect_required": true,
"callback_url": "https://hooks.zapier.com/hooks/catch/9675406x/oj8regt/",
"created": "2022-12-07T06:36:31.131839Z",
"updated": "2022-12-07T06:36:31.131839Z",
"void_status": null,
"voided_at": null,
"capture_now": true,
"customer_id": null,
"customer": null,
"payment_method_id": null,
"failure_code": null,
"basket": null,
"metadata": {
"branch_area": "PLUIT",
"branch_city": "JAKARTA"
},
"shipping_information": null
}
- For Redirection Payment Flow you will receive "desktop_web_checkout_url" and/or "mobile_web_checkout_url" under the "actions" section (check step 7) while for
1. Redirection Flow: