Test Hosted Payment Page API
After you set up accepting payments in the Publisher Portal, you can quickly test a payment flow for a payment method.
This tutorial only shows how to test for a specific payment method. If you are interested in our Payment Selection Page, you can follow this guide.
What you'll learn
Initiating a payment request.
What your customer will experience upon payment request.
What your customer will experience upon a successful payment notification.
Step 1: Initiate the payment request
Initiate the payment request by calling the
/init
endpoint to collect your payment transaction ID. Use the curl below and populate it with:
Other parameters have been populated with dummy data for testing purposes below. They can be changed and populated properly as part of your integration. More details on the parameters of the /init
endpoint can be found here.
Below is an example using a dummy sandbox API Key for Singapore, with Singapore Dollar (SGD) as a currency and Card Payments as a payment method.
The following response will be returned:
Step 2: Redirect your user to the payment page to complete payment
Utilize the received
txnId
from Step 1 to redirect your user to the following URL:
Below is an example of what it would look like for the transaction initiated above for Card Payments in Singapore:
Complete a test transaction with Card Payments in Singapore and use the following test card below.
Step 3: Receive the successful payment notification
You will receive a notification on the Complete Notification URL, including the following fields as query parameters:
Respond to this notification with a success message
ResultCode=0
or a failure message (including an appropriate error code).
If you want to try receiving an error response, simply replace the error code digit with any of the available error codes, which you can access here.
Step 4: Check the status of a successful payment using the InquiryPaymentResult API call
Use the InquiryPaymentResult API call below to inquire about the payment status of your transaction:
The result will appear as follows:
Next steps
Dive deeper into Payment Page API to understand more about the Hosted Payment Page and Payment Channel Selection Page offering.
Dive deeper to our Backend API offering.
Last updated