পেমেন্ট গেটওয়ে
গেটওয়ে চালু করা, Stripe / PayPal / bKash / Nagad / SSLCommerz / Razorpay / Paystack / ব্যাংক ট্রান্সফারের কী, কলব্যাক URL, কারেন্সি, ক্রেতা কী দেখে, নিরাপত্তার নিয়ম আর পেমেন্ট না এলে কী করবেন।
A payment gateway in AIODomain is a plugin (Settings -> Plugins, or Finance -> Payment Gateways). 1.4.0 ships eight: Stripe, PayPal, bKash, Nagad, SSLCommerz, Razorpay, Paystack and bank transfer. Each is switched on by you, needs the provider's keys, and records a payment only when the provider confirms it to the server (a signed webhook, or a server-to-server check). No gateway ever simulates a payment; with no keys a gateway shows "not ready" and does not appear on the checkout.
1. Switching a gateway on
- Finance -> Payment Gateways. Switch the gateway on, then open Settings.
- Fill in the provider's keys (below) and the common fields: the display name buyers see, instructions shown under the pay button, a surcharge (percent and / or fixed) added to orders paid this way, test mode (the provider's sandbox), and a minimum / maximum order amount for this method.
- Copy the callback URL shown on the gateways page (
https://your-site/callback/<gateway>) into the provider's dashboard as the webhook / IPN address, where the provider has one. - Set the order of the methods on the checkout (drag or number them) and make a test purchase with a small test listing in test mode.
Currencies: the order total is US dollars. A gateway charges in the currency it supports (bKash, Nagad and SSLCommerz in BDT; Razorpay in INR; Paystack in NGN, GHS, ZAR or USD; Stripe and PayPal in the buyer's display currency when they take it), converted at the marketplace's current rate. The payment row stores the USD value and the amount actually charged.
2. The providers
| Gateway | Kind | Keys | Webhook | Refund by API |
|---|---|---|---|---|
| Bank transfer | offline | bank name, account holder, account number, IBAN, SWIFT / BIC, routing / sort code, branch, account currency, more text for buyers, whether the "I have sent the payment" form is shown | none; the buyer reports, staff confirm | no (record by hand) |
| Stripe | redirect (Stripe Checkout) | secret key, webhook signing secret | yes, checkout.session.completed and payment events, signature checked | yes |
| PayPal | redirect (Orders v2) | client id, secret, webhook id | yes, verified against PayPal; the return also captures the order server-side | yes |
| bKash | redirect (tokenised checkout) | app key, app secret, username, password | the return is executed and verified server-side | yes |
| Nagad | redirect | merchant id, merchant private key, Nagad public key | the return is verified with Nagad's signature and a status call | no (record by hand) |
| SSLCommerz | redirect (session) | store id, store password | IPN plus a validation call | yes |
| Razorpay | redirect (hosted checkout) | key id, key secret, webhook secret | yes, signature checked | yes |
| Paystack | redirect | secret key, public key | yes, signature checked, plus a verify call | yes |
Sandbox / test mode uses each provider's test endpoint and test keys. Live keys never go into test mode.
3. What a buyer sees
On the order page the buyer picks a method; the order total is recalculated with that method's surcharge and the method's own pay button appears. A redirect gateway sends the buyer to the provider and back to the order page; the order shows "Payment received" once the server-side confirmation arrived (usually within seconds; if the buyer closes the browser early the webhook still completes it). The bank transfer gateway shows your account details and the order number as the reference; the buyer sends the money and fills in I have sent the payment; the order shows the reported payment until a staff member confirms it on the order or payments page.
4. Safety rules built in
- A payment is recorded once: the same provider transaction id is ignored the second time, so a repeated webhook cannot pay an order twice.
- An amount below the order total is not accepted: it is kept as "underpaid" for staff, who confirm it as payment in full or reject it.
- A callback with a wrong signature, or one the provider does not confirm, is refused and logged.
- Every call to and from a gateway lands in the gateway log (Finance -> Payments & Transactions -> Gateway log) with secrets masked.
- Keys are stored encrypted in the database. Never put keys in files or in the manual.
- An order that already expired still takes a late payment when the domain is free; otherwise the payment is kept for staff to refund.
5. When a payment does not arrive
- Finance -> Payments & Transactions -> Gateway log: find the order or the provider's reference. A "refused" line names the reason (signature, amount, order state).
- Check that the callback URL at the provider is exactly the one shown on the gateways page and that the site answers over HTTPS.
- Check the keys: a live webhook secret with a test secret key (or the other way round) fails every signature.
- If the money is on the provider's side and the order is still unpaid, record the payment by hand on the order page with the provider's transaction id as the reference.