Untuk membuat pembayaran eWallet pada mode live atau live mode, Anda perlu mengetahui bahwa eWallet memiliki 2 jenis tipe pembayaran (untuk referensi lebih lengkap Anda dapat klik docs berikut):
1. No Redirection Payment Flow/ Push Notification Flow:
- OVO
- JeniusPay
2. Redirection Payment Flow:
- DANA
- ShopeePay (ID & PH)
- LinkAja
- AstraPay
- GCash
- Paymaya
- GrabPay
Berikut adalah langkah-langkah cara membuat eWallet charge dan simulasikan pembayaran pada live mode:
1. Membuat secret API Key melalui dashboard Anda dalam mode live
Referensi dapat dilihat di doc berikut.
2. Masukkan callback URL Anda pada Dashboard - Settings - Callbacks di bagian eWallet payment status dan pastikan saat klik "test and save" respon mengembalikan 2XX
3.Membuat eWallet charge menggunakan endpoint:
POST https://api.xendit.co/ewallets/charges
4. Masukkan secret API key Anda pada Authorization
5. Pada Body request, Anda dapat menggunakan parameter yang wajib ataupun opsional sesuai dengan eWallet partners (dibawah adalah contoh untuk DANA):
{
"reference_id": "livetesting",
"currency": "IDR",
"amount": 100,
"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"
}
}
6. Kemudian Anda akan mendapatkan response berikut:
{
"id": "ewc_8a20cc88-4407-47e1-9d4c-94720d118bc0",
"business_id": "603f1c4172bbe840979fd408",
"reference_id": "livetesting",
"status": "PENDING",
"currency": "IDR",
"charge_amount": 100,
"capture_amount": 100,
"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://docs.xendit.co/ewallet/integrations/test-guideline",
"failure_redirect_url": "https://docs.xendit.co/ewallet/integrations/test-guideline"
},
"actions": {
"desktop_web_checkout_url": "https://m.dana.id/m/portal/cashier/checkout?bizNo=20221207111212800110166925072150424×tamp=1670399887714&mid=216620000035833566172&did=216650000363067994173&sid=216660000362985537171&sign=nG82KephN2%2BnwAfr5itNljExC%2B38VqBO%2F55bJTKwGIaXIJsV6BiU3rvLPVLj9vpOYKcuB69fDOkoBURyEOOuzgS8a%2BaTNAtO2GLnlCe70ZDU3m04yedk3n0Pq8%2BHfFMgwLFeuU9HHqaWBcrfPJULqCivuTPZ%2BkK2oqBlNH9l0PeYboSWJedf1IfrHPuctWxCO4QlgGtfMH7RK6gNYYAxBRFq2Pf1XabLs%2F1W70DWeUBY%2FrrbYNyPqKi7vrSWmo%2BQI40C2fEJgL8PMkcNEM3wMM0SRYLuX1Ra7Fq%2FsfV4ndJo0uCzuTQk%2F%2BTBSiq1DM3Fh0dpkEemZMykhOeVrIuTPQ%3D%3D&forceToH5=false",
"mobile_web_checkout_url": "https://m.dana.id/m/portal/cashier/checkout?bizNo=20221207111212800110166925072150424×tamp=1670399887714&mid=216620000035833566172&did=216650000363067994173&sid=216660000362985537171&sign=nG82KephN2%2BnwAfr5itNljExC%2B38VqBO%2F55bJTKwGIaXIJsV6BiU3rvLPVLj9vpOYKcuB69fDOkoBURyEOOuzgS8a%2BaTNAtO2GLnlCe70ZDU3m04yedk3n0Pq8%2BHfFMgwLFeuU9HHqaWBcrfPJULqCivuTPZ%2BkK2oqBlNH9l0PeYboSWJedf1IfrHPuctWxCO4QlgGtfMH7RK6gNYYAxBRFq2Pf1XabLs%2F1W70DWeUBY%2FrrbYNyPqKi7vrSWmo%2BQI40C2fEJgL8PMkcNEM3wMM0SRYLuX1Ra7Fq%2FsfV4ndJo0uCzuTQk%2F%2BTBSiq1DM3Fh0dpkEemZMykhOeVrIuTPQ%3D%3D&forceToH5=false",
"mobile_deeplink_checkout_url": null,
"qr_checkout_string": null
},
"is_redirect_required": true,
"callback_url": "https://ewalletvoid.free.beeceptor.com",
"created": "2022-12-07T07:58:07.446368Z",
"updated": "2022-12-07T07:58:07.446368Z",
"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
}