Skip to content
HisarPay
  • Integrations
  • Published:
  • Reading time: 5 min read
  • Türkçe oku

Collect WHMCS invoices in USDT: module, currency, part payments

If you sell hosting, servers or domains, WHMCS already writes the invoice. What it lacks is a button for paying in crypto. The HisarPay module adds that button, records the payment and leaves the rest to WHMCS automation. This article covers setup, currency conversion, partial payments and renewals.

On this page
  1. What the module does
  2. Installing it
  3. The callback and the log
  4. Currency: invoices that are not in dollars
  5. Short, excess and late payments
  6. Renewals are invoices the client pays
  7. Test it, then go live
  8. Frequently asked questions

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.

  1. Download hisarpay-whmcs.zip from the WHMCS integration page and unzip it.
  2. Upload the modules and includes folders to your WHMCS root.
  3. Under System Settings → Payment Gateways, open All Payment Gateways and activate HisarPay.
  4. Enter the API key and save. Use one that starts with hp_test_ for the first round.
Files the package adds
modules/gateways/hisarpay.php
modules/gateways/hisarpay/
modules/gateways/callback/hisarpay.php
includes/hooks/hisarpay_admin_notice.php

Do 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:

Callback URL
https://billing.yourdomain.com/modules/gateways/callback/hisarpay.php

Send 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 statusWHMCS invoiceNote
PendingUnpaidThe client is on the payment page
Partly paidUnpaidWhat arrived is recorded, the balance stays due
PaidPaidA shortfall within tolerance does not keep it open
OverpaidPaidThe extra is in the Gateway Log
ExpiredUnpaidThe 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

  1. With the test key saved, create a client invoice and press the button.
  2. Run the Paid simulation on the payment page. The invoice should become Paid.
  3. Try Partial on a second one and check the balance.
  4. Find every notification in the Gateway Log, then enter the live key.
A banner means test modeAnyone who opens the payment page of a test invoice can mark it paid, and the WHMCS invoice gets a “TEST payment” note. Before real clients see the button, make sure the banner is gone.

Frequently asked questions

Can the module charge a client’s wallet automatically?
No. WHMCS issues an invoice for each cycle and the client pays it. Every crypto payment needs the client’s own approval.
Does the Refund button in WHMCS work?
No, the module declines and says why. Send the amount as a withdrawal to an address the client gives you, then record the refund in WHMCS without using the gateway.
What does Manual Review mean in the Gateway Log?
A payment arrived that the module could not place, for example on a WHMCS invoice you had cancelled. The entry holds the HisarPay invoice, the txid and the amount; the decision is yours.
Can two WHMCS installations share one HisarPay account?
Yes. The order id prefix is unique to each installation, so they never pick up each other’s invoices. Give each its own endpoint and API key.
  • #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.

More guides that go well with this one.