Payment Subscription
To receive the payment information when there is the payment transaction, the platform must subscribe to the Payment Support, 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
Parameters | Type | Description |
---|---|---|
url | String | The 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> | String | Your SecretKey can be obtained from lailao payment Support portal (opens in a new tab). |
join::<PAYMENT_Support_SECRET> | String | Your SecretKey can be obtained from lailao payment Support portal (opens in a new tab). |
Code Example
Nodejs-socketio
const onSubscribePaymentSupport = (models) => {
try {
const _socketPaymentUrl = "https://payment-Support.lailaolab.com/?key=" + process.env.PAYMENT_Support_SECRET
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.PAYMENT_Support_SECRET, async (data) => {
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 })
}
}
Response
Field | Type | Description |
---|---|---|
message | String | The response message of API call. |
refNo | String | The reference number assigned to the transaction. |
exReferenceNo | String | An external reference number associated with the transaction. |
merchantName | String | The name of the merchant involved in the transaction. |
memo | String | A brief description of the transaction, e.g., 'PAYMENT'. |
txnDateTime | String | The date and time when the transaction was processed, in the format YYYY-MM-DD HH:MM:SS . |
txnAmount | Integer | The amount that was transacted. |
billNumber | String | A unique bill number associated with the transaction. |
sourceAccount | String | The account number from which the funds were sourced. |
sourceName | String | The name associated with the source account (may be empty). |
sourceCurrency | String | The currency of transaction. |
userId | Object | A unique identifier for the user who initiated the transaction. |
status | String | The current status of the transaction. |
transactionId | String | A unique identifier for the transaction, not repeat. |
The Response
application/json
{
"message": 'SUCCESS',
"refNo": '001LNMI811581649255',
"exReferenceNo": 'BONEN5JL999C3ZLN',
"merchantName": 'LAILAOLAB ICT SOLUTIONS CO.,LTD',
"memo": 'PAYMENT',
"txnDateTime": '2024-03-28 22:30:50',
"txnAmount": 100000,
"billNumber": 'VobAkGl0gVKrVecIbo2ogYrIk',
"sourceAccount": '1600120000000004810001',
"sourceName": '',
"sourceCurrency": 'LAK',
"userId": new ObjectId("656fd8886b411beab18eca79"),
"status": 'PAYMENT_COMPLETED',
"transactionId": 'VobAkGl0gVKrVecIbo2ogYrIk'
}
Read More:
Explore the full Payment QR documentation for detailed integration guidelines .
Click here to access:
Payment QR Documentation (PDF)