Unschedule Payment
Introduction
An unscheduled payment is a payment that happens anytime, not on a fixed schedule. It can be started either by the customer or the merchant. When the customer initiates the transaction (CIT / CITU – Customer Initiated Transaction), it means the customer actively makes the payment themselves (for example, during checkout, booking a taxi, or ordering food from a delivery service). When the merchant initiates the transaction (MIT / MITU – Merchant Initiated Transaction), it means the business triggers the payment (for example, charging for an extra service or an additional fee). In both cases, the payment is not automatic or recurring—it only happens when it is triggered.
Understanding Token
Token Flags
To classify the type of the transaction, PayWay uses the token_flag parameter to define the Transaction Context. This tells our system who is triggering the payment and whether the billing amount is fixed or variable.
Customer-Initiated Transactions (CIT)
The customer triggers each payment from your app or website.
| Flag | Full name | Amount | Use case | API Endpoint |
|---|---|---|---|---|
CITI_FLEX | CIT Initial | Variable | Customer saves their method for future purchases with varying amounts. | Link Account, Link Card |
CITU_FLEX | CIT Unscheduled | Variable | Customer makes a one-time payment using a previously saved method. | Payment |
Merchant-Initiated Transactions (MIT)
Your server charges the customer without their direct interaction at the time of payment.
| Flag | Full name | Amount | Use case | API Endpoint |
|---|---|---|---|---|
CITO_FLEX | CIT Other | Variable | Customer authorizes the merchant to charge variable amounts later (e.g. toll setup). | Link Account, Link Card |
MITU_FLEX | MIT Unscheduled | Variable | Merchant charges on-demand with no fixed schedule (e.g. auto-recharge for a toll card). | Payment |
Token lifecycle
How it works
Link Account
- Initiation: The customer selects "Link ABA Account" on your platform.
- Request: Your server sends a request to PayWay to initiate the account linking process.
- Response: PayWay returns a QR string or an ABA Mobile deep link.
- Display:
- Web: Convert the QR string into a QR code image for the user to scan.
- Mobile: Use the deep link to automatically launch the ABA Mobile app.
- Authorization: Once redirected or after scanning, the user selects their preferred ABA account and authorizes the link within the app.
- Tokenization: PayWay generates a secure payment token and sends it to your server via the callback_url.
- Storage: Store this token securely to enable seamless, one-click purchases in the future.
Subsequent Transaction
- Selection: The customer chooses the "Linked ABA Account/Card" as their payment method during checkout.
- One-Click Initiation: The customer clicks "Place Order" or "Pay Now" to trigger the transaction.
- Payment Request: Your server sends a Payment API request to PayWay using the previously stored Token.
- Processing: PayWay securely processes the transaction without requiring the user to open the ABA Mobile app or scan a QR code or entering card details.
- Status Update: PayWay returns the real-time Payment Status (Success/Fail) to your server.
- Notification: PayWay sends a detailed transaction confirmation to your registered
callback_url. - Completion: You display the final Order Confirmation to the customer on your platform.
Set up your UI
Before integrating the API, build a payment methods section in your app where customers can:
- Add - Link an ABA account or credit/debit card
- View - See all their saved payment methods
- Remove - Unlink a payment method when needed
- Renew - Allow customer to renew the expired token.
- Set default token - Allow customer to set a default token (in case user has multiple tokens) that will be used for checkout.
You must follow PayWay Credential on file guidelines to ensure proper customer card/account storage.
Integration Steps
To allow your customers to link their ABA account on your platform, use the Link Account API. Below is a sample of a successful API response:
Display a QR code using qr_string for customers to scan with ABA Mobile and authorise the account linking.
Callback handling
When a user successfully links their ABA Account or Card, PayWay issues an asynchronous notification to your server via the callback_url. This allows your system to capture the linking status and store the necessary tokens for future transactions.
PayWay prioritizes the callback_url passed dynamically as a request parameter; however, if this parameter is absent, the system defaults to the callback_url configured within your Outlet Profile > Services > Credential on File.
Connection Requirements
To ensure a successful handshake between PayWay and your server, your endpoint must adhere to the following specifications:
- HTTP Method: Must accept POST requests.
- Content Type: application/json.
- Network Security: Your domain and origin IP addresses must be whitelisted by ABA Bank.
Sample Callback Data
Your original requst ID.
Your consumer identification number.
PWT (PayWay Token) is a unique token automatically generated by the PayWay system and is used to complete the purchase..
This field displays either the card number or the ABA account number, depending on the payer's selected payment method. For security reasons, the number is masked and only the last 4 digits are shown.
Visa- Visa cardMC- MastercardCUP- UnionPay cardJCB- JCB cardABA ACCOUNT- ABA Account
0- Token has been removed.1- Token is active.2- Token has been frozen.
Expiry date of the token.
Possible values: CITI_FLEX, CITO_FLEX.
Always return empty string for token flag is CITI_FLEX or CITO_FLEX.
Always return 0 for token flag CITI_FLEX or CITO_FLEX.
Token payment amount limit per transaction.
Payment amount limit transaction currency. Possible value KHR or USD.
If you encounter issues with the pushback notification and do not receive the details, you can manually retrieve the linked account information using the Get token details API.
ABA Mobile users have the autonomy to freeze, unfreeze, renew, or remove a linked token directly within their app. Through the Credentials on File configuration, merchants can opt-in to receive real-time callback notifications whenever a user initiates these actions. Once enabled, PayWay will trigger a callback to the merchant for every status change, utilizing the same standardized data format previously specified to ensure consistent integration.
To perform purchase using the token, please follow the specification of Payment API.
Once the customer completes the payment, PayWay will send the transaction details and other important information to the callback_url.
- If
callback_urlis not provided in the request, PayWay will use the defaultcallback_urlconfigured in the API Settings. - If you provide a custom
callback_url, make sure the domain is whitelisted in your merchant profile.
Your callback_url endpoint must:
- Accept the HTTP POST method
- Accept Content-Type: application/json
We highly recommend securing this URL to ensure that only PayWay has access to it.
Sample Pushback Data
Transaction ID sent during the initial payment process.
Transaction approval code.
Payment status
Verify Callback Signature
For security purposes, PayWay includes a hash signature in the request header.
You should verify this signature to confirm that the callback was sent by PayWay and that the data has not been modified.
Below is an example in PHP demonstrating how to:
- Read the callback data
- Generate the signature
- Compare it with the signature received in the header
PHP Example
You should receive a real-time callback response within 3 seconds. If you do not receive a response, we recommend using the Check transaction API to verify the payment status.