Search...
APIJSLog inGet started
Airwallex logo
Home
Platform APIs
Connected Accounts
Accounts
Payments
Transactional FX
Payouts
Issuing
Back to home
OverviewAPI
SDKs
Demo environment
Demo environment overviewConnected accounts
Deposits
Linked Accounts
Payments
Simulate shopper action
Simulate payment disputes
Payouts
Issuing
Risk

Simulate shopper action

You can conduct end-to-end testing of your local payment methods integration by simulating shopper actions after being redirected to the payment page in the demo environment. To learn about local payment methods offered by Airwallex Online Payments, see payment methods.

Key simulation scenarios include:

  • Simulate a successful or failed payment on a payment intent.
  • Simulate verification of a payment method on a payment consent.

The redirect URL is obtained from the response of a PaymentIntent or PaymentConsent. A successful simulation of a shopper action on the given URL will return HTTP status 200 OK and an empty body.

As a platform account, you can call the simulation APIs on behalf of a connected account using the x-on-behalf-of header.

Pay or reject a payment

Call Simulate shopper action API with the following action URL parameter and request body field.

  • action: In the URL path, specify pay or reject to simulate a successful or failed payment respectively.
  • url: Specify the next_action.url obtained from the response of Confirm a PaymentIntent API in the demo environment. The shopper action will be simulated after redirection to this URL.

Create a simulation for successful payment

Shell

Create a simulation for failed payment

Shell

Troubleshooting

You might encounter the following errors when simulating payment APIs.

Error scenario Error code Error response Recommended actions
Invalid action in action parameter validation_error {
"code": "validation_error",
"message": "Invalid action. Supported values are: pay,reject,verify."
}
Check input and pass valid values for action parameter.
Invalid URL in url parameter validation_error {
"code": "validation_error",
"message": "Invalid URL: ${url}"
}
Check input and pass valid values for url parameter.
Unsupported action for the url parameter

For example, a PaymentConsent URL passed as a URL for a payment that only supports `pay` and `reject`. Or, if the URL is not generated with the payment_intent/confirm API, hence not recognized by our system.
operation_not_supported {
"code": "operation_not_supported",
"message": "Requested action ${action} is not supported."
}
Check the url and action values and make sure the url can support the action.
General failures in the system. internal_error {
"code": "internal_error",
"message": "An internal error was encountered."
}
Contact Airwallex support.
Was this page helpful?
On this page
  • Pay or reject a payment
  • Verify a payment consent
  • Troubleshooting
Was this page helpful?