Skip to content

The "Custom" Payment Gateway

The Custom gateway is intended for manual payment methods such as bank transfers, cash, checks, or any other offline workflow you handle yourself.

  1. Client selects "Custom" at checkout
  2. FOSSBilling displays your configured instructions
  3. Client follows the instructions to pay you
  4. You receive the payment
  5. You manually mark the invoice as paid in FOSSBilling

Go to Configuration → Payment gateways → Custom.

Two template fields:

  • Single payment information — For one-time payments
  • Subscription information — For recurring payments (if supported)

Both support Twig templates and HTML.

VariableTypeDescription
invoicearrayFull invoice data: total, currency, line items, buyer info
_client_idintID of the paying client
<div style="padding: 20px; border: 1px solid #ddd; border-radius: 8px;">
<h3>Bank Transfer Instructions</h3>
<p>Please transfer the following amount to our bank account:</p>
<ul>
<li><strong>Amount:</strong> {{ invoice.total }} {{ invoice.currency }}</li>
<li><strong>Reference:</strong> {{ invoice.serie_nr }}</li>
<li><strong>Bank:</strong> Example Bank</li>
<li><strong>IBAN:</strong> GB00 XXXX 0000 0000 0000 00</li>
<li><strong>BIC/SWIFT:</strong> EXAMPLEXX</li>
</ul>
<p>Your invoice will be marked as paid once we confirm the transfer (1-3 business days).</p>
</div>

Show different instructions based on invoice currency:

% if invoice.currency == 'EUR' %
<p>Transfer to: DE00 0000 0000 0000 0000 00</p>
% elseif invoice.currency == 'USD' %
<p>Transfer to: 1234567890 (Routing: 021000021)</p>
% else %
<p>Contact support for {{ invoice.currency }} payment instructions.</p>
% endif %

Wrap the above with the standard Twig delimiter characters ({ and }) when using in your template.

To see all available data in the invoice variable, temporarily enable debug mode and add this to your template:

<pre>
{{ dump(invoice) }}
</pre>

Remember to disable debug mode when you're done!

After receiving payment:

  1. Go to Invoicing → Invoices
  2. Find the invoice
  3. Click "Mark as paid"
  4. The system activates services and emails the client

The Custom adapter is at src/library/Payment/Adapter/Custom.php. It's a simple example of how payment adapters work.