Pay At Counter

🚧

How to Integrate

Please refer high level diagram flow of Offline Payment.

Β 

Prepare Payment Token Request

Below are the required parameter for create payment. Refer to following on how to prepare request.

πŸ“˜

Please refer: Payment Token API Request

Pre Requisite

  1. MerchantID, secret code & CurrencyCode are provided by 2c2p.
  1. For PaymentChannel, merchant can refer to Pay At Counter (OTCTR / BCTR). Merchant is allowed to passed in either Category Code, Group Code or Channel Code.

If merchant already know which specific payment need to be proceed, merchant can passed in Channel Code, else pass in Category Code Or Group Code and available payment channel will be shown in Payment Option / Payment Option Detail API in next section.

{
    "merchantID": "JT01",
    "invoiceNo": "1523953661",
    "description": "item 1",
    "amount": 1000.00,
    "currencyCode": "SGD",
    "paymentChannel": ["COUNTER"]
}

Β 

Receive Payment Token Response

Below are the sample payment token response. Refer to following on how to receive.

πŸ“˜

Please refer: Payment Token API Response

{
  "paymentToken": "kSAops9Zwhos8hSTSeLTUYaEqC+mLu+pcQYSi1hKiZG2oeEUB94Sz6U3t3VzA5G1YqwkVqYYKn6Kw/tA4P2jm+v2m1IKE2D2pYUJCCFFT3k=",
  "respCode": "0000",
  "respDesc": "Success"
}

Β 

Validation of Payment Token

Process only when parameter "respCode" is "0000" which is success requested payment token. Otherwise, terminate the payment process. Refer to Refer below Payment Response Code.

🚧

Please refer : Payment Response Code

Β 

Prepare Payment Option Request [Optional Step]

Merchant required to call this API to get payment option. This is an optional step if merchant already know what is the available payment options. Below are the sample payment option request. Refer below on how to prepare request.

πŸ“˜

Please refer: Payment Option API Request

{
    "paymentToken": "kSAops9Zwhos8hSTSeLTUYaEqC+mLu+pcQYSi1hKiZG2oeEUB94Sz6U3t3VzA5G1YqwkVqYYKn6Kw/tA4P2jm+v2m1IKE2D2pYUJCCFFT3k=",
    "locale": null,
    "clientID": "30c7cf51-75c4-4265-a70a-effddfbbb0ff"
}

Β 

Receive Payment Option Response [Optional Step]

Below are the sample payment option response, refer to below on how to receive.

πŸ“˜

Please refer: Payment Option API Response

{
    "paymentToken": "kSAops9Zwhos8hSTSeLTUYaEqC+mLu+pcQYSi1hKiZG2oeEUB94Sz6U3t3VzA5G1YqwkVqYYKn6Kw/tA4P2jm+v2m1IKE2D2pYUJCCFFT3k=",
    "merchantDetails": {
        "id": "JT04",
        "name": "DEMO Merchant TH",
        "address": "DEMO",
        "email": "",
        "logoUrl": "https://pgw-static-sandbox.s3.amazonaws.com/images/merchantlogo/JT04.png",
        "bannerUrl": null
    },
    "transactionDetails": {
        "amount": "10.00",
        "currencyCode": "THB",
        "invoiceNo": "170920090943",
        "description": "V4 Test"
    },
    "channelCategories": [{
        "groups": [{
            "sequenceNo": 1,
            "name": "Bank Counter",
            "code": "BCTR",
            "iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/apm.png",
            "logoUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/logo/.png",
            "default": true,
            "expiration": false
        }, {
            "sequenceNo": 2,
            "name": "Pay at Counter",
            "code": "OTCTR",
            "iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/apm.png",
            "logoUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/logo/.png",
            "default": false,
            "expiration": false
        }],
        "sequenceNo": 1,
        "name": "Over The Counter",
        "code": "COUNTER",
        "iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/counter.png",
        "logoUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/logo/.png",
        "default": true,
        "expiration": false
    }],
    "respCode": "0000",
    "respDesc": "Success"
}

Β 

Prepare Payment Option Details Request [Optional Step]

Merchant required to call this API to get payment option details. This is an optional step if merchant already know what is the available payment option details. Below are the sample payment option details request. Refer below on how to prepare request.

Pre Requisite

  1. Payment Token get from Payment Token API
  1. CategoryCode & GroupCode get from Payment Option API

πŸ“˜

Please refer: Payment Option Details API Request

{
    "categoryCode": "COUNTER",
    "groupCode": "OTCTR",
    "paymentToken": "kSAops9Zwhos8hSTSeLTUYaEqC+mLu+pcQYSi1hKiZG2oeEUB94Sz6U3t3VzA5G1YqwkVqYYKn6Kw/tA4P2jm+v2m1IKE2D2pYUJCCFFT3k=",
    "locale": "en",
    "clientID": "30c7cf51-75c4-4265-a70a-effddfbbb0ff"
}

Β 

Receive Payment Option Details Response [Optional Step]

Below are the sample payment option response, refer to below on how to receive

πŸ“˜

Please refer: Payment Option Details API Response

{
    "totalChannel": 8,
    "name": "Bank Counter",
    "categoryCode": "COUNTER",
    "groupCode": "BCTR",
    "iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/apm.png",
    "channels": [{
        "sequenceNo": 1,
        "name": "Kasikorn Bank",
        "currencyCodes": null,
        "iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/KBANK.png",
        "logoUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/logo/KBANK.png",
        "payment": {
            "code": {
                "channelCode": "123",
                "agentCode": "KBANK",
                "agentChannelCode": "BANKCOUNTER"
            },
            "input": {
                "name": "O",
                "email": "O",
                "mobileNo": "O"
            },
            "validation": {
                "name": "^(?!\\s*$)[-a-zA-Z' ''.']{1,}$",
                "email": "^(([^<>()\\[\\]\\\\.,;:\\[email protected]\"]+(\\.[^<>()\\[\\]\\\\.,;:\\[email protected]\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$",
                "mobileNo": "[0-9]+",
                "additional": {
                    "cardNo": null,
                    "amount": {
                        "min": 0,
                        "max": 0
                    }
                }
            }
        },
        "isDown": false
    }, {
        "sequenceNo": 2,
        "name": "The Siam Commercial Bank",
        "currencyCodes": null,
        "iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/SCB.png",
        "logoUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/logo/SCB.png",
        "payment": {
            "code": {
                "channelCode": "123",
                "agentCode": "SCB",
                "agentChannelCode": "BANKCOUNTER"
            },
            "input": {
                "name": "O",
                "email": "O",
                "mobileNo": "O"
            },
            "validation": {
                "name": "^(?!\\s*$)[-a-zA-Z' ''.']{1,}$",
                "email": "^(([^<>()\\[\\]\\\\.,;:\\[email protected]\"]+(\\.[^<>()\\[\\]\\\\.,;:\\[email protected]\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$",
                "mobileNo": "[0-9]+",
                "additional": {
                    "cardNo": null,
                    "amount": {
                        "min": 0,
                        "max": 0
                    }
                }
            }
        },
        "isDown": false
    }, {
        "sequenceNo": 3,
        "name": "Bangkok Bank PCL",
        "currencyCodes": null,
        "iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/BBL.png",
        "logoUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/logo/BBL.png",
        "payment": {
            "code": {
                "channelCode": "123",
                "agentCode": "BBL",
                "agentChannelCode": "BANKCOUNTER"
            },
            "input": {
                "name": "O",
                "email": "O",
                "mobileNo": "O"
            },
            "validation": {
                "name": "^(?!\\s*$)[-a-zA-Z' ''.']{1,}$",
                "email": "^(([^<>()\\[\\]\\\\.,;:\\[email protected]\"]+(\\.[^<>()\\[\\]\\\\.,;:\\[email protected]\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$",
                "mobileNo": "[0-9]+",
                "additional": {
                    "cardNo": null,
                    "amount": {
                        "min": 0,
                        "max": 0
                    }
                }
            }
        },
        "isDown": false
    }, {
        "sequenceNo": 4,
        "name": "Krung Thai Bank",
        "currencyCodes": null,
        "iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/KTB.png",
        "logoUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/logo/KTB.png",
        "payment": {
            "code": {
                "channelCode": "123",
                "agentCode": "KTB",
                "agentChannelCode": "BANKCOUNTER"
            },
            "input": {
                "name": "O",
                "email": "O",
                "mobileNo": "O"
            },
            "validation": {
                "name": "^(?!\\s*$)[-a-zA-Z' ''.']{1,}$",
                "email": "^(([^<>()\\[\\]\\\\.,;:\\[email protected]\"]+(\\.[^<>()\\[\\]\\\\.,;:\\[email protected]\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$",
                "mobileNo": "[0-9]+",
                "additional": {
                    "cardNo": null,
                    "amount": {
                        "min": 0,
                        "max": 0
                    }
                }
            }
        },
        "isDown": false
    }, {
        "sequenceNo": 5,
        "name": "Bank of Ayudhya",
        "currencyCodes": null,
        "iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/BAY.png",
        "logoUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/logo/BAY.png",
        "payment": {
            "code": {
                "channelCode": "123",
                "agentCode": "BAY",
                "agentChannelCode": "BANKCOUNTER"
            },
            "input": {
                "name": "O",
                "email": "O",
                "mobileNo": "O"
            },
            "validation": {
                "name": "^(?!\\s*$)[-a-zA-Z' ''.']{1,}$",
                "email": "^(([^<>()\\[\\]\\\\.,;:\\[email protected]\"]+(\\.[^<>()\\[\\]\\\\.,;:\\[email protected]\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$",
                "mobileNo": "[0-9]+",
                "additional": {
                    "cardNo": null,
                    "amount": {
                        "min": 0,
                        "max": 0
                    }
                }
            }
        },
        "isDown": false
    }, {
        "sequenceNo": 6,
        "name": "TMB Bank Public Company Limited",
        "currencyCodes": null,
        "iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/TMB.png",
        "logoUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/logo/TMB.png",
        "payment": {
            "code": {
                "channelCode": "123",
                "agentCode": "TMB",
                "agentChannelCode": "BANKCOUNTER"
            },
            "input": {
                "name": "O",
                "email": "O",
                "mobileNo": "O"
            },
            "validation": {
                "name": "^(?!\\s*$)[-a-zA-Z' ''.']{1,}$",
                "email": "^(([^<>()\\[\\]\\\\.,;:\\[email protected]\"]+(\\.[^<>()\\[\\]\\\\.,;:\\[email protected]\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$",
                "mobileNo": "[0-9]+",
                "additional": {
                    "cardNo": null,
                    "amount": {
                        "min": 0,
                        "max": 0
                    }
                }
            }
        },
        "isDown": false
    }, {
        "sequenceNo": 7,
        "name": "Thanachart Bank",
        "currencyCodes": null,
        "iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/TBANK.png",
        "logoUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/logo/TBANK.png",
        "payment": {
            "code": {
                "channelCode": "123",
                "agentCode": "TBANK",
                "agentChannelCode": "BANKCOUNTER"
            },
            "input": {
                "name": "O",
                "email": "O",
                "mobileNo": "O"
            },
            "validation": {
                "name": "^(?!\\s*$)[-a-zA-Z' ''.']{1,}$",
                "email": "^(([^<>()\\[\\]\\\\.,;:\\[email protected]\"]+(\\.[^<>()\\[\\]\\\\.,;:\\[email protected]\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$",
                "mobileNo": "[0-9]+",
                "additional": {
                    "cardNo": null,
                    "amount": {
                        "min": 0,
                        "max": 0
                    }
                }
            }
        },
        "isDown": false
    }, {
        "sequenceNo": 8,
        "name": "United Overseas Bank",
        "currencyCodes": null,
        "iconUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/icon/UOB.png",
        "logoUrl": "https://d27uu9vmlo4gwh.cloudfront.net/images/v4/images/logo/UOB.png",
        "payment": {
            "code": {
                "channelCode": "123",
                "agentCode": "UOB",
                "agentChannelCode": "BANKCOUNTER"
            },
            "input": {
                "name": "O",
                "email": "O",
                "mobileNo": "O"
            },
            "validation": {
                "name": "^(?!\\s*$)[-a-zA-Z' ''.']{1,}$",
                "email": "^(([^<>()\\[\\]\\\\.,;:\\[email protected]\"]+(\\.[^<>()\\[\\]\\\\.,;:\\[email protected]\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$",
                "mobileNo": "[0-9]+",
                "additional": {
                    "cardNo": null,
                    "amount": {
                        "min": 0,
                        "max": 0
                    }
                }
            }
        },
        "isDown": false
    }],
    "validation": null,
    "configuration": {
        "payment": {
            "tokenize": false,
            "tokenizeOnly": false,
            "cardTokenOnly": false,
            "immediatePayment": false
        },
        "notification": {
            "facebook": false,
            "whatsApp": false,
            "line": false
        }
    },
    "respCode": "0000",
    "respDesc": "Success"
}

Β 

Prepare Do Payment Request

Merchant required to call this API to request payment. Below are the sample do payment request. Refer below on how to prepare request.

Pre Requisite :

  1. Payment Token get from Payment Token API
  1. ChannelCode, AgentCode & AgentChannelCode get from Payment Option Details API Response.
    Merchant can direct pass in specific ChannelCode, AgentCode & AgentChannelCode from payment channel list if they already know what are the code.
  1. To prepare Do Payment request parameter payment.data, it is required to refer Payment Option Details API Response parameter channels.payment.input to determine which payment data is required.

πŸ“˜

Please refer: Do Payment API Request

{
    "responseReturnUrl": "https://sandbox-pgw-ui.2c2p.com/payment/4.1/#/info/",
    "payment": {
        "code": {
            "channelCode": "123",
            "agentCode": "KBANK",
            "agentChannelCode": "BANKCOUNTER"
        },
        "data": {
            "name": "terrance",
            "email": "[email protected]",
            "mobileNo": "+60123344556"
        }
    },
    "clientIP": "175.143.223.174",
    "paymentToken": "kSAops9Zwhos8hSTSeLTUYaEqC+mLu+pcQYSi1hKiZG2oeEUB94Sz6U3t3VzA5G1YqwkVqYYKn6Kw/tA4P2jm+v2m1IKE2D2pYUJCCFFT3k=",
    "locale": "en",
    "clientID": "30c7cf51-75c4-4265-a70a-effddfbbb0ff"
}

Β 

Receive Do Payment Response

Below are the sample Do Payment response, refer below on how to receive

πŸ“˜

Please refer: Do Payment API Response

{
    "data": "https://demo2.2c2p.com/2C2PFrontEnd/storedCardPaymentV2/MPaymentProcess.aspx?token=Syw1xh08gpRdQBOiXs8vwiu3c/Bq0gLn+KdAQQYUU6tg8n7RRc7zVu9VLDcdwnnC",
    "channelCode": "123",
    "respCode": "1001",
    "respDesc": "Redirect to authenticate ACS bank page."
}

Β 

Display QR Code Image

parameter from Do Payment Response

Description

data

third party URL end point

respCode

indicate what is the redirection method. merchant required to refer to Payment Process Flow

Merchant required to perform redirection to third party URL to process the payment based on response from do payment api.

**If return respCode is is failed or rejected, process terminate here.*

Β 

Customer Print or Download the Payment Slip and Return to Merchant end

Customer required to print or download payment slip and return to merchant page. Customer is required to completed pay it at counter or kiosk machine.

Β 

Payment Pending Page

Merchant required to display payment pending until customer has completed payment at counter or kiosk machine. This required merchant UI to have a looping function to keep checking the transaction status with 2c2p refer to below Transaction Status API. Merchant required to display payment confirmation when Transaction Status API return end status (Success or failed) and looping function end.

πŸ“˜

Please refer : Transaction Status API

Β 

Receive Payment Response via backend API

πŸ“˜

Please refer: Payment Response - Backend API

The parameter "backendReturnUrl" that previously send via Payment Token Request is the merchant endpoint that will receive backend notification. If parameter "backendReturnUrl" is not set, system will default get the backend return url from merchant profile set in 2c2p merchant portal.

{
  "merchantID": "JT04",
  "invoiceNo": "170920090943",
  "cardNo": null,
  "amount": 10.0,
  "userDefined1": "",
  "userDefined2": "",
  "userDefined3": "",
  "userDefined4": "",
  "userDefined5": "",
  "currencyCode": "THB",
  "cardToken": "",
  "recurringUniqueID": "",
  "tranRef": "209139",
  "referenceNo": "",
  "approvalCode": null,
  "eci": "",
  "transactionDateTime": "20200917093228",
  "agentCode": "KBANK",
  "channelCode": "BANKCOUNTER",
  "issuerCountry": "",
  "installmentMerchantAbsorbRate": null,
  "respCode": "0000",
  "respDesc": "Success"
}

Β 

Prepare Payment Inquiry Request

Merchant required to call this API to inquiry payment. If merchant has implemented backend payment response , payment inquiry is not required Below are the sample payment inquiry request. Refer below on how to prepare request.

πŸ“˜

Please refer : Payment Inquiry API Request

{
    "merchantID": "JT04",
    "invoiceNo": "170920090943",
    "locale": "en"
}

Β 

Receive Payment Inquiry Response

Merchant is required to received payment inquiry response, Refer below on how to receive

πŸ“˜

Please refer : Payment Inquiry API Response

{
  "merchantID": "JT04",
  "invoiceNo": "170920090943",
  "cardNo": null,
  "amount": 10.0,
  "userDefined1": "",
  "userDefined2": "",
  "userDefined3": "",
  "userDefined4": "",
  "userDefined5": "",
  "currencyCode": "THB",
  "cardToken": "",
  "recurringUniqueID": "",
  "tranRef": "209139",
  "referenceNo": "",
  "approvalCode": null,
  "eci": "",
  "transactionDateTime": "20200917093228",
  "agentCode": "KBANK",
  "channelCode": "BANKCOUNTER",
  "issuerCountry": "",
  "installmentMerchantAbsorbRate": null,
  "respCode": "0000",
  "respDesc": "Success"
}