Purchase
The Purchase API is used to initiate a payment transaction between a customer and a merchant through PayWay. It allows merchants to request a payment by providing transaction details such as the amount, currency, item list, and other relevant data.
Once the API is called, the customer is redirected to PayWay’s hosted checkout page, bottom sheet, or modal popup—depending on your integration option—where they can complete the payment using the available methods (e.g., card, ABA PAY, KHQR, digital wallets). After the transaction is completed, PayWay will return the transaction result to the merchant via the configured return URL or callback.
Request
Example: multipart/form-data
Body Params multipart/form-data
Request date and time in UTC format as YYYYMMDDHHmmss.
A unique merchant key which provided by ABA Bank.<= 30 characters
A unique transaction identifier for the payment.<= 20 characters
Purchase amount.
Buyer's first name.<= 100 characters
Buyer's last name.<= 100 characters
Buyer's email.<= 50 characters
Buyer's phone.<= 20 characters
Type of the transaction, default value is purchase. Supported value:
pre-auth: for pre purchasepurchase: for full purchase
Note: pre-auth only support ABA PAY, KHQR and Card Payment.<= 20 characters
Payment Methods for Transactions:
cards: For card payments.abapay_khqr: QR payment that can be scanned and paid using ABA PAY and other KHQR member banks.abapay_khqr_deeplink: Allows customers to pay using ABA PAY and other KHQR member banks. The payment gateway will respond with a JSON object containingqr_string,abapay_deeplink, andcheckout_qr_url. See the sample response in the response section below.alipay: Allows customers to pay using Alipay Wallet.wechat: Allows customers to pay using WeChat Wallet.google_pay: Allows customers to pay using Google Pay Wallet.
If no value is provided, the payment gateway will automatically display the supported payment options based on your profile, allowing the customer to choose a preferred payment method.<= 20 characters
A Base64-encoded JSON array describing the items being purchased.
It supports up to 50 line items with no character limit.
Note: This is only description/remark. The price or quantity in this info will not be used for calculation or any validation purposes
PHP Sample Code
Shipping fee.
Transaction currency of the payment. If you don't pass any value, it will take default value from your merchant profile (the first account's the currency of the first account you registered). Supported values are KHR or USD.
URL to receive callbacks upon payment completion, encrypted with Base64.
The URL to redirect to after the user closes the payment dialog or when user cancel the payment.
Skip success page can be configure on checkout service level. We also provide option via the API for you to override the setting too. If you don't pass this param, it will follow the configuration on the profile level. Supported value:
0: Don't skip success pages.1: Skip success page.
Once you skipe success page, continue_success_url on profile level will be used to redirect user to the specific location if you don't pass value of continue_success_url in the request.
The URL to redirect to after a successful payment.
The deep link for redirecting to the app after a successful payment from ABA Mobile. Must be base64-encoded and include both iOS and Android schemes. This field is mandatory for mobile integration.
PHP Sample Code
Additional information that you want to attach to the transaction. This information will appear in the transaction list, transaction details and export report. It's base64-encoded JSON info.
PHP Sample Code
Information to include when PayWay calls your return URL after a successful payment.
Defines the view type for the payment page.
hosted_view: redirect payer to a new tabpopup: Display as a bottom sheet on mobile web browsers and as a modal popup on desktop web browsers.
If your merchant profile also supports the QR Payment API service, please set this parameter to 0 to use the Checkout service.
Base64-encoded JSON string representing payout details.
PHP Sample Code
Currently, we support WeChat Mini Program. These are the values key wechat sub_appid and wechat_sub_openid.
PHP Sample Code
The payment's lifetime in minutes, once it exceeds customer will not allow to make payment. Default value is 30 days.
- Min: 3 mins
- Max: 30 days
- For ABA PAY or Card: Transaction will not go throught.
- KHQR: In case payment happen after exceed life time, PayWay will also reject. Fund will be reverse back to payer.
- WeChat & Alipay: No reversal.
This field is required if payment_option is set to google_pay and the payment selection is managed by the merchant. For detailed instructions, please refer to the Google Pay integration guidelines.
Base64 encode of hash hmac sha512 encryption of concatenates values below values.
PHP Sample Code
Example