Crypto payments for FOSSBilling
A payment adapter for FOSSBilling that lets clients pay invoices in USDT (TRC20, ERC20, BEP20) and other coins through SnapEX Pay. When a client chooses SnapEX Pay on an invoice, the adapter creates a SnapEX Pay invoice and sends the client to the payment page. Once the payment is confirmed, a signed webhook arrives at FOSSBilling's IPN URL, the client is credited and the invoice is marked paid.
Free. Version 1.1.0.
What it does
- No wallet, node or blockchain watcher to run: funds go to your SnapEX Pay merchant balance.
- A single-file adapter that shows up under System → Payment gateways.
- Webhooks are verified with HMAC-SHA256 and a 5-minute window, and the invoice is read back from the SnapEX Pay API before anything is credited.
- Payments are booked once: a repeated webhook does not credit the client again, and settlement runs under a database lock. If the invoice total changed after checkout, nothing is credited automatically.
- FOSSBilling's Enable Test Mode creates SnapEX Pay test invoices without real money; test payments are never applied while the gateway is live.
- Several FOSSBilling sites can share one SnapEX Pay account; non-USD invoices are converted with a fixed rate or with FOSSBilling's own currency rates.
Install
- From the archive copy
SnapexPay.phpinto your FOSSBilling root so that it ends up atlibrary/Payment/Adapter/SnapexPay/SnapexPay.php(folder and file names are case-sensitive) and make it readable by the web server user. - In the admin area go to System → Payment gateways → New payment gateway and install SnapexPay.
- Open the gateway, paste the API key (scopes
invoices.read,invoices.write) from the SnapEX Pay cabinet, tick Enabled and Allow One Time Payments, and save. - Copy the IPN Callback URL shown on the gateway page (
https://<your-fossbilling>/ipn.php?gateway_id=<id>), add it as a webhook endpoint in the SnapEX Pay cabinet subscribed toinvoice.paid, and paste thewhsec_…secret into Webhook secret. - Turn on Enable Test Mode, pay an invoice and confirm the test payment on the SnapEX Pay page; the invoice should switch to Paid. Then turn test mode off.
Settings
| API key | From the SnapEX Pay cabinet → API keys, scopes invoices.read and invoices.write. |
|---|---|
| Webhook secret | The whsec_… secret of the webhook endpoint. Unsigned or wrongly signed webhooks are rejected. |
| Network fee paid by | merchant: the client pays the invoice amount. customer: the network fee is added on top. |
| Payment window, minutes | 1–1440, default 60. |
| USD per 1 unit of invoice currency | Ignored for USD invoices. For other currencies a fixed rate, or empty to use FOSSBilling's own currency rates (USD must exist under System → Currencies). |
| Enable Test Mode | FOSSBilling's own switch: on — SnapEX Pay test invoices, off — live invoices. |
Questions
Which FOSSBilling versions are supported?
FOSSBilling 0.8.x and the current development builds.
SnapexPay is not offered under New payment gateway.
Check the path library/Payment/Adapter/SnapexPay/SnapexPay.php (case-sensitive), relative to the folder with ipn.php, and that the web server can read the file.
The client paid but the invoice is still unpaid.
Open Invoices → Transactions. If there is no transaction, check the webhook deliveries in the SnapEX Pay cabinet and that the URL includes ?gateway_id=. After fixing the cause you can process the transaction again from the admin area.
A transaction says "partially paid", "already paid" or "total changed".
These are never credited automatically. Check the payment in the SnapEX Pay cabinet, then add funds or mark the invoice paid by hand.
Can several FOSSBilling sites use one SnapEX Pay account?
Yes. Each site only settles its own invoices.
Other integrations
Ready to accept crypto?
Create a merchant account, get an API key and connect the module. 1% per payment, no monthly fee.