self-hosted payment gateway software

Connect WHMCS billing to OwnPay without guessing at callbacks

A careful setup keeps credentials, payment notifications and invoice status changes aligned across WHMCS and a self-hosted OwnPay installation.

By Brigid Hennessey·October 26, 2026·4 min read
What matters here
  1. OwnPay has an official WHMCS payment gateway module for routing billing through OwnPay.
  2. A callback URL alone does not prove a payment notification is authentic; verify the documented signature flow.
  3. Test paid, failed and delayed payment paths before relying on invoice status synchronization.

Connecting WHMCS billing to OwnPay gives a hosting provider a path to accept payments through its self-hosted gateway. OwnPay runs on PHP servers and has an official WHMCS payment gateway module. The important work is not just enabling a payment method. It is confirming which system sends each notification, how it is authenticated, and what event changes an invoice’s status.

The module’s exact fields, callback route and signature handling are not established here. Use the instructions shipped with the official module and the documentation for your OwnPay installation as the authority. Do not fill gaps with guessed URLs or copied credentials from another integration.

1. Confirm the systems and paths

Before installation, write down the public addresses for the WHMCS billing site and the OwnPay installation. Confirm both are reachable over HTTPS and that your server can receive requests at the documented callback locations. If you use a custom checkout domain, keep that distinct from the API or notification address unless the module documentation explicitly says otherwise.

OwnPay provides REST API endpoints and cryptographically signed webhooks. That does not establish that the WHMCS module uses a webhook as its callback, or that it uses the same credentials for API requests and notifications. Treat these as separate integration paths until the module’s documentation confirms how they connect.

If you are also configuring a branded checkout domain, the practical steps for mapping the domain and setting up TLS are covered in this guide to a self-hosted checkout domain.

2. Install the official module and set credentials

  1. Download the official WHMCS gateway module from OwnPay’s published source. Check that the package matches the WHMCS and PHP environment you operate, using the module’s own compatibility instructions.

  2. Install the files exactly as directed by the package documentation. Avoid editing module code to make a guessed callback or credential format work; local changes can complicate upgrades and troubleshooting.

  3. In the documented WHMCS gateway configuration, enter the OwnPay connection details the module requests. Obtain those values through the documented OwnPay credential process. Do not assume that an API token, webhook signing secret and gateway-provider credential are interchangeable.

  4. Use a test environment or low-risk test transaction if your setup supports one. Keep secrets out of public issue reports, screenshots and application logs. If the documentation offers a way to restrict credentials, apply the narrowest scope that still permits the required payment flow.

Record which credential belongs to which connection. That small inventory helps when a payment request succeeds but a later notification fails. It also makes rotation less error-prone.

3. Establish callback validation

Find the callback route and authentication method in the module documentation before accepting live payments. Confirm whether WHMCS receives a notification directly from OwnPay, whether the module polls an API, or whether another documented handoff is involved. Do not treat a request reaching a public URL as proof that it came from OwnPay.

Where the flow uses OwnPay’s signed webhooks, follow the documented signature verification procedure and keep the relevant signing material on the server. The receiver should reject invalid signatures and handle repeated delivery safely. A retry can arrive after an earlier attempt timed out; processing the same successful payment twice must not create duplicate invoice actions.

Check server logs for enough detail to distinguish a rejected signature, an unreachable endpoint and an application error, without recording secrets or unnecessary customer data. For a more detailed event-tracing method, see this guide to debugging self-hosted payment webhooks.

4. Test invoice status synchronization

Use a controlled test invoice and follow it through both systems. Verify that the payment request reaches OwnPay, that the configured payment route handles it, and that WHMCS receives the documented result. Then check the invoice record in WHMCS rather than relying only on a checkout confirmation screen.

  • Test a completed payment and confirm the corresponding invoice moves to the expected paid state.

  • Test a declined or failed attempt and confirm it does not mark the invoice as paid.

  • Test a delayed notification or retry if your environment permits it. Confirm that the final result is reflected once, without duplicate payment records or repeated invoice actions.

  • Compare the transaction reference and amount shown in OwnPay with the record associated with the WHMCS invoice. Investigate mismatches before enabling the method for customers.

Payment states and terminology can differ between systems. Map them using the module’s documented behavior; do not infer that every provider event should produce the same WHMCS status.

5. Go live with a recovery plan

Before switching to live traffic, confirm HTTPS, callback reachability, signature validation where applicable, and the test results above. Keep a short runbook with the module version, credential owner, documented callback path and the procedure for checking a payment in both systems. If a live invoice remains unpaid after a customer reports success, use transaction references and event logs to trace the handoff before manually changing its status.

A WHMCS OwnPay integration is dependable when each handoff has a defined owner: WHMCS creates the billing context, OwnPay handles the gateway connection, and the documented response path brings the outcome back. Verify that chain end to end; a successful checkout alone is not a synchronization test.

More from OwnPay News