Subscription

Base URL: https://checkout-sandbox.payway.com.kh/Copy to clipboard
POST

This API allows a merchant to make a purchase transaction while at the same time linking the customer’s card and ABA account to the merchant’s system. Once the purchase is successfully completed, the API will push a token back to the merchant, which can be used for future payments or account verification.

Subscription flow with ABA Account

Request

Header Params
stringrequired

Example: multipart/form-data

Body Params multipart/form-data

stringrequired

Request date and time in UTC format as YYYYMMDDHHmmss.

stringrequired

A unique merchant key which provided by ABA Bank.

<= 30 characters
stringrequired

A unique transaction identifier for the payment.

<= 20 characters
stringoptional

Buyer's first name.

<= 20 characters
stringoptional

Buyer's last name.

<= 20 characters
stringoptional

Buyer's email.

<= 50 characters
stringoptional

Buyer's phone.

<= 20 characters
stringoptional
  • purchase : for full purchase
<= 20 characters
stringrequired

Payment Methods for Transactions:

  • cards: For card payments.
  • abapay: QR payment that can be scanned and paid using ABA PAY.
  • abapay_deeplink: Allows customers to pay using ABA PAY. The payment gateway will respond with a JSON object containing qr_string, abapay_deeplink, and checkout_qr_url. See the sample response in the response section below.
<= 20 characters
stringoptional

A base64-encoded JSON array describing the items being purchased.

PHP Sample Code

$item = base64_encode(json_encode([
    ["name" => "product 1","quantity" => 1,"price" => 1.00],
    ["name" => "product 2","quantity" => 2, "price" => 4.00]
]));

Note: This is only description/remark. The price or quantity in this info will not be used for calculation or any validation purposes

<= 500 characters
numberoptional

Shipping fee.

numberrequired

Purchase amount.

stringoptional

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.

stringoptional

The URL to which PayWay will send the payment notification upon success.

stringoptional

The URL to redirect to after the user closes the payment dialog or when user cancel the payment.

integeroptional

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.

stringoptional

The URL to redirect to after a successful payment.

stringoptional

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

$return_deeplink =base64_encode(json_encode([
    "ios_scheme" => "DEEPLINK TO RETURN TO YOUR IOS APP",
    "android_scheme" => "DEEPLINK TO RETURN TO YOUR ANDROID APP"
]));
stringoptional

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

$custom_field = base64_encode(json_encode([
    "field1" => "myvalue1",
    "field2" => "myvalue2"
]));
stringoptional

Information to include when PayWay calls your return URL after a successful payment.

stringoptional

Defines the view type for the payment page.

  • hosted_view : redirect payer to a new tab
  • popup : Display as a bottom sheet on mobile web browsers and as a modal popup on desktop web browsers.
integeroptional

If your merchant profile also supports the QR Payment API service, please set this parameter to 0 to use the Checkout service.

stringoptional

Base64-encoded JSON string representing payout details.

PHP Sample Code

$payout = base64_encode(json_encode([
    ["acc" => "000133879","amt"=> 1],
    ["acc" => "000133880","amt" => 1]
]));
integeroptional

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
stringrequired
stringoptional

Supported token flag CITR_FIX.

stringoptional

The field is require when the token flag is CITR_FIX. The possible values are:

  • 1W – Weekly
  • 1M – Monthly
  • 2M – Every 2 months
stringrequired

Base64 encode of hash hmac sha512 encryption of concatenates values req_time, merchant_id, tran_id, amount, items, shipping, ctid, firstname, lastname, email, phone, type, payment_option, return_url, cancel_url, continue_success_url, return_deeplink, currency, custom_fields, return_params, payout, lifetime, additional_params, skip_success_page, token_flag and frequency with public_key.

PHP Sample Code

// public key provided by ABA Bank
$api_key = "API KEY PROVIDED BY ABA BANK";

// Prepare the data to be hashed
$b4hash = $req_time . $merchant_id . $tran_id . $amount . $items . $shipping . $ctid . $firstname . $lastname . $email . $phone . $type . $payment_option . $return_url . $cancel_url . $continue_success_url . $return_deeplink . $currency . $custom_fields . $return_params . $payout . $lifetime . $additional_params .$skip_success_page .$token_flag . $frequency;

// Generate the HMAC hash using SHA-512 and encode it in Base64
$hash = base64_encode(hash_hmac('sha512', $b4hash, $api_key, true));

Example

{
  "req_time": "",
  "merchant_id": "",
  "tran_id": "",
  "firstname": "",
  "lastname": "",
  "email": "",
  "phone": "",
  "type": "",
  "payment_option": "",
  "items": "",
  "shipping": "",
  "amount": "",
  "currency": "",
  "return_url": "",
  "cancel_url": "",
  "skip_success_page": "",
  "continue_success_url": "",
  "return_deeplink": "",
  "custom_fields": "",
  "return_params": "",
  "view_type": "",
  "payment_gate": "",
  "payout": "",
  "lifetime": "",
  "ctid": "",
  "token_flag": "",
  "frequency": "",
  "hash": ""
}
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R

Responses