Page sections
EN
Hosting billing

Crypto payments for FOSSBilling

A payment adapter for FOSSBilling that lets clients pay invoices in USDT (TRC20, ERC20, BEP20, Solana, TON, Polygon and more) and other coins through SnapEX Pay. When a client chooses SnapEX Pay on an invoice, the adapter creates a SnapEX Pay invoice and shows a button to the payment page (or redirects there at once if FOSSBilling asks for it). Once the payment is confirmed, a signed webhook arrives at FOSSBilling's IPN URL, the client is credited and the invoice is marked paid.

Download the module GitHub

Free. Version 1.2.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 where the database supports it. 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.
  • Each FOSSBilling site settles only invoices it created; non-USD invoices are converted with a fixed rate or with FOSSBilling's own currency rates.
  • Coins: USDT (TRC20, ERC20, BEP20) on invoices of any amount; BTC, ETH, LTC and TRX also on smaller invoices when the network fee allows; other coins on invoices from $8.
  • On request: besides crypto, we can turn on payments in Russian rubles by QR code (Russia) and Alipay for your account. Write to us in the chat on this site.

Install

  1. From the archive copy SnapexPay.php into your FOSSBilling root so that it ends up at library/Payment/Adapter/SnapexPay/SnapexPay.php (folder and file names are case-sensitive) and make it readable by the web server user.
  2. In the admin area go to System → Payment gateways → New payment gateway and install SnapexPay.
  3. 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.
  4. Copy the IPN Callback URL shown on the gateway page (https://<your-fossbilling>/ipn.php?gateway_id=<id>), set it as the webhook URL in the SnapEX Pay cabinet (Developers), and paste the whsec_… secret (shown once, when the URL is first saved) into Webhook secret.
  5. 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 keyFrom the SnapEX Pay cabinet → API keys, scopes invoices.read and invoices.write.
Webhook secretThe whsec_… secret of the webhook endpoint. Unsigned or wrongly signed webhooks are rejected.
Network fee paid bymerchant: the client pays the invoice amount, and the fee is taken from what you receive. customer: the SnapEX Pay fee and the network fee are added on top.
Payment window, minutes1–1440, default 60.
USD per 1 unit of invoice currencyIgnored 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 ModeFOSSBilling's own switch: on — SnapEX Pay test invoices, off — live invoices.
Partner IDOptional: the Partner ID of the integrator who set the module up (SnapEX Pay referral program). Leave empty if you set it up yourself.
API URLLeave empty.

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?

Each site settles only its own invoices, but a SnapEX Pay account has one webhook URL, and the adapter confirms payments only through the webhook. So only the site whose IPN URL is set as the webhook gets payments confirmed automatically.

Ready to accept crypto?

Create a merchant account, get an API key and connect the module. 1% per payment, no monthly fee.

$200 giveaway

To a random member.

Subscribe @snapex_pay