Accept Bitcoin and other crypto on your WHMCS install through NakoPay.
- Stripe-style API: invoices created server-side, polled and webhook-notified.
- Signed webhooks (HMAC-SHA256, 5-minute replay window).
- No bundled Angular, no per-coin sub-domains. Plain PHP + ~30 KB of vendor JS.
- WHMCS 8.0+
- PHP 8.0+
- SFTP / SSH access to your WHMCS install (the WHMCS admin uploader does not support payment gateway modules)
- A NakoPay account (free) - https://nakopay.com/dashboard/api-keys
| # | Source | When to use |
|---|---|---|
| 1 | WHMCS Marketplace - https://marketplace.whmcs.com/product/nakopay | Listing pending review - use option 2 in the meantime. |
| 2 | GitHub Releases zip - https://github.com/NakoPayHQ/plugin-whmcs/releases/latest/download/nakopay-whmcs.zip | Available today. Download nakopay-whmcs.zip. |
| 3 | Build from source | See bottom of this file. |
WHMCS payment gateways must live in a specific folder layout, so you must use SFTP or the file manager built into your hosting panel. There is no admin-UI uploader for gateway modules.
-
Download
nakopay-whmcs.zipand unzip it on your computer. You'll get a folder structure like:modules/gateways/nakopay.php modules/gateways/nakopay/ modules/gateways/callback/nakopay.php -
Upload these files into your WHMCS install so the final paths are:
<whmcs-root>/modules/gateways/nakopay.php <whmcs-root>/modules/gateways/nakopay/... <whmcs-root>/modules/gateways/callback/nakopay.phpUse FileZilla / Cyberduck / WinSCP (SFTP), or your hosting panel's File Manager (cPanel, Plesk, DirectAdmin all work). Make sure files keep
0644permissions and folders0755. -
In WHMCS admin go to Setup -> Payments -> Payment Gateways -> All Payment Gateways, find NakoPay (Bitcoin), click Activate.
-
Paste:
- API Key -
sk_live_...(orsk_test_...for testing). Get one at https://nakopay.com/dashboard/api-keys. - Webhook Signing Secret - shown once when you create a webhook endpoint in your NakoPay dashboard.
- API Key -
-
In your NakoPay dashboard, Settings -> Webhooks -> Add endpoint, paste the Your Webhook URL value the gateway shows you (typically
https://your-whmcs.example/modules/gateways/callback/nakopay.php). Subscribe toinvoice.paid,invoice.completed,invoice.expired,invoice.cancelled. Save - copy the signing secret it shows you back into step 4. -
Browse to
https://your-whmcs.example/modules/gateways/nakopay/upgrade.phponce (admin login required) to create themod_nakopay_orderstable. You should see{"ok": true}.
- Create a test invoice in WHMCS for any client.
- Click Pay Now on the client side - you should see a QR + Bitcoin address + amount.
- Pay with a
sk_test_*key from a Bitcoin testnet faucet. Within ~10s the page redirects back toviewinvoice.phpand the invoice is marked Paid.
If verification fails, run the Test Setup button on the gateway settings page in WHMCS admin - it pings NakoPay with your key.
- A WHMCS invoice's "Pay Now" button posts to
modules/gateways/nakopay/payment.php, which callsPOST /v1/invoicesand shows the customer an address + QR + amount. - The checkout page polls
?poll=in_xxxevery 5s. When the invoice flips topaidorcompleted, the customer is redirected back toviewinvoice.php. - The webhook receiver verifies the signature, looks up the WHMCS invoice id from
metadata.whmcs_invoice_id(or the local orders table), and callsaddInvoicePayment(). Duplicate transaction ids are ignored, so retries are safe.
Use a sk_test_... key. Test invoices accept BTC testnet sends - grab funds from any testnet faucet.
- WHMCS admin -> Setup -> Payments -> Payment Gateways -> NakoPay (Bitcoin) -> Deactivate.
- Via SFTP, delete:
modules/gateways/nakopay.phpmodules/gateways/nakopay/(whole folder)modules/gateways/callback/nakopay.php
- (Optional) Drop the
mod_nakopay_orderstable from your WHMCS database.
| Path | Purpose |
|---|---|
nakopay.php |
Gateway entry: settings + Pay Now button. |
nakopay/nakopay.php |
NakoPay\Client - API + DB + signature verify. |
nakopay/payment.php |
Customer checkout controller + JSON poll endpoint. |
nakopay/testsetup.php |
Admin-only API key smoke test. |
nakopay/upgrade.php |
Creates the orders table. |
nakopay/assets/templates/checkout.tpl |
Smarty checkout view. |
nakopay/assets/js/checkout.js |
QR render + polling. |
nakopay/assets/js/vendors/qrious.min.js |
QR generator (MIT). |
nakopay/assets/css/order.css |
Checkout styling. |
nakopay/lang/english.php |
UI strings. |
modules/gateways/callback/nakopay.php |
Webhook receiver. |
git clone https://github.com/NakoPayHQ/plugin-whmcs.git
cd plugin-whmcs
zip -r nakopay-whmcs.zip modules/ -x "*.git*" "tests/*" "*.DS_Store"MIT.