Payments
Build a checkout around a payment created by FRL, then show payment options with FQL. Keep pricing, ownership checks and the action that fulfils an order in your rules.
Choose the flow
| What you need | Use |
|---|---|
| Exact prices and a currency selector | Currencies and prices. |
| A custom checkout action | An endpoint with access checks and a stable dedupe key. |
| A payment record | payment.create(options) in FRL. See Payment helpers. |
| The payment interface | Frontbacked.billing.showPaymentOptions(...). See Billing helpers. |
| Order fulfilment after confirmation | A payment confirmed event. See Payment events. |
| Stock or booking capacity | Reservations and atomic actions. |
| Local payment testing | The local simulator. |
Keep checkout trustworthy
Read the product, price and availability in FRL. Treat browser values as choices to validate, not authoritative prices or ownership. Use must(...) to reject a denied user or invalid quantity before creating a payment.
Give each deliberate checkout attempt a stable ID and use it in dedupe. Reuse it after a network failure so a retry can recover the existing result. Use a new attempt for a new purchase or after handling an expired payment. Read the current payment status rather than assuming a previously returned checkout response is still current.
Use FRL payment events for fulfilment. A page displaying a success message does not establish that a payment was confirmed. Payment metadata helps associate a payment with an order; it does not hold stock by itself.
Test before publishing
Run the full local flow with simulated payments. Check success, failure, expiry, repeated requests, access denial and any partial-payment handling your theme supports. Then test the payment options configured on a hosted preview. Choose wording such as “secure checkout” and “payment method” in your theme, and provide a clear action when the customer needs to retry or choose another option.