Skip to main content
With the embedded checkout, the Roqqett JavaScript library opens a checkout session in a pop-up window over your page, and tells your page when the payment is complete. The payer never leaves your site. On a desktop computer, the pop-up offers a QR code or a link by text message, so the payer can finish on their phone. The embedded checkout uses the same checkout session as the hosted checkout. Only the way you send the payer to its checkoutUrl is different.

Before you begin

Complete Set up Roqqett. You need the ID of an active SHOPPING checkout.

How it works

1

Load the library

Your payment page loads the library and creates a Roqqett instance.
2

The payer clicks your Roqqett button

You call checkout() with a promise of the session’s checkoutUrl. The library opens the pop-up at once, with a holding page.
3

Your server creates a checkout session

Your server creates the session and returns its checkoutUrl. The pop-up then shows the payment.
4

The payer pays

The payer approves the payment at their bank, in the pop-up or on their phone.
5

Roqqett tells you the outcome

The library calls your callbacks in the browser. Your server confirms the session’s status before you fulfil the order.

Step 1: Load the library

Add the script to your payment page, and create the Roqqett instance once the page has loaded.
Roqqett() takes no arguments. You pass your callbacks to checkout().

Step 2: Add a Roqqett button

Add a button to your payment page for the payer to choose Roqqett, for example:
Match the size and corner radius of your other payment buttons. Roqqett button artwork is in the Roqqett button pack.

Step 3: Start the checkout

Call checkout() from your button’s click handler, before any await. Browsers block pop-ups that don’t open straight from a click, so pass checkoutUrl as a promise: the library opens the pop-up at once, and loads the session when the promise resolves.
If you already have the checkoutUrl when the payer clicks, you can pass it as a string instead. checkout(callbacks, { checkoutUrl, isApp }) takes: The returned promise resolves with { checkoutSessionId } once the pop-up is connected to the session. It rejects when the checkout can’t start, with an Error whose reason is one of the failure reasons. If the payer clicks again while the pop-up is open, the library brings the pop-up to the front. For the same checkoutUrl, checkout() returns the same promise. For a different one, it refuses with CHECKOUT_IN_PROGRESS.

Callbacks

Each callback is optional, and gets an event with:
  • checkoutSessionId: the session.
  • status: completed, pending, cancelled, failed or expired.
  • final: true when the session has ended and the pop-up has closed.
  • returnUrl: the session’s returnUrl.
  • reason: only when the checkout couldn’t start or was ended by the library.
The library only sends the payer to an https return URL. Roqqett doesn’t add query parameters to it, so put your own order reference in each session’s returnUrl. A callback doesn’t prove the payer paid. Before you fulfil the order, confirm the session’s status on your server.

Failure reasons

Step 4: Create the checkout session

Your server creates the checkout session exactly as for the hosted checkout, and returns its checkoutUrl to your page. See Create a checkout session. Create a new session for each attempt to pay, with its own idempotencyKey. To stop a session from being paid, for example when the payer chooses another payment method, cancel it.

Mobile apps

If your page runs inside your own mobile app’s web view, pass isApp: true:
The library then opens the checkout in a new window, which an app shell normally hands to the phone’s browser, and doesn’t dim your page. Your callbacks are still called in the app when the payment ends.

Test your integration

V2 checkout sessions have no test mode, and there is no Roqqett sandbox yet. Take a few small real payments, confirm that they reach your settlement account, then refund them. Check the pop-up, the QR code to a phone, and your page’s handling of each callback.