The PaymentHooks module for WHMCS 8.x adds PaymentHooks as a payment gateway. When a client pays an invoice, they are sent to the PaymentHooks checkout, the payment goes through your connected gateway, and a signed webhook marks the WHMCS invoice paid. Card details are entered only on the PaymentHooks page, never in WHMCS. The current module version is 3.1.5.
Before you start
- WHMCS 8.x with PHP 7.4 to 8.x (cURL and JSON extensions).
- Your WHMCS site reachable over HTTPS, so PaymentHooks can send webhooks to it.
- A gateway connected in PaymentHooks that supports your WHMCS currencies.
Set up PaymentHooks
- 1Under Developers > API Keys, create a secret key (
phk_live_) with thepayments:read,payments:write,customers:readandcustomers:writepermissions. For automatic renewals also addsubscriptions:write. - 2Under Developers > Webhooks, add the Webhook URL shown in the module settings as an endpoint.
- 3Subscribe it to
checkout.session.completed,checkout.session.payment_failed,payment.refunded,subscription.renewed,subscription.renewal_failed,subscription.cancelled,subscription.deletedandinvoice.paid. - 4Copy the endpoint's signing secret (
whsec_).
Set up WHMCS
- 1Copy the module's
modules/gateways/folder into your WHMCSmodules/gateways/directory. - 2In WHMCS admin, open Configuration > System Settings > Payment Gateways and activate PaymentHooks.
- 3Enter the Secret Key and Webhook Signing Secret. Optionally enter a Custom Checkout Domain you have connected in PaymentHooks.
- 4Tick Enable Subscriptions if clients should be able to choose automatic renewal.
Pay Now and Subscribe & Auto-pay
Pay Now pays the invoice once. With subscriptions enabled, invoices for hosting, domains or addons also show Subscribe & Auto-pay. PaymentHooks then charges each renewal itself through your gateway and the module records it on the WHMCS renewal invoice. WHMCS never charges a card. When Subscribe is not offered, a note under Pay Now says why.
Refunds
A refund issued from WHMCS is sent to PaymentHooks. A refund made in the PaymentHooks dashboard is recorded on the WHMCS invoice automatically, and never booked twice.
Every webhook the module receives appears in WHMCS under Billing > Gateway Log, and errors appear in the Activity Log.