Credit Card Payment Flow
Merchant can integrate with Core Payment API in 2 ways:
Non-UI: For merchant who already has their own payment page or would like to have total control over the behavior of payment journey by implementing payment form themselves, and
UI with Redirection: For merchant who want to use 2C2P standard Payment Page for faster time to market which already support mobile responsive design with integrated payment selection menu.
Non-UI
- Merchant frontend gather payment detail on their own payment form
- Merchant backend server call to 2C2P /nonUI method of Payment API
- 2C2P performs authentication/authorization and update payment status
- 2C2P returns payment status back
UI with Redirection (prePaymentUI)
- Merchant frontend (may) gather preferred payment method and/or partial information of payment details. This information is referred to as incomplete payment details.
- Merchant backend call /prePaymentUI method of Payment API
- 2C2P persist detail of incomplete payment and then response back with redirect URL.
- Client frontend then instructed to redirect back to the URL of 2C2P Payment Page
- 2C2P will inquiry and pull in incomplete payment data then present those information on Payment Page
- Customer then fill in payment details such as card number and expiry date on Payment Page
- Payment Page will invoke /nonUI method once customer click to proceed their payment with entered data
- 2C2P performs authentication/authorization and update payment status
- 2C2P returns payment status back. At this point customer will be presented with payment result page
- Payment Page will internally save acknowledgement status. The payment is considered success according to PGW.
- 2C2P will send backend notification request to merchant backend to inform payment result. Merchant backend supposed to update the payment status accordingly.
- Merchant backend may optionally send acknowledgement back. Simply response to the notification request with HTTP Status 200 is suffice.
- 2C2P will then send frontend notification to merchant frontend. Depend on payment outcome, the destination URL can be confirmationURL, failedURL or cancellationURL for success, failed and cancelled outcome respectively.
Sample Payment Request
This is a lightweight payment request example to prePaymentUI. The response message will be in similar format as Backend Notification below. Please refer to full message specification on dedicated Payment API page.
{
"paymentType": "CC",
"paymentCategory": "ECOM",
"orderNo": "TT1650866348389",
"productDescription": "Merchant Test Tool 1650866348389",
"mcpFlag": "N",
"transactionAmount": {
"currencyCode": "THB",
"amount": "1",
"decimalPlaces": 2,
"amountText": "000000000100"
},
"channelCode": "WEBPAY",
"request3dsFlag": "N",
"autoRedirectDelayTimer": 5,
"notificationURLs": {
"confirmationURL": "http://confirmation-url2c2p.com",
"failedURL": "http://failed-url2c2p.com",
"cancellationURL": "http://cancellation-url2c2p.com",
"backendURL": "http://backend-url2c2p.com"
},
"recurringPaymentDetails": {
"rppFlag": "N"
},
"generalPayerDetails": {
"personType": "General",
"seqNo": 1,
"personName": {
"title": "Mr.",
"firstName": "Merchant Test Tool User"
}
},
"installmentPaymentDetails": {
"ippFlag": "N"
},
"officeId": "aaa",
"apiRequest": {
"requestMessageID": "3fd2e3e7-f5a9-4cee-5599-f0e7fffb995c",
"requestDateTime": "2022-04-25T07:54:45.696Z",
"language": "en-US"
}
}
Updated 9 days ago