HesabPay lets customers pay in Afghani (AFN) with their HesabPay wallet. It only works in AFN. Your invoices can stay in any currency, because the app converts the amount with a rate that you set. HesabPay has no sign-in connection, so you copy one key. What HesabPay charges is on HesabPay's own website.
Get your API key
- Sign in to the HesabPay developer portal at developers.hesab.com. For testing, use developers-sandbox.hesab.com instead. It has the same screens, with its own key.
- In the sidebar, open Developer, then the API Key tab.
- Generate a key and copy it. Keep it private.
- Verify your website with HesabPay. HesabPay asks for a DNS proof of your domain. It is optional in the sandbox, but the real side requires it.
Connect it
- In the app, open Settings, then Payment methods.
- Under Pay online, press Connect HesabPay.
- Under Which account, choose Test (sandbox key) or Real money (real key).
- Paste the API key.
- Press Connect and check.
The webhook
The webhook is how HesabPay tells us that a payment succeeded or failed, so it is counted even if the customer closes the tab. If the card asks you to add it yourself:
- In the app, press Copy the address.
- In the HesabPay portal, open your developer profile and its Webhooks.
- Paste the address, choose the events payment_success and payment_failure, and save.
- Wait until HesabPay finishes Checking webhook.
The real side needs a public https address that passes this check. The address must belong to your verified website or one of its subdomains.
Set the rate
- On the same Payment methods page, find Card security and rates.
- Under How many AFN for 1 (your invoice currency), type a number such as 75.50 and press Save.
Update it when the rate moves. The customer sees the total in AFN. Very small amounts may be refused, so check HesabPay's own minimum.
What the customer sees
HesabPay appears as one of the tiles on the checkout. Its page opens inside the checkout. Some phones and browsers block that, so the app then opens HesabPay in a new tab. The customer signs in, confirms and comes back to the result page. The session lasts about ten minutes.
Tips
- Keep the rate up to date, because customers pay the converted AFN amount.
- Use the Test account first.
- Turn off hides it from the checkout without deleting your key.
See also: Connect a payment provider, Checkout links, Bank transfer.