Skip to content

Accept crypto in FOSSBilling

The CoinsPay gateway lets your clients pay FOSSBilling invoices in USDT, BTC, ETH or any of 30+ coins. The payment goes to the client’s balance and pays the invoice, FOSSBilling activates or renews the order, and the money goes straight to your wallets.

FOSSBilling
0.8.0 and newer
PHP
8.3 and newer
Module
free, GPL 3.0

What the gateway gives you

  • Orders start on their own

    When the payment is confirmed, it goes to the client’s balance and pays the invoice, the way FOSSBilling pays invoices. Then FOSSBilling does what it does after any payment: activates or renews the order and emails the client. Nobody checks payments by hand.

  • Money lands in your wallets

    CoinsPay does not hold your revenue: every payment goes on to your wallets by the payout rule of your shop. Each network takes up to 5 addresses with shares, say 70% to you and 30% to a partner.

  • Prices stay in your currency

    The client pays what is left on the invoice, in its currency, less what the balance already holds. CoinsPay converts it at the current rate and holds the coin amount for 30 minutes while the client opens a wallet.

  • A key that cannot withdraw

    The gateway only needs a key with "Invoices only" access: it can create invoices and follow them, but it cannot move money.

Set up in five minutes

You need a CoinsPay account with a shop and access to the FOSSBilling admin area. No developer required.

  1. 01Install the moduleDownload the archive and unpack it into the root folder of FOSSBilling, the one with config.php. Then open Extensions, find CoinsPay and activate it.
  2. 02Add the gatewayUnder System → Payment Gateways → "New Payment Gateway" install Coinspay and give it the name clients will see. In the CoinsPay dashboard create a key with "Invoices only" access and paste it into "API key".
  3. 03Connect the webhookCopy the webhook address from the CoinsPay page under Extensions to the "Webhook" section of the dashboard, and the whsec_ signing secret into "Webhook secret" of the gateway.
  4. 04Save and checkThe CoinsPay page shows the name of your CoinsPay shop, the live mode and the last run of the cron. Send a test event from the dashboard, and the page notes it. Clients already see CoinsPay among the ways to pay an invoice.
The CoinsPay page in the FOSSBilling admin area: the webhook address, the invoice hooks, the cron, the shop in live mode and the test event

It handles the awkward cases too

Partial payments, changed or cancelled invoices, lost webhooks: the gateway adds exactly what came, and no payment is lost.

  • Underpayment

    If less arrives, the client can pay the rest on the same payment page. When the CoinsPay invoice expires, the part received goes to the client’s balance, and the next "Pay" asks only for the rest.

  • Each payment once

    The webhook, the return of the client and polling can arrive at the same moment, and the payment is still added once. FOSSBilling does not guard its payment callbacks against that itself.

  • The invoice changed

    Cancel or delete the invoice, change its amount or have it paid another way, and the gateway cancels the open CoinsPay invoice. The next "Pay" creates one for the new amount.

  • A cancelled invoice stays unpaid

    A payment for an invoice cancelled or deleted meanwhile goes to the client’s balance, and the invoice stays unpaid: FOSSBilling would otherwise mark it paid and activate its order. An overpayment stays on the balance too.

  • Add funds works

    A client can top up the balance with an "Add funds" invoice and pay it in crypto: the payment becomes the new balance.

  • No payment gets lost

    Webhooks are signed, and the gateway checks the signature. Even without webhooks, the gateway asks CoinsPay about open invoices on every run of the FOSSBilling cron, and when the client comes back from the payment page.

  • The client can pay the fee

    Turn these settings on and the CoinsPay fee and the network fee are added to the amount on the payment page. The invoice in FOSSBilling gets its own amount.

  • Everything on one page

    The CoinsPay page under Extensions shows the shop and the mode of the key, the webhook address, whether the test event came, whether the cron runs, and the payments worth a look, with links to their invoices.

  • Test mode

    With a cpk_test_ key, invoices are paid with a button on the payment page and no coins move. Only signed-in admins see the gateway, so real clients never notice it.

Installation

The module is one archive on GitHub, next to its source code. Unpack it into the root folder of FOSSBilling: it adds the module and the payment gateway.

API documentation
FOSSBilling
0.8.0 and newer, tested up to 0.8.9
PHP
8.3 and newer, as FOSSBilling 0.8 needs
Cron
the cron of FOSSBilling, every 5 minutes
License
GPL 3.0

Pay only when you get paid

  • First 10 days fee-free, on payouts up to $500
  • No monthly or setup fee
  • The fee can go on the buyer’s invoice
  • Network fees at cost, no markup

as low as0.3%of each payout, the rate depends on your volume

Connect your shopHow the fee works

Questions about the gateway

All questions
How much does the module cost?

The module is free. You only pay the CoinsPay fee on payouts: as low as 0.3%, going down as your turnover grows, with no monthly fee. For the first 10 days after your first payment, payouts up to $500 carry no fee.

Which coins can clients pay with?

More than 30 coins and tokens on TRON, Ethereum, BNB Smart Chain, Solana, Bitcoin and Litecoin: USDT, USDC, BTC, ETH, BNB, TRX, LTC, SOL and more. A gateway setting can limit the choice to stablecoins.

Does the order start right after the payment?

Yes. Once the payment pays the invoice, FOSSBilling activates or renews the order as after any payment, a hosting account for one, and emails the client.

Why does the payment go through the client’s balance?

That is how FOSSBilling pays invoices. It also keeps the money safe: a payment for an invoice that was cancelled meanwhile stays on the balance, and the client’s next invoice is paid from it.

Do I need a cron job?

FOSSBilling needs its cron anyway, and the gateway checks open invoices on every run, even when a webhook does not arrive. Without the cron, such a payment arrives when the client comes back from the payment page.

Which languages does the gateway speak?

English and Russian. The gateway follows the language picked in FOSSBilling, and the payment page opens in the language of the client.

What client data goes to CoinsPay?

The invoice number, the amount and currency, and the address to send the client back to after payment. Client names, emails, addresses and phone numbers are not sent.

Can I connect a staging copy of my FOSSBilling?

Yes, but give it a separate CoinsPay shop. A shop has one webhook address, so its events would reach only one of the two sites.

Start taking crypto today

Signing up takes a minute and setting up a shop about five more. Connecting is free.

FOSSBilling is an open-source project, and the FOSSBilling name and logo belong to it. CoinsPay is not affiliated with FOSSBilling, and the module is not sponsored or endorsed by it.