1. Connect subscription Payment
1.1 Generate QR
To generate a QR code for the subscription payment, you can use the following code snippet: To make a payment through the Bank Platform, it is necessary to create a QR String for connecting the bank to use the Mobile Bank app to scan and make the connection.
URL: payment-gateway.lailaolab.com/v1/api/subscription/generate-bcel-qrMethod: POST
HAEDER: secretKey: PLATFORM_SECRET_KEY
Field | Type | Description |
---|---|---|
maxAmount | Number | Number Max amount to be created for a transaction |
subscriptionDate | Date | The subscription date "YYYY-MM-DD" |
resubscriptionDays | Number | Number of days for resubscription (ex:30 for 30 days or amonth) |
description | String | A description of the transaction or purpose |
const handleSubmit = async (e) => {
e.preventDefault();
setIsLoading(true);
const payloadData = {
maxAmount: 1000,
subscriptionDate: '2025-02-12', // recommend to use the currently date
resubscriptionDays: 30, // 30 days ,60 days,90 days,
description: "This is test subscription",
}
Const config = {
headers: {
secretKey: SECRET_KEY, // Platform secret key
},
}
try {
const response = await axios.post(`${URL}`, payloadData, config);
if (response.status === 200) {
setIsLoading(false);
console.log("Response", response?.data);
setQrCode(response.data?.qrCode);
}
} catch (error) {
console.error("Error", error);
setIsLoading(false);
}
}
Field | Type | Description |
---|---|---|
message | String | Message to tell that generate QR successfully |
transactionID | String | Unique identifier for the transaction |
qrCode | String | The QR string of the transaction |
link | String | Deep link to access to each bank's app |
application/json
{
"message": "SUCCESSFULLY",
"transactionId": "c1a286f3-c5f8-48fc-94a0-6ebb7a5489e8",
"qrCode":
"https://api.qrserver.com/v1/create-qr-code/?size=200x200&ecc=H&data=00020101021233
980004BCEL0118ONEPAYSUBSCRIPTION0216mch679ae2c0a187d0320SBDMQTGMVMSRUVQUZOLY0406RUL
E-5051083030620155204729953034185802LA624602102030-06-01050410000820TAITTJVQEKRJZZJ
UFMIR6304DABB","link":"onepay://qr/00020101021233980004BCEL0118ONEPAYSUBSCRIPTION0216mch679ae2c0a187d0320
SBDMQTGMVMSRUVQUZOLY0406RULE-5051083030620155204729953034185802LA624602102030-06-01
050410000820TAITTJVQEKRJZZJUFMIR6304DABB"
}
Read More:
Explore the full Subscription Payment for detailed integration guidelines .
Click here to access:
Subscription Payment Documentation (PDF)