Do Payment
HTTPS POST / Server-to-Server
https://sandbox-pgw.2c2p.com/payment/4.3/payment
https://pgw.2c2p.com/payment/4.3/payment
API Parameter
Do Payment Request Parameters
Do Payment Response Parameters
The Do Payment API allows merchants to start and process a transaction.
Do Payment Request
The sample code below demonstrates the data structure for an API request.
{
"paymentToken": "kSAops9Zwhos8hSTSeLTUcCrwcnrndJUZanGJy3fBEsXCiYmynwxHvK5h7XPBadJqD0nG7v65t5N2jPVrnwX2jL4nu+KKSegjUjERKCyWPg=",
"clientID": "E380BEC2BFD727A4B6845133519F3AD7",
"locale": "en",
"responseReturnUrl": "https://pgw.2c2p.com/ui/4.3/info",
"payment": {
"code": {
"channelCode": "CC",
"agentCode": "SCB",
"agentChannelCode": "ATM"
},
"data": {
"name": "DavidBilly",
"email": "[email protected]",
"mobileNo": "0888888888",
"accountNo": "0898989898",
"securePayToken": "00acNz9uu0tZuVSSiQ...OwfCzy" //For encrypt card no, expiry
}
}
}
curl --location --request POST 'https://sandbox-pgw.2c2p.com/payment/4.3/payment' \
--header 'Content-Type: application/json' \
--data-raw '{
"paymentToken": "kSAops9Zwhos8hSTSeLTUcCrwcnrndJUZanGJy3fBEsXCiYmynwxHvK5h7XPBadJqD0nG7v65t5N2jPVrnwX2jL4nu+KKSegjUjERKCyWPg=",
"clientID": "E380BEC2BFD727A4B6845133519F3AD7",
"locale": "en",
"responseReturnUrl": "https://pgw.2c2p.com/ui/4.3/info",
"payment": {
"code": {
"channelCode": "CC",
"agentCode": "SCB",
"agentChannelCode": "ATM"
},
"data": {
"name": "DavidBilly",
"email": "[email protected]",
"mobileNo": "0888888888",
"accountNo": "0898989898",
"securePayToken": "00acNz9uu0tZuVSSiQ...OwfCzy" //For encrypt card no, expiry
}
}
}'
Do Payment Response
The sample code below demonstrates the data structure for an API response.
//1) Non-redirect (Transaction completed)
{
"channelCode": "CC",
"invoiceNo": "1523953661",
"respCode": "2000",
"respDesc": "Transaction is completed, please do payment inquiry request for full payment information."
}
//2) Redirect(Mobile/Web-IFrame) & (Alternative Payment Method for WebPay)
{
"channelCode": "CC",
"data": "https://api.2c2p.com/pgw/authenticate/e5d8d1ed-2684-48b2-a7b6-d36fbc4fa5c2",
"respCode": "1000",
"respDesc": "Redirect to authenticate ACS bank page."
}
//3) Redirect(Web-New Tab)
{
"channelCode": "CC",
"data": "https://api.2c2p.com/pgw/authenticate/e5d8d1ed-2684-48b2-a7b6-d36fbc4fa5c2",
"respCode": "1001",
"respDesc": "Redirect to authenticate ACS bank page."
}
//4) Redirect(Mobile-External Browser for multiple tab)
{
"channelCode": "BANK",
"data": "https://api.2c2p.com/pgw/authenticate/e5d8d1ed-2684-48b2-a7b6-d36fbc4fa5c2",
"respCode": "1002",
"respDesc": "Redirect to E-NETS DBS page."
}
//5) Non-Redirect (Alternative Payment Method(123) for Payment Slip)
{
"channelCode": "COUNTER",
"data": "https://api.2c2p.com/pgw/slip/254b77a5-5568-49ca-9e0e-2f8d28be95e7",
"extra": {
"qrData": "|010555303610000 0000006499389366 0000006499389366 1000",
"barcodeData": "|010555303610000 0000006499389366 0000006499389366 1000",
"referenceNo": "6499389366"
},
"respCode": "1003",
"respDesc": "Transaction is pending for payment, please wait for backend notification."
}
//6) Redirect(Mobile-External APP)
{
"channelCode": "OCTOPUS",
"data": "octupus://token?e5d8d1ed-2684-48b2-a7b6-d36fbc4fa5c2",
"respCode": "1004",
"respDesc": "Redirect to OCTOPUS app."
}
//7) Generate QR
{
"channelCode": "CSQR",
"type": "URL",
"data": "https://api.2c2p.com/pgw/qr/e5d8d1ed-2684-48b2-a7b6-d36fbc4fa5c2.png",
"respCode": "1005",
"respDesc": "Pending for user scan QR."
}
Run test with Swagger Editor
Updated over 1 year ago