Test Hosted Payment Page API
After you set up accepting payments in Coda Portal, you can quickly test a payment flow for a payment method.

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.
This tutorial assumes you have a developer set up and tools to make API calls (Postman, ...). If that is not the case, you can also test the flow through our Coda Portal "Sandbox Testing" section.
Step 1: Initiate the payment request
Initiate the payment request by calling the
/initendpoint to collect your payment transaction ID. Use the curl below and populate it with:
Make sure that the price is within transaction limits for the payment channel you’ve selected by checking transaction limits 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.
Step 2: Redirect your user to the payment page to complete payment
Use the received
txnIdfrom 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:


In the sandbox environment, you can follow the testing instructions provided here to complete the payment.
Note: On the sandbox environment, the payment might take a few minutes to complete.
Step 3: Receive the successful payment notification
You will receive a notification on the Complete Notification URL, including the following fields as query parameters:
TxnId
Coda transaction ID
OrderId
OrderId passed by you in the init request
ResultCode
Payment status (e.g. success = 0)
TotalPrice
Total price paid by the user for the transaction
PaymentType
Payment Channel ID chosen by the user
Checksum
A checksum to verify that messages have not been altered
Respond to this notification with a success message
ResultCode=0or a failure message (including an appropriate error code).
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.
Next steps
Dive deeper into Payment Page API to understand more about the Hosted Payment Page and Payment Channel Selection Page offering.
Dive deeper into our Backend API offering.
Last updated
Was this helpful?