🎉 PhaJay is service now. Get Started

v1
Connect to Credit Card

PhaJay Credit Card Payment Gateway API

1. Overview

This document describes the integration process for PhaJay Payment Gateway API. The API provides a secure way to process online payments through our banking partners using a redirect-based flow that ensures PCI compliance by handling sensitive card data on secure payment pages.

1.1 Integration Workflow

The PhaJay payment integration follows a secure 11-step process:

  1. 1. Payer clicks pay button: Customer initiates payment on Platform
  2. 2. Platform sends payment request: Platform requests payment page link from PhaJay
  3. 3. PhaJay forwards request to Bank: Gateway processes and forwards to banking partner
  4. 4.Bank responds with payment page link: Bank returns secure payment URL
  5. 5. PhaJay forwards to Platform: Gateway returns payment link to Platform
  6. 6. Platform opens payment page to Payer: Customer is redirected to secure payment form
  7. 7. Payer completes payment: Customer enters card details and submits payment
  8. 8. Bank redirects to PhaJay success page: After processing, bank redirects to gateway
  9. 9. Bank notifies callback data via webhook: Bank sends payment result to Platform
  10. 10. PhaJay redirects to Platform success page: Customer sees Platform's success page
  11. 11. Platform receives webhook notification: Platform processes final payment confirmation
images

1.2 Configuration

Before integrating with PhaJay Payment Gateway, you must configure the following in our merchant portal: https://portal.phapay.com (opens in a new tab)

Step 1: Configure Callback URLs

  1. Login to your account in PhaJay web portal
  2. Click Settings > Callback URL
  3. Enter your callback URLs
  4. Click Save
images

Step 2: Configure Webhook URL

  1. Login to your account in PhaJay web portal
  2. Click Settings > Webhook
  3. Enter your webhook URL
  4. Click Save
images

2. Get Payment Page Link

API Endpoint
  • URL: https://payment-gateway.lailaolab.com/v1/api/jdb2c2p/payment/payment-link
  • Method: POST
  • Authentication: Basic Auth
Example:
application/json
{
  "Content-Type": "application/json",
  "Authorization": `Basic ${Buffer.from(`${key}`).toString("base64")}` 
}

Not :

- KEY refers to the secretKey you received after completing KYC on the web portal.

- This API only accepts 3D Secure (3DS) enabled cards.

Request Body

FieldTypeDescription
amountNumberAmount to be created for a transaction
descriptionStringA description of the transaction or purpose
tag1StringThe first custom field of customer system (optional)
tag2StringThe second custom field of customer system (optional)
tag3StringThe third custom field of customer system (optional)
Example:
application/json
{
  "amount": 1000,
  "description": "Buy a Product",
  "tag1": "AppZap Shop",
  "tag2": "666bbb461732a2e46233fdf9",
  "tag3": "ORDER-0001"
}

Response Body

FieldTypeDescription
messageStringStatus message of the transaction process
paymentUrlStringURL where the customer can secure the payment
expirationTimeDateTimeThe expiration time for the payment link in ISO 8601 format (UTC)
transactionIdStringUnique identifier for the transaction
statusStringCurrent status of the transaction (e.g., "WAITING" indicates pending)
Example:
application/json
{
  "message": "SUCCESSFULLY",
  "paymentUrl": "https://payment.paco.2c2p.com/payment/?pid=a49881babe524387b179e142506d89f0&lang=en-US",
  "expirationTime": "2025-08-04T07:29:33",
  "transactionId": "2e87da27-4f8a-46fd-bea8-5e76dfb1e00d",
  "status": "WAITING"
}

3. Redirect to Payment Link

In this step, users are redirected to a secure payment link page to complete the payment process.

Step 1: Payment Page Redirect

The user is redirected to the payment page to complete payment.

images

Not: This API only accepts 3D Secure (3DS) enabled cards

Step 2: Payment Confirmation

After clicking the "Continue" button, the transaction will be processed and a notification will be sent to the card owner's banking app for approval. Once approved, you will be redirected to a success page. After 5 seconds, it will automatically redirect to the PhaJay success page. PhaJay will then send the payment result to your platform via webhook.

images

Not: This API only accepts 3D Secure (3DS) enabled cards

Step 3: Payment Confirmation

After entering all required fields, clicking the "Continue" button redirects to the confirmation page.

images

Step 4: Final Redirect Users can click "Skip" to redirect to your platform's success page, or wait for automatic redirect when countdown reaches 0.


4. Webhook Notification

When the transaction is complete PhaJay will return callback data to the platform via webhook that is configured on platform account (1.2 ) This data is sent as part of the HTTPS request (usually a POST ) from the service to the designated webhook URL and Platform's webhook endpoint must respond with HTTPS 200 status code to acknowledge receipt.PI only accepts 3D Secure (3DS) enabled cards

Response Body

FieldTypeDescription
messageStringStatus message of the transaction process
transactionIdStringUnique identifier for the transaction
linkCodeStringCode used to reference or access the payment
paymentMethodStringMethod of payment used (CREDIT_CARD)
statusStringCurrent status of the payment
userIdStringID of the user with the transaction (PhaJay system ID)
descriptionStringDescription of the payment
tag1 to tag6StringAdditional transaction tags
successURLStringSuccess callback URL
txnAmountNumberThe transaction amount
currencyStringThe currency of the transaction amount (USD)
cardTypeStringType of credit card used (e.g., "CC-VI" for Visa)
creditCardDetailsObjectCard holder information details
transactionAmountObjectDetailed transaction amount information

Example:

application/json
{
  "message": "SUCCESS",
  "transactionId": "2e87da27-4f8a-46fd-bea8-5e76dfb1e00d",
  "linkCode": "2e87da27-4f8a-46fd-bea8-5e76dfb1e00d",
  "paymentMethod": "CREDIT_CARD",
  "status": "PAYMENT_COMPLETED",
  "userId": "686e113e59b2cbf66d72583d",
  "description": "CREDIT CARD PAYMENT: JAOL-Donation",
  "tag1": null,
  "tag2": null,
  "tag3": null,
  "tag4": null,
  "tag5": null,
  "tag6": null,
  "txnAmount": 1,
  "currency": "USD",
  "cardType": "CC-VI",
  "creditCardDetails": {
    "issuerCode": null,
    "cardHolderName": "KHAMSENG INTHAVONG",
    "cardNumber": "412639XXXXXX2372",
    "cardExpiry": "XXXX",
    "authenticationStatus": null,
    "eciValue": null,
    "xidValue": null,
    "cavvValue": null,
    "enrolledFlag": null
  },
  "transactionAmount": {
    "amountText": "000000000100",
    "currencyCode": "USD",
    "decimalPlaces": 2,
    "amount": 1
  }
}
Read More:

Explore the full Credit Card Payment documentation for detailed integration guidelines .

Click here to access:

Credit Card Payment Documentation (PDF)