Installation
Install the TriaPay DHRU plugin and send your first test payment in under ten minutes.
Installation
End-to-end walkthrough: register a tenant, install the DHRU plugin, send a test payment.
Prerequisites
- A working DHRU Fusion install (any recent PHP version DHRU itself supports).
- SSH or panel access so you can drop two PHP files into
modules/gateways/andmodules/gateways/callback/. - A publicly reachable HTTPS URL for your DHRU instance (TriaPay posts signed webhooks to it).
- A TriaPay tenant account (register here).
1. Create your tenant
Register at /register with your username, email, and a password of at least 12 characters. Verify your email through the link we send. An admin will then activate your tenant — typically within one business day. You will receive a second email when activation completes.
2. Generate API credentials
Sign in. Open the Integration page. The Webhook & API tab gives you three things:
- Webhook URL — where TriaPay POSTs credit events. Set this to your DHRU callback path:
https://yourdhru.com/modules/gateways/callback/triapay.php. - API key — bearer token your DHRU plugin uses to create orders. Click Rotate to mint. Shown only once — copy immediately.
- Webhook secret — HMAC-SHA256 key your plugin uses to verify webhook signatures. Click Rotate to mint. Shown only once.
3. Install the DHRU plugin
The plugin ships as two PHP files, both downloadable from the Webhook & API tab:
| Download | Place at |
|---|---|
triapay.php (gateway) |
<dhru-root>/modules/gateways/triapay.php |
triapay-callback.php (callback, rename to triapay.php) |
<dhru-root>/modules/gateways/callback/triapay.php |
The callback file is renamed during installation because DHRU expects the callback file to share the gateway's basename. We ship the download with a different name only to keep the two files distinct in the flat /downloads/ directory on TriaPay.
3a. Whitelist the callback in `.htaccess`
DHRU's modules/gateways/callback/.htaccess denies access by default and whitelists callbacks via a FilesMatch regex. Append |^triapay\.php to that list so TriaPay webhooks can reach the callback:
<FilesMatch "^wombi\.php|^gourlio\.php|...|^tripay\.php|^triapay\.php">
Order Allow,Deny
Allow from all
</FilesMatch>
Without this edit, your DHRU returns 403 Forbidden on every webhook delivery and orders never transition past confirmed. Reload Apache is not required — .htaccess changes apply on the next request.
3b. Configure the gateway in DHRU
Open DHRU admin → Settings → Payment Gateways → TriaPay. Paste these values:
- API URL:
https://triapay.net/api/v1 - API key: the
tpk_live_...value you rotated in step 2 - Webhook secret: the value you rotated in step 2
Save.
4. Configure receive methods
Back in the TriaPay dashboard → Integration:
- Crypto tab → for each chain you want to accept set the master address that customers will send funds to. TRC20 is USDT-only; BEP20 accepts both USDT and USDC. Optionally set min/max amounts and fees under Advanced settings.
- Binance Pay tab → set your Binance Pay ID plus a Binance API key + secret with Read and Pay permissions only. Both USDT and USDC are supported here. The credentials are encrypted at rest with AES-256-GCM.
5. Send a test payment
From the DHRU customer panel, log in as a test user. Create a $1 deposit. Pick USDT TRC20 (fastest to confirm in tests). Send the exact displayed amount including the trailing decimal suffix (e.g. 1.0123 USDT — the trailing decimals encode the order match code; width is configurable per method, 1 to 3 digits).
Detection runs on a tight cadence: the TRC20 and BEP20 listeners scan every 3 seconds, Binance Pay every 5 seconds. End-to-end credit is typically 3–7 seconds for crypto and 5–10 seconds for Binance Pay, plus the chain confirmation tail.
Within seconds you should see:
- Order status flips
pending → matched → creditedin your TriaPay dashboard. - The DHRU invoice marked paid.
- The user's balance updated.
If anything stalls, check the dashboard's Audit log for the failure reason.
Troubleshooting
| Symptom | Likely cause |
|---|---|
Order stuck confirmed, never reaches credited |
Webhook delivery failed. Inspect the audit log for the HTTP response from your DHRU. Check that the webhook URL is publicly reachable, your DHRU isn't behind a basic-auth wall, and the webhook secret matches on both sides. |
| Payment seen on-chain but no order matches | Customer sent the wrong amount or omitted the Binance Pay note. Open Admin → Orphan transactions and bind manually to the right invoice. |
429 Rate limited returned to plugin |
Plugin is hitting /api/v1/orders too aggressively. The limit is 60 orders per tenant per minute. The response now includes a Retry-After header (seconds) — back off and retry. |
401 invalid api key |
Either the API key was rotated and the plugin still has the old value, or the key prefix doesn't match. Re-rotate and re-paste. |
| Webhook signature verification fails on the DHRU side | Body must be hashed exactly as received (raw bytes, no re-encoding). Check X-Payment-Sig-Version: version 2 signs {timestamp}\n{idempotency}\n{body}, version 1 signs the body alone. The bundled DHRU plugin handles both during the 30-day rollover window. Reject if |now − X-Payment-Timestamp| > 300. |
Next steps
- API reference — REST contract for direct integrations
- Webhook spec — full payload format and signature verification