7Pay powers checkout across every 7By tool โ hosted checkout page, a drop-in JS SDK, signed webhooks and a merchant dashboard. No third-party gateway fees.
Card, UPI, NetBanking and PayPal on a polished payment page. Open it as a modal via the SDK or link to it directly.
Scan-to-pay QR code plus one-tap Google Pay, PhonePe, Paytm and BHIM buttons. Live payments go straight to your VPA โ zero gateway commission.
USD, EUR and GBP orders out of the box. Overseas buyers pay by card (test) or PayPal; live PayPal payments are verified by Transaction ID.
HMAC-SHA256 signature over order_id|payment_id โ switching a site between gateways is a one-line change.
Authenticate with HTTP Basic auth: key_id:key_secret (registered in config.php).
Amounts are in minor units (paise / cents).
curl -u 7pay_yourkey:yoursecret \
-H "Content-Type: application/json" \
-d '{"amount": 4900, "currency": "INR", "receipt": "u42-1720", "notes": {"plan": "monthly"}}' \
"https://pay.7by.in/api.php?action=order.create"
# โ { "ok": true, "id": "order_โฆ", "amount": 4900, "status": "created", โฆ }
Drop in checkout.js โ same shape as Razorpay's SDK.
<script src="https://pay.7by.in/checkout.js"></script>
<script>
var sp = new SevenPay({
key: '7pay_yourkey',
order_id: 'order_xxx',
description: 'Monthly โ 1000 credits',
prefill: { email: 'user@mail.com' },
handler: function (resp) {
// send resp.sevenpay_order_id, resp.sevenpay_payment_id,
// resp.sevenpay_signature to your server to verify
},
});
sp.on('payment.failed', function (e) { console.log(e); });
sp.open();
</script>
Never trust the browser โ recompute the HMAC with your key secret.
$expected = hash_hmac('sha256', $order_id . '|' . $payment_id, $key_secret);
if (hash_equals($expected, $signature)) {
// paid โ deliver the goods
}
order.create accepts INR, USD, EUR, GBP and AED. Use gw_geo_currency() (see demo.php) to price by the visitor's country โ India sees โน, the US sees $, the UAE sees AED, and so on; nobody is shown a foreign currency. UPI (QR scanner + Google Pay / PhonePe / Paytm / BHIM) is shown for INR orders; PayPal covers international currencies. In live mode, UPI settles to your VPA (buyer submits the UTR) and PayPal settles to your PayPal.me (buyer submits the Transaction ID) โ both are approved in the dashboard, which fires the payment.captured webhook.
Set a webhook_url per merchant and 7Pay POSTs signed events โ payment.captured, payment.pending, payment.refunded. Verify the X-7Pay-Signature header: HMAC-SHA256 of the raw body with your webhook_secret.
Merchants in test mode simulate the bank โ no real money moves.
| Input | Result |
|---|---|
| 4111 1111 1111 1111 | Card success (any valid Luhn number works) |
| 4000 0000 0000 0002 | Card declined |
| anything@upi | UPI success |
| fail@upi | UPI declined |
| QR / GPay / PhonePe / Paytm / BHIM | Simulated UPI app payment โ success |
| PayPal | Simulated โ instant success (any currency) |