Pesapal Payments
ECOSIRE Pesapal Payments connects submitted ERPNext Sales Invoices to Pesapal's hosted checkout (API 3.0). Customers pay on Pesapal's own PCI-controlled page — the app never sees card numbers. It registers IPN callbacks, creates orders idempotently, verifies every callback against Pesapal's authoritative status API (checking reference, currency, and amount), and posts a native ERPNext Payment Entry exactly once.
This app is ready to configure, but it can only take live payments once you complete Pesapal merchant onboarding and hold your own Consumer Key/Secret and a registered IPN. Until then, run it in Sandbox — invoices are still created and posted in ERPNext; they simply aren't charged through Pesapal.
Before you start
- Install
ecosire_pesapal_payments, ERPNext v16, andecosire_license_client, and activate the ECOSIRE licence. - A Pesapal merchant account with a Consumer Key and Consumer Secret.
- A public HTTPS ERPNext URL that Pesapal can reach for callbacks.
Never paste credentials into notes, logs, or support screenshots — the app stores the Consumer Secret in an encrypted Password field.
1. Configure Pesapal Settings
Open Pesapal Settings as System Manager:
- Start with Environment = Sandbox.
- Enter the Consumer Key and Consumer Secret.
- Enter the public HTTPS Callback Base URL (the app appends its own callback/IPN path).
- Set the Receiving Bank / Cash Account — the ledger account the resulting Payment Entry posts to.
- Save. The app registers the IPN and stores the Registered IPN ID.
- Tick Enabled only once the sandbox connection succeeds.
2. Take a payment
- Open a submitted, unpaid Sales Invoice.
- Choose the Pesapal payment action — the app creates an order and returns the Pesapal Hosted Checkout URL.
- Send the customer to that URL (or redirect them); they pay on Pesapal's page.
- A Pesapal Transaction record is created in
Pendingstate, tracking the Merchant Reference and Pesapal Tracking ID.
On a verified success callback, the app records the confirmation code and payment method, marks the transaction Success, and creates the reconciled Payment Entry against the invoice.
3. Review & reconcile
Use Pesapal Transaction to audit status, environment, merchant reference, Pesapal tracking id, amount, company, the originating document, the linked Payment Entry, and the raw request/response payloads (for authorised troubleshooting). Transaction visibility is company-scoped.
Production cutover
- Complete Pesapal's go-live process and switch to production credentials.
- Set Environment = Production.
- Verify the public callback URL is reachable from outside your network.
- Make one controlled low-value payment and confirm exactly one
Successtransaction and one reconciled Payment Entry. - Confirm no secret appears in application or proxy logs.
Troubleshooting
| Symptom | Check |
|---|---|
| No checkout URL returned | Credentials, Enabled flag, environment, and licence status |
| Transaction stays Pending | Public callback reachability; the app re-checks status against Pesapal |
| Callback rejected | Reference, currency, and amount must match the pending order |
| Payment Entry not created | Inspect the status response and the invoice state |