Live Pay-In Cashier URL Test Generator
SANDBOX • PRODUCTION
Test live payment cashier links by selecting trade code (EP for Easypaisa, JZ for Jazzcash, or UPI for Indian UPI). Generates real MD5 signature on the fly and retrieves checkout link from gateway.
Use your assigned credentials to authenticate requests against the MG Grow Pay gateway:
- Production Gateway URL: https://api.wpay.life
- Payment Collection (Deposit): https://api.wpay.life/v1/Collect
- Payment Transfer (Payout): https://api.wpay.life/v1/Payout
- Payout Query Inquiry: https://api.wpay.life/v1/Query/Payout
- Balance Inquiry: https://api.wpay.life/v1/balance
- Your Merchant ID (
mchId): YOUR_MCH_ID
- Secret API Key: YOUR_S••••••••••••••••••••••••_KEY
- Supported Currencies: INR (₹) and PKR (₨)
- Content-Type:
application/x-www-form-urlencoded (UTF-8 Encoding)
Every request submitted to the gateway or callback received must be cryptographically signed:
- 1. Filter out all parameters where the value is empty, null, or the
sign field itself.
- 2. Sort the parameter keys in ascending ASCII order (lexicographical order).
- 3. Join parameters into a query string:
key1=value1&key2=value2...
- 4. Append your merchant private key:
stringA + "&key=" + YOUR_PRIVATE_KEY
- 5. Compute the MD5 hash and convert the resulting string to lowercase.
function generate_mggrow_sign($params, $secret_key) {
unset($params['sign']);
ksort($params);
$signPairs = [];
foreach ($params as $k => $v) {
if ($v !== "" && $v !== null) {
$signPairs[] = $k . "=" . $v;
}
}
$signStr = implode("&", $signPairs) . "&key=" . $secret_key;
return strtolower(md5($signStr));
}
Use the exact string identifiers below for pay_type in collection and payout requests:
| Currency | Channel | Pay-In Trade Code | Payout Trade Code | Remarks |
| INR (₹) | Indian UPI (PhonePe, GPay, Paytm) | UPI | UPI | Instant dynamic QR / Intent |
| INR (₹) | Indian Direct Bank Transfer (IMPS/NEFT) | — | TRANSFER | Requires bankCode (IFSC Code) |
| PKR (₨) | Easypaisa Mobile Wallet | EP | EP | Direct wallet deposit & transfer |
| PKR (₨) | Jazzcash Mobile Wallet | JZ | JZ | Direct wallet deposit & transfer |
| PKR (₨) | 1Link Commercial Banks | — | BANK | Requires bankCode (HBL, Meezan, etc.) |
Initiates an Indian UPI or Pakistani Mobile Wallet deposit order and generates an instant payment routing link for the user.
| Parameter | Type | Required | Description |
mchId | String | Required | Your Merchant ID (e.g. YOUR_MCH_ID) |
currency | String | Required | INR or PKR |
out_trade_no | String | Required | Unique serial order number on your platform |
money | Integer | Required | Deposit amount (Integer only, no decimals) |
pay_type | String | Required | UPI for India, EP for Easypaisa, JZ for Jazzcash |
attach | String | Optional | Custom tracking metadata |
notify_url | String | Required | Webhook URL to receive payment status callback |
returnUrl | String | Optional | Return URL where user lands after checkout |
sign | String | Required | Calculated MD5 signature hash |
<?php
// Prepare Deposit Parameters (INR or PKR)
$params = [
'mchId' => 'YOUR_MCH_ID',
'currency' => 'INR', // 'INR' or 'PKR'
'out_trade_no' => 'ORD' . date("YmdHis") . rand(100, 999),
'pay_type' => 'UPI', // 'UPI' (India) or 'EP' / 'JZ' (Pakistan)
'money' => 500,
'attach' => 'WebDeposit',
'notify_url' => 'https://yourwebsite.com/callback_payin.php',
'returnUrl' => 'https://yourwebsite.com/home.php',
];
// Generate MD5 Sign
$params['sign'] = generate_mggrow_sign($params, 'YOUR_SECRET_KEY');
// Send POST to Gateway
$ch = curl_init('https://api.wpay.life/v1/Collect');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/x-www-form-urlencoded']);
$response = curl_exec($ch);
curl_close($ch);
$resData = json_decode($response, true);
if (isset($resData['code']) && $resData['code'] == 0) {
// Redirect user to payment cashier page
$cashier_url = $resData['data']['url'] ?? $resData['data']['pay_url'];
header("Location: " . $cashier_url);
exit;
} else {
echo "Gateway Error: " . ($resData['msg'] ?? 'Initialization failed');
}
?>
Successful Gateway JSON Response:
{
"code": 0,
"msg": "success",
"data": {
"out_trade_no": "ORD20261004001",
"pay_url": "https://gateway.mggrow.sbs/checkout/pay?id=8f293b..."
}
}
When payment is completed by user, the gateway sends a POST request to your notify_url:
| Field | Type | Description |
mchId | String | Your Merchant ID |
out_trade_no | String | Merchant order number |
currency | String | INR or PKR |
money | Number | Original order amount |
pay_money | Number | User's actual paid amount in cash |
status | Integer | 1 = Payment Successful, 2 = Failed |
sign | String | MD5 signature for callback verification |
<?php
// callback_payin.php
$post_data = $_POST;
$secret_key = "YOUR_SECRET_KEY";
// Verify Signature
$incoming_sign = $post_data['sign'] ?? '';
unset($post_data['sign']);
ksort($post_data);
$signPairs = [];
foreach ($post_data as $k => $v) {
if ($v !== "" && $v !== null) {
$signPairs[] = $k . "=" . $v;
}
}
$calculated_sign = strtolower(md5(implode("&", $signPairs) . "&key=" . $secret_key));
if (strcasecmp($incoming_sign, $calculated_sign) === 0) {
if (($post_data['status'] ?? '') == '1') {
// Payment Succeeded! Credit user account
$order_id = $post_data['out_trade_no'];
$amount = $post_data['pay_money'];
}
// Strictly output string 'success' in plain text
echo "success";
exit;
} else {
echo "sign error";
exit;
}
?>
Disburses instant payouts directly to Indian Bank Accounts (IMPS) / UPI VPAs or Pakistani Wallets (Easypaisa, Jazzcash) and 1Link Banks.
| Parameter | Type | Required | Description |
mchId | String | Required | Merchant ID |
currency | String | Required | INR or PKR |
out_trade_no | String | Required | Unique payout ID generated by merchant (e.g. WD2026100409) |
pay_type | String | Required | UPI, TRANSFER (India) | EP, JZ, BANK (Pakistan) |
money | Integer | Required | Transfer amount (Min: 100) |
userName | String | Required | Beneficiary Account Holder Name |
account | String | Required | Beneficiary Account Number, UPI VPA, or Mobile Wallet Number |
bankCode | String | Optional | IFSC Code for India, Bank Name for 1Link Pakistan, or UPI/EP/JZ |
notify_url | String | Required | Callback webhook URL for payout confirmation |
uid | String | Optional | User unique identifier |
sign | String | Required | Calculated MD5 Signature |
# Sample 1: Pakistan Easypaisa (PKR)
curl --location 'https://api.wpay.life/v1/Payout' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'mchId=YOUR_MCH_ID' \
--data-urlencode 'currency=PKR' \
--data-urlencode 'out_trade_no=WD20261004001' \
--data-urlencode 'pay_type=EP' \
--data-urlencode 'money=1000' \
--data-urlencode 'userName=Recipient Name' \
--data-urlencode 'account=03001234567' \
--data-urlencode 'notify_url=https://yourwebsite.com/callback_payout.php' \
--data-urlencode 'sign=calculated_md5_signature'
# Sample 2: India Bank Transfer (INR)
curl --location 'https://api.wpay.life/v1/Payout' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'mchId=YOUR_MCH_ID' \
--data-urlencode 'currency=INR' \
--data-urlencode 'out_trade_no=WD20261004002' \
--data-urlencode 'pay_type=TRANSFER' \
--data-urlencode 'money=1500' \
--data-urlencode 'userName=Rahul Sharma' \
--data-urlencode 'account=0235456782' \
--data-urlencode 'bankCode=HDFC0001234' \
--data-urlencode 'notify_url=https://yourwebsite.com/callback_payout.php' \
--data-urlencode 'sign=calculated_md5_signature'
Successful Response:
{
"code": 0,
"msg": "success",
"data": {
"transaction_Id": "999cee57ddcf438595a7ab4fd2e5063e"
}
}
When disbursement is processed by bank or wallet nodes, the result is posted to your notify_url:
mchId=YOUR_MCH_ID&out_trade_no=WD20261004001¤cy=INR&money=1000&real_money=1000.00&status=1&sign=callback_signature_hash
* Crucial: Your webhook receiver MUST output strictly: success in plain text.
Query real-time transfer settlement status using your merchant order number (out_trade_no):
curl --location 'https://api.wpay.life/v1/Query/Payout' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'mchId=YOUR_MCH_ID' \
--data-urlencode 'out_trade_no=WD20261004001' \
--data-urlencode 'sign=calculated_signature'
Inquiry Response (JSON):
{
"code": 0,
"msg": "success",
"data": {
"transaction_Id": "aca1ce79d1f64d29ac9d7f3b964d88fb",
"mchId": "YOUR_MCH_ID",
"out_trade_no": "WD20261004001",
"status": 1,
"money": 1000,
"real_money": 1000.00,
"currency": "INR"
}
}
Check your live INR or PKR balance available for instant settlements:
curl --location 'https://api.wpay.life/v1/balance' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'mchId=YOUR_MCH_ID' \
--data-urlencode 'currency=INR' \
--data-urlencode 'sign=calculated_signature'
{
"code": 0,
"msg": "success",
"data": {
"balance": 50000.00,
"currency": "INR"
}
}
All gateway API responses return a status code inside the code field:
| Code | Status | Description |
0 | Success | Operation processed / submitted successfully |
1 | Fail | General operation failure |
2 | mchId error | Merchant ID does not exist or incorrect |
3 | Account error | Account does not exist |
4 | Status error | Account status abnormal or locked |
5 | Signature error | Signature MD5 verification failed |
6 | Duplicate | Order number already exists in system |
7 | Not found | Order does not exist |
8 | Permission | Insufficient permissions for this endpoint |
9 | Balance | Insufficient balance in merchant vault |
10 | Amount error | Incorrect amount or violates min/max limits |
11 | Maintenance | Payment channel under scheduled maintenance |
12 | Currency error | Currency does not exist |
13 | Channel error | Channel code does not exist |
15 | Channel failure | Upstream bank / wallet channel temporary failure |
16 | IP Not Whitelisted | Server IP incorrect. Contact support to whitelist server IP |
17 | Bank error | Bank code / IFSC does not exist |
Indian Channels (INR ₹): Instant settlements supported across all UPI apps and major Indian commercial banks:
PhonePe UPI (UPI)
Google Pay (GPay)
Paytm Wallet & UPI
BHIM UPI (NPCI)
State Bank of India (SBI)
HDFC Bank Limited
ICICI Bank Limited
Axis Bank Limited
Punjab National Bank (PNB)
Kotak Mahindra Bank
Bank of Baroda (BOB)
Canara Bank
Pakistani Channels (PKR ₨): Real-time deposits and payouts supported across mobile wallets and 1Link banks:
Easypaisa Mobile Wallet (EP)
JazzCash Mobile Wallet (JZ)
Habib Bank Limited (HBL)
Meezan Bank Limited
United Bank Limited (UBL)
MCB Bank Limited
Bank Alfalah Limited
Allied Bank Limited (ABL)
Faysal Bank Limited
Askari Bank Limited
The Bank of Punjab (BOP)
Standard Chartered Pakistan