# FOSSBilling

> Install the Mintage Pay gateway on FOSSBilling and test it with test money before going live.

Source: https://mintagepay.com/docs/integrations/fossbilling/ (last updated 2026-10-25)

Adds **Mintage Pay** as a payment gateway for FOSSBilling invoices. The client pays in USDC or USDT on the Mintage Pay
payment page, the money goes straight to your own wallet, and the invoice is marked **Paid** by itself when the payment
is final.

## What you need

- FOSSBilling 0.8 or later.
- File access to the FOSSBilling folder, and an admin who can manage payment gateways.
- FOSSBilling reachable on public **https**, so Mintage Pay can send it payment updates.
- Invoices in a currency Mintage Pay supports: USD, EUR, GBP, CAD, AUD, CHF, JPY, MXN, BRL, INR, SGD, AED, PLN, SEK, NOK,
  DKK, NZD, ZAR, TRY, KRW, HKD, NGN, ARS, PHP, IDR, VND, PKR, EGP, BDT, KES, GHS, TZS, COP, CLP, PEN, UYU, PYG, BOB, DOP,
  GTQ, CRC, THB, MYR, TWD, LKR, NPR, KZT, UAH, ILS, SAR, QAR, CZK, HUF, RON, ISK, XAF or XOF. A client in another
  currency sees a message asking them to choose another method. Clients always pay in US dollar stablecoins: a price in
  another currency is converted when the payment is started.
- A Mintage Pay account with at least one payout address set.

## Install

1. Download [mintagepay-fossbilling.zip](https://app.mintagepay.com/downloads/mintagepay-fossbilling.zip) and unpack
   it.
2. Copy its `library` folder into your FOSSBilling folder, merging it with the `library` folder already there. This
   must exist afterwards: `library/Payment/Adapter/MintagePay/MintagePay.php`.
3. In FOSSBilling, go to **System > Payment gateways**, open **New payment gateway** and install **MintagePay**.
4. In the Mintage Pay dashboard, open **Developers > API keys** and create a key. Copy it: it is shown only once.
5. In the same dashboard, open **Developers > Webhooks**, add an endpoint with this address and copy its signing secret:

   ```
   https://<your FOSSBilling address>/ipn.php?gateway_id=<the gateway's ID>
   ```

   The gateway's ID is the number in its edit link in **System > Payment gateways**.
6. Edit the gateway in FOSSBilling: paste the **API key** and the **Webhook signing secret**, tick **Enabled** and
   **Allow one time payments**, and save.

## Try it first with test money

1. Create a free account at [sandbox.mintagepay.com](https://sandbox.mintagepay.com), set a payout address, and create
   a key (it starts with `mp_test_`) and a webhook endpoint there.
2. Put the sandbox key and its webhook secret in the gateway, and save.
3. Create an invoice for a test client, for example 1.00 USD.
4. Open the invoice as the client, click the **Mintage Pay** tile, then **Pay Now**. You land on a payment page with a
   **Test mode** banner.
5. Pay with free test money: the payment page has a button to get some.
6. Within a minute or two the invoice is **Paid**, and **Invoices > Transactions** shows the payment as processed.
7. When you are happy, put your live key and the live endpoint's secret in the gateway.

## What you will see

| What happened | In FOSSBilling |
|---|---|
| The client paid in full | The invoice is **Paid**. The transaction note says "Paid with Mintage Pay" and the payment's reference. |
| Paid only in part, or not yet final | The invoice stays unpaid; the transaction shows the payment's status. |
| The invoice was edited after the client started paying | The transaction shows an error: the amount paid and the new total. Credit the client by hand. |
| The same payment update arrives twice | It is credited once. |
| An update that is not signed with your secret | Refused; nothing changes. |

## Good to know

- A second click on **Pay Now** reuses the same payment, so a client never pays twice by mistake.
- Each payment is tied to its FOSSBilling invoice by the invoice's own random reference, so a staging and a live
  FOSSBilling on one Mintage Pay key never mix up invoices.
- Refunds are made from the Mintage Pay dashboard; record them in FOSSBilling yourself.
- Subscriptions (automatic renewals) are not supported yet: renewal invoices are paid one by one.
