Gateways overview
| Gateway | Name | Checkout | Refunds | Status polling | Saved cards | Provider subscriptions | Webhook setup |
|---|---|---|---|---|---|---|---|
| Monobank Acquiring | monobank | Hosted page (url) | ✓ | ✓ | ✓ | — | none |
| LiqPay | liqpay | Signed form → package page | ✓ | ✓ | ✓ | — | none |
| WayForPay | wayforpay | Hosted page (url) | — | ✓ | ✓ (always) | — | none |
| Hutko | hutko | Hosted page (url) | ✓ | ✓ | ✓ | — | none |
| Stripe | stripe | Hosted Checkout (url) | ✓ | ✓ | ✓ | ✓ | register once |
| Paddle | paddle | Paddle.js on your page | ✓ (with approval) | ✓ | — | ✓ | register once + dashboard |
| Fake | fake | Local two-button page | — | — | — | — | none, local/testing only |
All of them implement the health check.
Gateway metadata for a settings UI
Section titled “Gateway metadata for a settings UI”use Fomvasss\Billing\Facades\Billing;
Billing::gateways();// [// 'monobank' => [// 'key' => 'monobank',// 'label' => 'Monobank Acquiring',// 'currencies' => ['UAH', 'USD', 'EUR'],// 'credential_fields' => [['name' => 'token', 'type' => 'text', 'secret' => true, 'help' => '...'], ...],// 'webhook_url' => 'https://example.com/billing/webhooks/monobank',// 'webhook_requires_dashboard_setup' => false,// 'capabilities' => ['refunds' => true, 'subscriptions' => false, 'tokenization' => true, 'health' => true],// ],// ...// ]
Billing::gateway('monobank'); // one entry, or null when not registeredMonobankGateway::credentialFields(); // static — no credentials or instance neededcredential_fields entries: name (the config key), type (text/number), secret (mask it in a UI), help (where to get the value; Ukrainian in the built-in drivers). capabilities.subscriptions means provider-managed subscriptions — every gateway with tokenization supports package-managed ones.
Health check
Section titled “Health check”A live, side-effect-free probe — “do the credentials work and is the API up right now”:
Billing::health('monobank');// GatewayHealth { ok: true, message: 'My Shop LLC', latencyMs: 179.2 }php artisan billing:health # table of every configured health-capable gateway, exit 1 if any is downphp artisan billing:health monobank| Gateway | Probe | “Up” means |
|---|---|---|
| Monobank | GET /api/merchant/details | merchant name returned |
| LiqPay | status of a nonexistent order | err_code: payment_not_found |
| WayForPay | CHECK_STATUS of a nonexistent order | reasonCode 1127 (order not found) |
| Hutko | status/order_id of a nonexistent order | error_code 1018 |
| Stripe | GET /v1/balance | livemode: yes/no |
| Paddle | GET /event-types | live / sandbox |
| Fake | — | always up |
A probe never throws — a failure (including missing credentials) becomes ok: false with the reason.
Choosing a gateway per price
Section titled “Choosing a gateway per price”Price::$gateway pins a price to one gateway; null makes it generic. resolveChargeAmount() prefers a gateway-specific sibling in an accepted currency, then a generic one — see Money and currencies.
Adding a gateway
Section titled “Adding a gateway”Billing::extend('acmepay', AcmePayGateway::class) ->registerWebhook('acmepay', AcmePaySignatureValidator::class);See Writing a gateway.