Pre-Authorization payment also known as Pre-Auth enables you to block (pre-authorize) the funds on customer’s debit/credit card or ABA Account, instead of collecting them immediately. The funds are blocked for certain days depending on your business agreement.
During that time, you can either collect (Complete Pre-Auth), or release (Cancel Pre-Auth) the payment.
Pre-auth payments are suitable for situations, when during the purchasing process there is no guarantee that the goods will be available later.
Creating a pre auth transaction is similar to creating a purchase transaction, only difference is while you submit a purchase request you must include the parameter “type” value as “pre-auth” funds will be blocked on customer’s debit/credit card or ABA Account once customer authenticate the transaction.
Use Purchase API with parameter type value as “pre-auth”.
Use this API to collect the amount you requested to block with create Pre-Auth transaction from customer’s debit/credit or ABA Account.
Testing url:
https://checkout-sandbox.payway.com.kh/api/merchant-portal/merchant-access/online-transaction/pre-auth-completion
Production url:
https://checkout.payway.com.kh/api/merchant-portal/merchant-access/online-transaction/pre-auth-completion
Method: POST
# | Field name | Data type | Remark | Example |
---|---|---|---|---|
1 |
language
optional | HEADER/string [2] |
Support [en, km] – to be included on header of the request to request
Payment page in specific language.
en – English km – Khmer | en |
2 |
request_time
mandatory | Timestamp [UTC] | Format YYYYmmddHis | 20210123234559 |
3 |
merchant_id
mandatory | String [30] | Merchant id provided by PayWay integration team | onlinesshop24 |
4 |
merchant_auth
mandatory | {"mc_id":"ec000002","tran_id":"00002894", "refund_amount":"0.01"} Encrypt using the public key | b1453eac8cd686f90542c9d7dc026a3f70678afd | |
5 |
hash
mandatory | Text | Encrypted with sha512(merchant_auth_encryption + request_time+ merchant_id) | 3nd/2Z4g45Paoqx06QA3UQeHRC2Ts37zjudG7DqyyU2Cq0cvOFMYqwtEsXkaEmNOSiFh6Y+IHRdwnA2WA/M/Qg== |
{
"request_time":"20200728095315",
"merchant_id":"ec000002",
"merchant_auth":"b1453eac8cd686f90542c9d7dc026a3f70678afd"
"hash":"w33R2bVPVKY9M4WmeGoQUUcmtrJYFofFuMrgTMBLj/g8kPfXgnpK/qpjptO+1D0nKbpFktqM/iPWEyQ6/llsnJbw=="
}
{
"grand_total":"1.5",
"currency":"USD"
"transaction_status": "REFUNDED",
"status": {
"code": "00",
"message": "Success!"
}
}
# | Field name | Data type | Remark | Example |
---|---|---|---|---|
1 | grand_total | Double | ||
2 | currency | String | ||
3 | transaction_status | String | ||
4 | status | Array | ||
4.5 | code | String | ||
4.5 | message | String |
Use this API to release the blocked amount on customer card or ABA Account.
Testing url:
https://checkout-sandbox.payway.com.kh/api/merchant-portal/merchant-access/online-transaction/pre-auth-cancellation
Production url:
https://checkout.payway.com.kh/api/merchant-portal/merchant-access/online-transaction/pre-auth-cancellation
Method: POST
# | Field name | Data type | Remark | Example |
---|---|---|---|---|
1 |
language
optional | HEADER/string [2] | Support [en, km] | en |
2 |
request_time
mandatory | Timestamp [UTC] | Format YYYYmmddHis | 20210123234559 |
3 |
merchant_id
mandatory | String [30] | Mobile or Application ID | onlinesshop24 |
4 |
merchant_auth
mandatory | String | {"mc_id":"ec000002","tran_id":"00002894", "refund_amount":"0.01"} | b1453eac8cd686f90542c9d7dc026a3f70678afd |
5 |
hash
mandatory | Text | Encrypted with sha512(merchant_id + merchant_auth_encryption + request_time) | 3nd/2Z4g45Paoqx06QA3UQeHRC2Ts37zjudG7DqyyU2Cq0cvO+IHRdwnA2WA/M/Qg== |
{
"request_time":"20200728095315",
"merchant_id":"ec000002",
"merchant_auth":"b1453eac8cd686f90542c9d7dc026a3f70678afd"
"hash":"wR2bVPVKY9M4WmeGoQUUcmtrJYFofFuMrgTMBLj/g8kPfXgnpK/qpjptO+1D0nKbpFktqM/iPWEyQ6/llsnJbw=="
}
{
"grand_total":"1.5",
"currency":"USD"
"transaction_status": "CANCELLED",
"status": {
"code": "00",
"message": "Success!"
}
}
# | Field name | Data type | Remark | Example |
---|---|---|---|---|
1 | grand_total | Double | 1.5 | |
2 | currency | String | USD | |
3 | transaction_status | String | ||
4 | code | String | 00 | |
5 | message | String | Success! |