🎉 PhaJay is service now. Get Started

v1
Connect to Payment QR
Payment Callback

Payment Callback

PhaJay provides two methods for receiving payment callback data after a transaction is completed successfully.

1. Subscribe (Realtime via SocketIO)

To receive the payment information when there is the payment transaction, the platform must subscribe to the Payment, which must be connected in the SocketIO format according to the link and must subscribe to the event as below:

  • url for check the subscription
https://payment-Support.lailaolab.com/?key=<PAYMENT_Support_SECRET>

Request

ParametersTypeDescription
urlStringThe link used to track transactions by viewing the details each time. Must have a key with the same value as your SecretKey URL.
<PAYMENT_Support_SECRET>StringYour SecretKey can be obtained from PhaJay Payemnt Support portal (opens in a new tab).
join::<PAYMENT_Support_SECRET>StringYour SecretKey can be obtained from PhaJay Payemnt Support portal (opens in a new tab).

Code Example

Nodejs-socketio
const onSubscribePaymentSupport = (models) => {
    try {
        const _socketPaymentUrl = "https://payment-gateway.lailaolab.com"
        const socket = io(_socketPaymentUrl);
 
        if (socket.connected) {
        console.log('Socket is already connected.');
        return; // No need to connect again
        }
        // Connect to the server
        socket.on('connect', () => {
        console.log('Connected to the payment Support server!');
        // Subscribe to a custom event
        socket.on('join::' + process.env.SECRET_KEY, async (data) => {     // SECRET_KEY  taken from to PhaJay Portal 
            console.log('Data received:', data);
        });
        });
        // Handle the connection error (optional)
        socket.on('connect_error', (error) => {
        console.error('Connection failed:', error);
        });
        return;
    } catch (error) {
        console.log({ error })
    }
}

2. Webhook Callback (New Method)

To receive payment information automatically when a transaction is completed, you need to set your Webhook URL in the PhaJay portal by going to Settings > Webhook (see image below).

images

The payment server will send a callback response to your configured URL with the transaction details.

  • Endpoint URL: The URL where payment notifications will be sent, e.g. https://yourdomain.com/payment.
  • Description: A note or label for your webhook (optional, for your own reference).

When a payment is completed successfully, the system will Response the transaction payload to your webhook endpoint in JSON format.

Response Data

FieldTypeDescription
messageStringThe response message of API call.
refNoStringThe reference number assigned to the transaction.
exReferenceNoStringAn external reference number associated with the transaction.
merchantNameStringThe name of the merchant involved in the transaction.
descriptionStringDescription about the transaction (custom text provided by merchant).
paymentMethodStringThe payment method used for the transaction (e.g., BCEL, OnePay).
txnDateTimeStringThe date and time when the transaction was processed. Format: DD/MM/YYYY HH:mm:ss.
txnAmountIntegerThe amount that was transacted.
billNumberStringA unique bill number associated with the transaction.
sourceAccountStringThe account number from which the funds were sourced.
sourceNameStringThe name associated with the source account.
sourceCurrencyStringThe currency of the transaction.
userIdStringA unique identifier for the user who initiated the transaction.
statusStringThe current status of the transaction (e.g., PAYMENT_COMPLETED).
transactionIdStringA unique identifier for the transaction, not repeatable.
tag1–tag6StringOptional custom fields for additional tagging (empty if not used).

Response Data Example

application/json
{
    "billNumber": "81f8b0a6-9277-45e5-a6d2-8c1bd248bedf",
     "description": "short is good",
     "exReferenceNo": "YQ75K0RG6AXG",
     "merchantName": "Lailao Payment",
     "message": "SUCCESS",
     "paymentMethod": "BCEL",
     "refNo": 580960503,
     "sourceAccount": "202509232428318",
     "sourceCurrency": "LAK",
     "sourceName": "ເຢີກື ເຊ່ຍເຊີ",
     "status": "PAYMENT_COMPLETED",
     "tag1": "",
     "tag2": "",
     "tag3": "",
     "tag4": "",
     "tag5": "",
     "tag6": "",
     "transactionId": "81f8b0a6-9277-45e5-a6d2-8c1bd248bedf",
     "txnAmount": 1,
     "txnDateTime": "23/09/2025 11:37:55",
     "userId": "683ae8e8912ff3f68e2faa78"
}

⚠️ Note:
Each bank may return different response fields.
However, the following system-standard fields are always guaranteed:

  • paymentMethod → The bank/payment method used (e.g., BCEL, JDB,LDB).
  • transactionId → Unique transaction identifier generated by the system.
  • txnAmount → The paid amount.

All other fields may vary by bank and should be handled accordingly.