โ— 7By's own payment gateway

Payments, in-house.

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.

โšก

Hosted checkout

Card, UPI, NetBanking and PayPal on a polished payment page. Open it as a modal via the SDK or link to it directly.

๐Ÿ‡ฎ๐Ÿ‡ณ

Scan & pay UPI

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.

๐ŸŒ

International payments

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.

๐Ÿ”

Signed like Razorpay

HMAC-SHA256 signature over order_id|payment_id โ€” switching a site between gateways is a one-line change.

Integrate in three steps

Authenticate with HTTP Basic auth: key_id:key_secret (registered in config.php).

1

Create an order (server-side)

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", โ€ฆ }
2

Open checkout (client-side)

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>
3

Verify the signature (server-side)

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
}

Currencies & methods

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.

Webhooks

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.

Test mode

Merchants in test mode simulate the bank โ€” no real money moves.

InputResult
4111 1111 1111 1111Card success (any valid Luhn number works)
4000 0000 0000 0002Card declined
anything@upiUPI success
fail@upiUPI declined
QR / GPay / PhonePe / Paytm / BHIMSimulated UPI app payment โ€” success
PayPalSimulated โ€” instant success (any currency)