Test Guideline
Deskripsi
Testing dan developmen dengan Xendit eWallets bisa dilakukan tanpa akun aktif. Sesudah registrasi akun Xendit gratis, anda bisa simulasi pembayaran eWallet via API.
Tes Pembayaran eWallet
- Untuk melakukan testing dengan xendit, buatlah secret API key untuk test mode. Pastikan untuk memberikan izin untuk Money-In sebagai
WRITE
- Siapkan callback URL pilihan Anda di bagian
Callbacks
pada tabSettings
- Ikuti Referensi API kami untuk mengetahui detail tentang persyaratan reques.
Tes alur One-Time Payment
Step 1: Hasilkan Reques Charge eWallet
Kirimkan reques ‘POST’ ke Create eWallet Charge API menggunakan developmen API key anda
INFO
Untuk simulasi skenario error/failure, harap gunakan nilai yang sesuai untuk parameter amount
yang ditentukan dalam Testing Scenarios for eWallet Endpoints halaman.
:::info
Untuk simulasi skenario error/failure, harap gunakan nilai yang sesuai untuk parameter amount
yang ditentukan dalam Testing Scenarios for eWallet Endpoints halaman. :::
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"
}
}
Jika sukses, anda akan mendapatkan respons PENDING
{
"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: Simulasi Pembayaran eWallet
Buka URL yang di bawah parameter actions
dari respons di atas (e.g. https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=12345
) dan lanjutkan untuk simulasikan pembayaran. Perhatikan bahwa di mode production, untuk ID_OVO
, link tidak akan dikembalikan di bawah parameter actions
tetapi end user akan menerima notifikasi di ponsel terdaftar mereka
Jika sukses, anda akan dialihkan ke success_redirect_url
dan mendapatkan callback pembayaran sukses
{
"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
}
}
Tes Alur Pembayaran Tokenisasi
Step 1: Hasilkan Object Customer
Kirimkan reques POST
ke Create Customer Object API menggunakan development API key
POST https://api.xendit.co/customers
{
"reference_id": "customer-id-123",
"mobile_number": "+6208774494404",
"given_names": "John Doe"
}
Jika sukses, anda akan mendapatkan customer_id
di dalam responsnya
{
"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: Hasilkan Metode Pembayaran eWallet
Kirimkan reques POST
ke Create Payment Method API menggunakan customer_id
yang baru dihasilkan
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"
}
Jika sukses, anda akan medapatkan respons REQUIRES_ACTION
{
"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": {
"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: Simulasi linking Akun eWallet
Buka URL yang ditampilkan di bawah parameter actions
dari respons di atas (e.g. https://link-web-staging.xendit.co/oauth/lat-b32caa2d-a36b-4e50-a1da/confirm
) dan lanjutkan simulasi linking akun
Jika sukses, anda akan dialihkan ke success_return_url
dan mendapatkan callback sukses linking akun
{
"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": {
"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: Hasilkan Charge eWallet
Kirimkan reques POST
ke Create eWallet Charge API menggunakan payment_method_id
yang baru dihasilkan
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"
}
Jika sukses, anda akan mendapatkan respons PENDING
{
"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/ovo",
"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: Simulasi Pembayaran eWallet (Cuman berlaku untuk alur Non-Auto Debit)
INFO
Mengalihkan end user untuk mengizinkan pembayaran berikutnya setelah linking akun hanya berlaku untuk eWallet dengan alur tokenisasi redirection. Untuk eWallet dengan alur tokenisasi auto debit, callback pembayaran dikirim tanpa perlu mengalihkan end user ke URL simulasi pembayaran.
Indonesia
Value | OVO | DANA | LinkAja |
---|---|---|---|
Alur Tokenisasi Dasar | Redirection | Redirection | Redirection |
Philippines
Value | PayMaya | GrabPay | ShopeePay (PH) |
---|---|---|---|
Alur Tokenisasi Dasar | Auto Debit | Auto Debit | Auto Debit |
Buka URL yang dikembalikan di bawah parameter actions
dari respons yang baru dihasilkan (e.g. https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=12345
) dan lanjutkan untuk simulasikan pembayaran
Jika sukses anda akan dialihkan ke success_redirect_url
dan mendapatkan callback pembayaran sukses
{
"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/ovo",
"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
}
}
Last Updated on 2023-05-17