🎉 Lailaolab Payment Support is service now. Get Start

v1
Use With SocketIO

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

url
string

The link used to track transactions by viewing the details each time must have a key with the same value as your ScretKey url

<PAYMENT_Support_SECRET>
string

Your ScretKey can be obtained from lailao payment Support portal (opens in a new tab)

EVENTS

join::<PAYMENT_Support_SECRET>
string

Your ScretKey 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

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'
}