On this page
What the module does
HisarPay is a standard WHMCS payment gateway and touches no core file. The client opens an invoice, presses “Pay with crypto” and lands on the HisarPay payment page. Once the transfer has 20 block confirmations, the module records it on the invoice under its transaction id (txid). WHMCS then provisions or renews the service and sends its usual e-mails.
Nothing is created until the button is pressed, so viewing an invoice leaves no trace at HisarPay. Pressing it again returns the client to the page that is still open. If the balance changed in between, that page is cancelled and a new one is opened, so nobody can pay an outdated total.
Installing it
You need WHMCS 8.x, PHP 7.4 to 8.3, the curl and json extensions, and an API key with the invoices scope.
- Download
hisarpay-whmcs.zipfrom the WHMCS integration page and unzip it. - Upload the
modulesandincludesfolders to your WHMCS root. - Under System Settings → Payment Gateways, open All Payment Gateways and activate HisarPay.
- Enter the API key and save. Use one that starts with
hp_test_for the first round.
modules/gateways/hisarpay.php
modules/gateways/hisarpay/
modules/gateways/callback/hisarpay.php
includes/hooks/hisarpay_admin_notice.phpDo not skip includes. Its one small file shows a banner on every admin page for as long as a test key is saved. The settings also hold the accepted coins, the invoice lifetime (5 to 1440 minutes) and who pays the 0.4% commission. The Order ID prefix belongs to this installation: keep it when you move servers, or earlier invoices will not be recognised.
The callback and the log
Add this address under Developers → Webhooks in the dashboard, limit it to events that start with invoice., and paste the whsec_ secret into the module:
https://billing.yourdomain.com/modules/gateways/callback/hisarpay.phpSend a test event and Billing → Gateway Log should show “Test webhook received”. For every event the module checks the signature, refuses anything more than five minutes off and loads the invoice from the API again, so keep the server clock right. The same check runs when the client comes back from the payment page, which means a lost webhook does not leave an invoice open. If your server is down at that moment, HisarPay repeats the event for about two days, and each txid is recorded only once.
Currency: invoices that are not in dollars
HisarPay invoices are priced in dollars. A client billed in USD pays the WHMCS balance as it is. For any other currency two things must be in place: a USD currency under System Settings → Currencies, and the module’s Convert to USD option (or USD in WHMCS’s own Convert To For Processing). The conversion uses the rate you keep in WHMCS, so keeping it current is your job.
The payment is recorded in the client’s own currency, for the balance that was open when the HisarPay invoice was made. A €75 invoice converted to dollars and paid still shows €75. With conversion off, the client is asked to choose another payment method.
Short, excess and late payments
A partial payment is valued by the share of the price it covers. On USDT invoices the 1 USDT network fee is taken from the first payment and does not count towards the service. Say a $60 invoice asks for 61 USDT and the client sends 31. One goes to the network fee, $30 is recorded on the invoice and $30 stays due. Pressing the button again opens the same page for the rest.
| HisarPay status | WHMCS invoice | Note |
|---|---|---|
| Pending | Unpaid | The client is on the payment page |
| Partly paid | Unpaid | What arrived is recorded, the balance stays due |
| Paid | Paid | A shortfall within tolerance does not keep it open |
| Overpaid | Paid | The extra is in the Gateway Log |
| Expired | Unpaid | The client can start again; a late payment is recorded too |
The extra from an overpayment is in your balance but not on the WHMCS invoice; add it as client credit if you like. The smallest HisarPay invoice is $10, so a client cannot pay a remainder below that through the module. For small gaps, an underpayment tolerance in the dashboard usually settles it.
Renewals are invoices the client pays
Cards can be charged automatically; a crypto wallet cannot. WHMCS issues a new invoice each cycle, the client pays it, and the service renews once the payment is recorded. Saying so up front saves you complaints about suspended services:
- In WHMCS automation settings, generate renewal invoices several days before the due date.
- Keep the reminder e-mails on. The invoice link in them leads straight to the pay button.
- Leave a day or two before suspension, because some people pay at the weekend.
- Offer longer terms. One payment a year is easier than twelve, for both of you.
Each renewal gets its own rate: dollars equal USDT one to one, and a client who picks TRX has the rate locked at that moment. If the payment page times out, the WHMCS invoice stays open and the same button starts again. Our hosting page has a worked fee example.
Test it, then go live
- With the test key saved, create a client invoice and press the button.
- Run the Paid simulation on the payment page. The invoice should become Paid.
- Try Partial on a second one and check the balance.
- Find every notification in the Gateway Log, then enter the live key.
Frequently asked questions
Can the module charge a client’s wallet automatically?
Does the Refund button in WHMCS work?
What does Manual Review mean in the Gateway Log?
Can two WHMCS installations share one HisarPay account?
- #WHMCS
- #Hosting
- #Invoices
- #USDT
Try crypto payments in test mode
No setup or monthly fees. Experiment as much as you like in test mode and go live when you are ready.