🎉 PhaJay is service now. Get Started

v1
Sandbox
Payment Link Sandbox

Payment Link Sandbox

1. Introduction

The Payment Link Sandbox is a testing environment designed to allow developers to simulate payment link transactions without processing real money. This system enables testing of payment link creation, simulated payment flow, and real-time transaction status tracking to ensure that the integration functions correctly before going live.

1.1 What is the Payment Link Sandbox?

The Payment Link Sandbox is a payment using the Payment Link Sandbox through the Bank Platform, it is necessary to generate a link that redirects the user to their bank's Mobile Banking App to complete the payment. Currently, the system supports connections with four major banks in Laos, including:

Short NameBank Name
BCELBanque pour le Commerce Extérieur Lao
JDBJoint Development Bank
LDBLao Development Bank
IBIndochina Bank

The process to connect and retrieve a Payment Link sandbox is follow :

ParameterValue
URLhttps://payment-gateway.lailaolab.com/v1/api/test/payment/ge-payment-link (opens in a new tab)
MethodPOST
AuthenticationBasic Auth
Example:
nodejs
export async function POST(request) {
try {
  const { amount, description } = await request.json();
  const key =
    process.env.SECRET_KEY ||
    "Secret Key";
 
  const data = JSON.stringify({
    amount: amount || 1,
    description: description || "Example Description",
  });
 
  const config = {
    method: "post",
    maxBodyLength: Infinity,
    url: "https://payment-gateway.lailaolab.com/v1/api/test/payment/get-payment-link",
    headers: {
      Authorization: `Basic ${Buffer.from(key).toString("base64")}`,
      "Content-Type": "application/json",
    },
    data: data,
  };
 
  const response = await axios.request(config);
  console.log("data", response.data);
 
  // console.log("res" , response);
  return NextResponse.json(response.data);
} catch (error) {
  console.error("Payment generation error:", error);
  return NextResponse.json(
    { message: "Payment generation failed", error: error.message },
    { status: 500 }
  );
}
}
 

Not :refers to your Secret Key, which is used to authorize API requests. You can find your Secret Key on the Home page of the PhaJay Portal after logging in.

1.2 Request Body

When creating a Payment Link Sandbox , send a POST request with the following JSON payload:

FieldTypeDescription
amountNumberThe amount of transaction
descriptionStringA description of the transaction or purpose
tag1stringThe first custom field of platform (option)
tag2stringThe second custom field of platform (option)

tag1, tag2 can be used to pass custom metadata such as order ID, user ID, or tracking references. These values will be returned in webhook callbacks, making it easier to match transactions with your internal system.

Example:
application/json
{
  "amount": 50000,
  "description":"Sandbox test", 
  "tag1": "AppZap Shop",
  "tag2": "666bbb461732a2e46233fdf9",
  }

1.3 Response Data

FieldTypeDescription
messageStringA string indicating the outcome of the API call
redirectURLStringPayment link page URL using for the payment process
Example:
application/json
  {
     "message": "SUCCESS",
     "redirectURL" :"https://payment-link-sandbox.netlify.app?amount=5000&linkCode=4MNBOBGS2MZB"
  }

1.4 Redirect to Payment Link SandBox

In this step, the user will be redirected to a secure payment link sandbox page to select bank and complete the payment process

Set1 : It redirects to payment link sandbox for bank selection

payment-link

Set2 : When the user selects their bank, they will be automatically redirected to the QR code page for payment in this page user can open PhayJay App to Scan QR for payment

Not :PhayJap App is a testing application developed by PhaJay to help you simulate transactions without using real money. You can use this app to scan QR codes generated in the sandbox environment for testing purposes.

The app is available for download on your mobile device via the following link:

Download PhayJap App

Set3 : After scanning and completing the payment, the system will display a message for 5 seconds Then, it will automatically redirect the user to their success callback URL

payment-link

2. Webhook Callback Data

When the transaction is complete it will return callback data to the user's webhook This data is sent as part of the HTTPS request (usually a POST) from the service to your designated webhook URL.

Response Data
FieldTypeDescription
messageStringStatus message of the response
_idStringA string containing the QR code data
linkCodeStringUnique identifier for the payment document.
amountnumberThe account number initiating the transaction
currencyStringCurrency code (e.g., LAK)
descriptioneStringA description of the transaction or purpose
statusStringPayment status(e.g.,PAYMENT_COMPLETED)
userStringID of the user in the PhaJay system
tag1 to tag6StringAn optional custom tag field for internal use
isMerchantIdPaymentBooleanIndicates if the payment was made via merchant ID
isAffiliatePaymentBooleanIndicates if the payment was made via an affiliate
createdAtString (ISO Date)Date and time when the payment was created
updateAtString (ISO Date)Date and time when the payment was updateAt
originStringThe method of payment (e.g., BCEL, JDB, LDB, IB)
transactionIdStringUnique transaction identifier
qrCodeStringQR code data string for scanning and paying
closedByStringIndicates who closed the transaction (e.g., CUSTOMER)
paymentDataStringDetailed metadata about the payment in stringified JSON
paymentTimeString (ISO Date)Actual time of payment transaction
Read More:

Explore the full Payment Link Sandbox documentation for detailed integration guidelines .

Click here to access:

Payment Link Sandbox Documentation (PDF)