For the complete documentation index, see llms.txt. This page is also available as Markdown.

Payment Flow / Lifecycle

Learn how the payment flow / lifecycle works with Stripe

When you use the Stripe payment provider it makes use of the Stripe Checkout features.

The flow / lifecycle works like this:

  1. The customer browses the website and adds a product to the Basket. The price and currency are read from the product on the server

  2. Customer views their basket and initiates the Checkout process

  3. UmbCheckout prices every line again from the published products. If anything changed, the customer goes back to the Basket page to see the change (see Prices, Currencies and Baskets)

  4. UmbCheckout converts the Basket for Stripe and sends this over via the Stripe API, then records the checkout session's ID on the Basket

  5. The Stripe API returns a unique payment URL

  6. The customer is redirected to the Hosted Stripe payment page

  7. On payment success, the Customer is returned to the payment success page, or on payment failure / cancel the Customer is returned to the payment canceled page

  8. After the transaction, a webhook sends the response and triggers a Notification

When the Basket is cleared

A paid Basket is cleared in one of two ways, whichever happens first:

  • The customer returns to the success page. The StripeResponseNotificationHandler clears the Basket that the checkout session paid for.

  • The customer doesn't return (for example they closed the tab, or paid by a delayed method such as Bacs Direct Debit). The webhook records the checkout session as paid when Stripe sends checkout.session.completed (paid) or checkout.session.async_payment_succeeded. The next time the customer's Basket is read, on any page and from whichever store it comes (session, cookie or database), it is cleared and OnPaidBasketClearedNotification is published (see Extending UmbCheckout).

A checkout session created by UmbCheckout 1.x has no Basket details. When the customer returns to the success page for one, the Basket that recorded that session is cleared. A Basket that didn't record a session is cleared only if the checkout session was created in the last 24 hours, so an old success link clears nothing.

An expired or unpaid checkout session never clears the Basket, so a customer who abandons the payment keeps their Basket. If the customer changes the Basket after starting checkout, and before the payment has been recorded, the Basket forgets the checkout session and is no longer cleared automatically. Once the payment has been recorded, the next read clears the Basket before any change is made.

Last updated