Skip to main content
The @fossapay/checkout package contains separate server, browser, and React exports. Create payment resources on your server, then pass only the returned checkout URL or reference to the frontend.

Install

Fixed payment links are reusable. Payment links are immutable after creation, but they can be retrieved, listed, activated, or deactivated.

2. Create a one-time order checkout

Use a checkout session when one unique order should have its own reference and payment state.

3. Open checkout in the browser

paymentLink accepts either a complete checkout URL or a payment-link reference.

React

Presentation modes

modal is the default. Inline checkout requires container as an element or CSS selector.

Browser events

The hosted checkout can emit:
  • checkout.ready
  • checkout.success
  • checkout.failed
  • checkout.reversed
  • checkout.expired
  • checkout.closed
Use onReady, onSuccess, onFailure, onReversed, onExpired, onClose, or onEvent to update the interface. Browser events improve the customer experience but are not proof of settlement.
Confirm payment from your server or a verified FossaPay webhook before delivering goods, crediting value, or marking an order fulfilled.

Verify checkout webhooks

Pass the unmodified raw request body and the v2 signature to the server export.

Browser configuration

Troubleshooting

Checkout returns to the form after refresh

Create or retrieve the payment resource on your server and continue passing the same active checkout URL or reference until it reaches a terminal state. Do not create a new checkout during every frontend render.

The modal does not open

Confirm that openCheckout runs in a browser, the checkout URL is active, and popup or content-security policies allow the hosted checkout origin. Inline mode also requires an existing container.

A success event was received for another checkout

The SDK validates the event origin and payment-link identity. Your server must still reconcile the checkout ID or reference and verify the signed webhook before fulfillment.