9Pay Gateway Integration: Payment Solutions for Gaming & Digital Services
In a fiercely competitive payment market, 9Pay stands out as a "breath of fresh air" focusing on Digital Content and entertainment. If you are operating a gaming website, dating app, livestream platform, or prepaid card store, 9Pay is an integration partner you cannot overlook.
Licensed by the State Bank of Vietnam, 9Pay not only supports Collection but also excels in Disbursement and international payment gateways.
1. Key Strengths of 9Pay
- High conversion rate: Payment interface optimized for mobile user experience, especially for Gen Z.
- Ultra-fast disbursement: Enables businesses to pay salaries and commissions to affiliates/streamers 24/7 directly to bank accounts or e-wallets.
- International payments: Supports Visa/Mastercard with a high transaction approval rate.
2. 9Pay Merchant Registration Process
- Contact 9Pay Business.
- Sign the partnership agreement.
- Receive Staging (Test) environment integration credentials:
<li><code>Merchant Key</code>
- <code>Checksum Key</code>
- <code>Service ID</code>
</li>
3. Technical Integration Guide (9Pay API)
9Pay uses standard REST APIs and secures requests with SHA256 signatures.
Step 1: Create Payment Request
<code>$endpoint = "https://sandbox-api.9pay.vn/payments/create"; // Staging
$merchantKey = "KEY_DEMO";
$checksumKey = "SECRET_DEMO";
$time = time();
$invoice_no = "INV_" . $time;
$amount = 50000;
$description = "Game top-up";
$return_url = "https://yourwebsite.com/9pay/return";
$back_url = "https://yourwebsite.com/9pay/cancel";
$data = array(
'merchantKey' => $merchantKey,
'time' => $time,
'invoice_no' => $invoice_no,
'amount' => $amount,
'description' => $description,
'return_url' => $return_url,
'back_url' => $back_url,
'method' => 'ATM' // ATM, CREDIT, WALLET, QRpay
);
// Generate Signature
// Structure: SHA256(amount + back_url + description + invoice_no + merchantKey + method + return_url + time + checksumKey)
// Note: Parameters must be sorted a-z by key before concatenation
ksort($data);
$rawSign = "";
foreach ($data as $key => $value) {
if ($key !== 'checksum') {
$rawSign .= $value;
}
}
$rawSign .= $checksumKey;
$signature = hash('sha256', $rawSign);
$data['signature'] = $signature;
// Send POST Request (JSON Body)
$jsonData = json_encode($data);
// ... (Send via cURL) ...
// Receive response and get payment_url to redirect the customer.</code></pre>
Step 2: Handle Notify (IPN)
<p>9Pay calls your webhook to report the transaction result. You need to verify the signature before updating the DB.
<code>// File: 9pay_ipn.php
$data = $_POST; // Or json_decode depending on configuration
$receivedSign = $data['signature'];
// Logic to build signature for verification
// ... (Same as Step 1 but using received data) ...
if ($mySign === $receivedSign) {
if ($data['status'] == 'success') {
// Credit user balance
echo "success";
}
}</code></pre>
4. Common Pitfalls to Avoid
- Incorrect signing string order: 9Pay requires concatenating parameter values in a-z order of their keys. Wrong order -> Invalid signature.
- Double Spending: Always check whether <code>invoice_no</code> has already been processed before crediting the user, preventing duplicate credits if 9Pay sends multiple retry notifications.
5. JAYbranding Services
<p>JAYbranding doesn't just write code—we optimize your cash flow:
- ✅ Smart Switching Integration: Automatically hides 9Pay if the gateway is under maintenance and routes to another gateway so you never lose a customer.
- ✅ Recurring Support: Integrates recurring payments for Subscription packages.
📞 Optimize your Game & App revenue with 9Pay!
Contact: 0989 971 131
FAQ About 9Pay
[faqs]
#### Does 9Pay support prepaid card top-ups?
Yes. 9Pay is one of the few payment gateways that still provides strong support for telco card charging for digital content services.
#### What is 9Pay's settlement cycle?
Typically T+1 to T+3 depending on the service type and risk level.
[/faqs]