Checkout session

Cart payment sessions

Overview

In Roqqett, a cart is the technical construct used to wrap the payment flow and should be created when a payment is needed.

A cart payment session is initiated by a merchant and completes when:

  • the customer authorises and completes a payment
  • the customer cancel a payment
  • the customer abandons a payment
info

By default, a cart session by expires after 20 mins but a merchant can provide their own expiry time via the /carts endpoint.

If the cart session completes successfully, then an order with an embedded payment will be created and made visible in the Roqqett portal. Learn more about the portal.

If the session completes unsuccessfully, then the order and payment will not be created, i.e., Roqqett are not reporting on unsuccessful carts in the Roqqett portal.

Within a cart session, there may be many payment attempts. This means that your consumers can easily retry payments as many times as they like - without restarting - and the cart session will only complete when with they have successfully paid.

It's good to understand the relationship between cart sessions and payments so you can leverage and optimise your cart sessions as much as possible.

Test carts

Cart functionality and different payment outcomes may also be tested using the test mode operation provided by carts.

Start by ensuring that test carts can be processed by the Checkout. To do so, go to the Roqqett portal and check that the Checkoust instance has the Test mode property set to true. Non-test mode carts will still be possible with Checkout instances that have test mode set to true.

When initiating the creation of a cart at the /carts endpoint, pass the HTTP body value testMode = true in order to enable test mode for the resultant cart.

When following the authorisation link to pay this cart, the authenticating user will be presented with a Roqqett screen. They can choose form the following payment outcomes: Paid, Cancelled, Failed, or Abandoned.

Once the desired outcome is selected, the payment journey will progress to that state. If Paid was selected, the order complete webhook will be dispatched to your configured endpoint.

Test payments will be marked as such when viewed in the Roqqett portal's Payments screen.

Key callouts

  • Payment attempts are unlimited. The payment process is repeatable by design within a cart session.
  • Cart sessions do not fail. Unsuccessful cart sessions do not fail. They are either cancelled or abandoned.