Quickly begin testing a Codapay integration.
This section will cover all the steps required to quickly begin testing with one of our popular integration types, which includes:
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.
Initiating a payment request.
What your customer will experience upon payment request.
What your customer will experience upon a successful payment notification.
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:
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.
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.
Use the InquiryPaymentResult API call below to inquire about the payment status of your transaction:
The result will appear as follows:
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.
The steps below walk you through activating a title, countries, and payment methods on Coda's Publisher Portal to start accepting payments.
How to activate title, countries, and payment methods
Start accepting payments for a specific title, in specific countries, using specific payment methods
Log in to your Publisher Portal account and navigate to “Titles”
Click on “Create Title”
Enter the title information or import them from the Google Play/App Store, select the content type and the countries of the payment channels you want to use
Select the service type as “Codapay”
On your publisher portal account, navigate to Integration -> Security -> Sandbox Configuration
Select the title/country you want to set up
Click “Edit” and enter your:
Complete Notification URL: This is where Codapay will notify you of a successful payment.
Complete Landing Page URL: This is the default URL to which your user will be redirected after the completion of the transaction. If you pass the returnURL
as part of your initial API call, it will override this value.
On your Publisher Portal account, navigate to Integration -> Security -> Codapay Publisher Settings where you will find your API key for each country.
Parameter | Placeholder text | Description |
---|---|---|
In the sandbox environment, you can follow the testing instructions .
Card number | Expiry date | CVC |
---|---|---|
Parameters | Description |
---|---|
Step 1
Create Title
Create a title that you will test an integration with.
Step 2
Set up your landing URL and the default callback URL
Configure the URLs for your selected title.
Step 3
Retrieve your API Key from the Publisher Portal
Get all the API Keys you need to start testing.
Step 1
Initiate the payment request
Start a payment request to get a response.
Step 2
Redirect your user to the payment page to complete payment
Complete the payment request.
Step 3
Receive the successful payment notification
Receive then respond with a success message.
Step 4
Check the status of a successful payment using the InquiryPaymentResult API call
country
The country that you want to test
currency
the currency code that you want to use
payType
the payment method that you want to use
apiKey
The APIKey that you have previously fetched from your publisher portal account.
TxnId
Coda transaction ID
OrderId
OrderId passed by you in the init request
ResultCode
The 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