Online Payments with Paymob
Connect Paymob to your store so customers pay by card or wallet at checkout, with automatic payment confirmation and refunds.
What is the Paymob integration?
Paymob is a payment gateway that lets your storefront customers pay online by card, mobile wallet, and other local payment methods in Egypt, the UAE, Saudi Arabia, and Oman. Once connected, checkout gains a Pay Online option: the customer is redirected to a secure Paymob page, completes the payment, and the order is marked paid automatically. You never confirm these payments by hand.
Store level integration
Paymob is connected per store. Each store with an online storefront gets its own Paymob connection, its own keys, and its own payment fee settings.
Before you start
You need a Paymob merchant account with these values from the Paymob dashboard under Settings > API Keys and Settings > Payment Integrations:
| Value | Where to find it |
|---|---|
| API Key | Paymob dashboard, Settings > API Keys |
| Secret Key | Paymob dashboard, Settings > API Keys |
| Public Key | Paymob dashboard, Settings > API Keys |
| HMAC Secret | Paymob dashboard, Settings > API Keys |
| Integration IDs | Paymob dashboard, Settings > Payment Integrations. One number per payment method you enabled (cards, wallets, and so on) |
Test mode and live mode must match
Every Paymob account starts in test mode. Test keys only work with test Integration IDs, and live keys only work with live Integration IDs. Mixing them is the most common setup mistake. Start with test values, place a test order, then switch everything to live together.
Connect Paymob to a store
- Go to Settings > Integrations in the business portal.
- On the Paymob card, click Connect Paymob.
- Choose the Store to connect.
- Choose the Paymob country of your account. Only countries matching your store currency are offered: Egypt (EGP), UAE (AED), Saudi Arabia (SAR), or Oman (OMR).
- Paste the API Key, Secret Key, Public Key, and HMAC Secret.
- Add your Integration IDs, one entry per payment method.
- Optionally set an Order fee (see below).
- Save. Your keys are checked live with Paymob before anything is stored. If a key is wrong, the save is rejected with the exact reason, so fix the key and save again. The same live check runs every time you update the keys or settings later.
Add the callback link in Paymob
After saving, the integration page shows a Callback URL with a copy button. Paste this link in your Paymob dashboard so Paymob can notify us the moment a payment happens:
- In the Paymob dashboard, open Settings > Payment Integrations and edit each integration you use.
- Paste the link into both Transaction processed callback and Transaction response callback.
- Save.
Why this matters
The callback is how Paymob tells your store that a payment succeeded. We also check every payment directly with Paymob before marking an order paid, so a missed callback never loses a payment, but setting it keeps confirmations instant.
Payment fee (optional)
You can add a fee or a discount that applies only when the customer pays online:
| Setting | Options |
|---|---|
| Fee type | Percentage of the order total, or a fixed amount |
| Applied as | Extra charge (added to the total) or Discount (off the total) |
| Fee value | The percentage or amount |
The fee appears as its own line in the checkout totals before the customer confirms, and it is included in the amount charged by Paymob.
Enable Online Payment for the storefront
Once the Paymob connection is active:
- Go to Settings > Stores, open the store, and select the Payments tab, then the Storefront section.
- Enable Online Payment and save.
The storefront checkout now shows Pay Online. Before a gateway is connected, the Online Payment switch stays off and shows a Configure payment gateway shortcut instead. You also cannot disable or delete the gateway while Online Payment is still enabled.
How online-paid orders behave
Online payments are controlled by the system from start to finish:
- The order starts as Pending while the customer pays on the Paymob page.
- The payment is confirmed with Paymob directly, then the order flips to Paid automatically. The order page shows the gateway, the Paymob transaction number, and the card or wallet used.
- Manual payment actions are disabled for these orders: no recording payments by hand, no editing amounts, and no manual refunds. This keeps your records exactly in sync with Paymob.
- If a payment attempt fails, the customer can retry from the storefront. Every attempt is tracked on the order.
- An unpaid order whose payment never completes cancels itself automatically after a few hours, so abandoned checkouts never pile up as pending orders.
Refunds for online-paid orders
Refunds for gateway payments are always processed through Paymob and always for the full paid amount:
- Cancelling a paid order automatically sends the full refund through Paymob. No extra steps.
- Creating a refund from the order page sends the same full refund through Paymob.
- The refund is marked Completed only after Paymob confirms the money moved. Until then it shows as Processing.
- Refunding an order you have not fulfilled yet cancels it automatically once Paymob confirms the refund. Orders already fulfilled keep their completed state.
Same-day cancellations
When a payment is cancelled the same day, we void the transaction at Paymob instead of refunding it, which usually returns the money faster and avoids gateway fees.
Troubleshooting
| Problem | Fix |
|---|---|
| Saving fails on the API key or Secret key | Re-copy the key from Paymob, Settings > API Keys. Make sure there are no extra spaces. |
| Saving fails on the Integration IDs | Your keys and Integration IDs are from different modes (test vs live) or a different country account. Match them and try again. |
| Customer paid but the order is still Pending | Confirm the callback link is set in Paymob. The system also re-checks pending payments with Paymob automatically within minutes, so the order will update on its own. |
| Cannot enable Online Payment | Connect and activate a Paymob integration for this store first. |
| Cannot disable the integration | Turn off the Online Payment storefront method first, then disable the integration. |
Related
- Storefront Payment Methods: Enable and order checkout payment options
- Online Checkout Flow: The full customer journey
- Order Payments: How payments appear on orders