WHMCS
Copy the module, add a brand, activate the gateway, test with a test invoice.
The WHMCS module lets clients pay invoices through your gateway with whatever methods the brand has.
Install
- Copy the
modulesfolder into your WHMCS root, so you getmodules/gateways/paygate.phpandmodules/gateways/callback/paygate.php. - On the gateway: add a brand for WHMCS and copy its API key and secret. The brand must accept the currency of your invoices.
- WHMCS admin → System Settings → Payment Gateways → All Payment Gateways → Mobile banking (self-hosted gateway): activate it and fill in the payment server URL, API key and secret, and the display name.
- Open an unpaid invoice as a client, choose the method and press Pay now.
How it works
- The Pay now button is a form signed with your API secret, so nobody can start a payment for another amount.
- The callback re-reads the invoice (it must be Unpaid), creates a payment with
reference=INV-<id>and redirects to the checkout. - After payment the signed webhook reaches the callback file. It checks the signature, the invoice, the TrxID (repeats are ignored), currency and reference, and records the payment with the TrxID as transaction ID.