SDKs and plugins
Plugins
If you run an off-the-shelf store or billing platform, you can connect HisarPay without writing code. The plugins turn orders into invoices, send customers to the payment page and update order status when the webhook arrives.
Supported platforms
| Platform | What it does |
|---|---|
| WooCommerce | Adds a “Pay with TRX / USDT” option at checkout and updates orders automatically. |
| WordPress | Places payment buttons and payment links on any page with a shortcode. |
| OpenCart 4 and 3 | Adds a payment method and lets you map order statuses. |
| WHMCS | Collects invoices through HisarPay and closes them when the payment arrives. |
Downloads and platform-specific screenshots are on the Integrations page.
Setting up
- Create a separate key for the plugin in the dashboard under Developers → API keys. The
invoicesandreadscopes are enough. - Upload and activate the plugin from your platform’s plugin manager.
- Paste the API key into the plugin settings.
- Add the webhook address shown on the plugin’s settings page under Developers → Webhooks in the dashboard, and enter the signing secret you get into the plugin.
- Place a test order with an
hp_test_key first, simulate the payment from the dashboard and watch the order status change. Then switch to the live key.
What happens behind the scenes
- When the customer reaches the payment step, the plugin creates an invoice with an
order_idderived from the platform’s order number. Paying again for the same order reuses the open invoice; an expired one is replaced by a new invoice with a-2,-3suffix. - The customer is sent to the HisarPay payment page and returns to your store afterwards.
- Order status changes through webhooks with a verified signature. The shop plugins (WooCommerce, OpenCart) also check the API every 10 minutes, and WHMCS when the client returns to the invoice; in every case the plugin re-reads the invoice from the API.
invoice.paidandinvoice.overpaidmark the order paid,invoice.partialkeeps it on hold, andinvoice.expiredcancels it when nothing arrived or keeps it on hold after a partial payment. A payment that arrives after expiry re-opens a cancelled order.
Troubleshooting
- Orders do not update: check the webhook delivery log in the dashboard. A
400usually means a wrong signing secret; a403or a timeout usually means a firewall or caching plugin. - 401 unauthorized: the key was copied incorrectly or has been revoked.
- Once fixed, resend the event from the dashboard; the plugin never processes the same order twice.