Skip to main content

Topping up & payments

Top up​

Usage → Top up: choose an amount and a gateway, and you are redirected to the gateway's page. On return, Errora verifies the payment with the gateway and only then credits the wallet.

GET /api/v1/payment-gateways # gateways available to you
POST /api/v1/organizations/{org_id}/wallet/top-up # {"amount": 500000, "gateway": "zarinpal"}
GET /api/v1/organizations/{org_id}/payments
GET /payments/callback/{token} # the gateway returns the user here

Only the verify step moves money. A callback alone never credits a wallet — that is what keeps a forged return URL from minting credit.

Gateways​

GatewayUse
ZarinPalProduction payments
Test gatewayLocal/staging — renders a confirm/reject page and returns through the same callback

Only the gateways this Errora instance has configured are offered at checkout.

Payment states​

StateMeaning
pendingStarted, user is at the gateway
paidVerified and credited
failedThe gateway rejected it, or verification failed
canceledThe user came back without paying

The payments table lists every attempt with its reference and receipt, next to the wallet ledger.

Permissions​

Topping up and viewing payments requires the org:billing capability — the billing role exists so finance can do this without engineering access.

Troubleshooting​

SymptomCause / fix
No gateways offeredNo payment gateway is available right now — contact support
Paid but balance unchangedVerification failed — check the payment row's status; the money is with the gateway, not lost
Callback returns an errorThe callback token expired or was already used; start a new top-up
Test gateway not offeredIt only exists on local and staging environments, never in production