Skip to content
HisarPay

Collect WHMCS invoices in TRX and USDT

Your client clicks “Pay with crypto” on a WHMCS invoice and pays on the HisarPay payment page. Once the payment confirms, the module applies it to the invoice, the invoice is marked paid and WHMCS’s own automation provisions the service.

  • WHMCS 8
  • PHP 7.4+

What it does

  • A standard WHMCS payment gateway module. Core files stay untouched.
  • Records each payment with its transaction ID (txid), so the same transaction is never applied twice.
  • Underpayments are added as a partial payment and the invoice stays open.
  • Converts non-USD invoices to USD with WHMCS’s own currency rates.
  • Every notification is written to the gateway log for easy troubleshooting.
Paying a WHMCS invoice with HisarPay

Requirements

WHMCS
8.x
PHP
7.4 or later (tested up to 8.3)
PHP extensions
curl and json
Currency
USD configured in WHMCS if you bill clients in other currencies
HisarPay
An active account and an API key

Setup

  1. Step 1

    Copy the files

    Unzip hisarpay-whmcs.zip and copy the modules and includes folders into your WHMCS root. The package adds four parts: the gateway module, its callback, the module’s helper files and a small hook that points out a test key in the back office.

    Files
    modules/gateways/hisarpay.php
    modules/gateways/hisarpay/
    modules/gateways/callback/hisarpay.php
    includes/hooks/hisarpay_admin_notice.php
  2. Step 2

    Activate the gateway

    Go to System Settings → Payment Gateways, open the “All Payment Gateways” tab and activate HisarPay.

  3. Step 3

    Enter your keys

    Paste the API key and the webhook signing secret, then save. In the dashboard, add the callback URL below as an endpoint under Developers → Webhooks.

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

    Try a test invoice

    With the test key, create a client invoice, click “Pay with crypto” and simulate the payment. Once the invoice shows as paid, switch to your live key.

Settings

The fields in the payment gateway settings:

Display name
The payment method name shown on invoices.
API key
Your hp_live_… or hp_test_… key.
Webhook signing secret
The whsec_… value you get when you create the endpoint in the dashboard.
Accepted coins
USDT, TRX or both.
Invoice lifetime
5–1440 minutes; leave empty to use your account default.
HisarPay commission
Account default, you or the customer. On USDT invoices the fixed network fee is always part of the amount due.
Receipt e-mail
Off at first. When on, the customer’s e-mail address is passed to HisarPay and one receipt is sent in your name once the payment is final; mention it in your privacy policy.
Convert to USD
Turn it on for invoices in other currencies, or pick USD in WHMCS’s “Convert To For Processing” setting. Both use WHMCS’s rates.

State mapping

WHMCS invoice states follow HisarPay states like this:

HisarPay stateWHMCS invoice
PendingUnpaidThe client is on the payment page.
PaidPaidRecorded with the txid; service automation runs.
OverpaidPaidThe invoice amount is recorded; the extra shows in the gateway log and you can add it as client credit.
UnderpaidUnpaidThe amount received is applied as a partial payment; the balance stays due.
ExpiredUnpaidThe invoice stays open and the client can start a new payment.
CancelledUnpaidThe WHMCS invoice is not changed. If the client still pays a cancelled payment page, the payment is recorded at its USD value.

Frequently asked questions

Does it work with recurring services?
Yes. WHMCS issues a new invoice each cycle, and the service renews when the client pays it with HisarPay. Crypto payments always need the client’s approval; they are not charged automatically like cards.
What should a client do if the payment window expires?
The WHMCS invoice stays open. The client starts a new payment with the same button and a new HisarPay invoice is created at the current rate.
Can I try the module without a production WHMCS?
WHMCS itself needs a licence. To try the module without touching your live system, use a WHMCS development licence together with a HisarPay test key.
Where do I follow notifications?
Billing → Gateway Log lists every notification together with its verification result. The same delivery also appears in the webhook history of the HisarPay dashboard.

OpenCart

Separate builds for OpenCart 4 and 3, with a connection test button and configurable order status mapping.

  • OpenCart 4 · PHP 8+
  • OpenCart 3 · PHP 7.1+

WooCommerce

Adds TRX and USDT to your checkout and updates the order by itself once the payment confirms.

  • WP 6+
  • WC 8+
  • PHP 7.4+
  • HPOS

REST API

A predictable REST API for everything from invoices to withdrawals, with signed webhooks and a test mode.

  • REST
  • OpenAPI 3.1
  • Webhooks

Your first collection is an e-mail away

Sign-up is free; your test keys are ready the moment you confirm your e-mail.