Checkout redirects
3 min read
Once your customers are in an active checkout session, there are two destinations they can be redirected to.
These destinations are controlled by 2 parameters.
- Success url
- Where the customer is sent after after a successful checkout
- Cancel url
- Where the custoer goes after they cancel a checkout session
Default values
By default, the success_url and cancel_url are pre-populated for each of your payment links.
Success url
After a successful checkout, your customers will be redirected to the default PriceBlocs checkout success page.
The url for this page will include both:
- your PriceBlocs application subdomain
- the id of the recently completed checkout session
https://your-app.priceblocs.com/checkout/success?session_id=some_id_123
This page will render some important details for your customers:
- The details of the successfully completed transaction
- Customer support information to reach your business at
- A payment reference id for the purchase
- Subscription purchasees will see an invoice id
- One time purchases will see a payment reference id
Error url
By default, the cancel url will be your business url, which is set within your Stripe settings.
If you don't have a business url set in your Stripe account settings, the cancel_url
will default to the generic PriceBlocs error page, visible at:
https://your-app.priceblocs.com/checkout/error
Customization
Redirect url values can be updated via:
- Configuration
- Query string params
Configuration
- The values for redirect urls can be updated via configuration, when set:
- (1) On a payment link itself
- (2) Within the common PriceBlocs checkout settings
- (3) Within your Stripe business settings (i.e. updating the business url)
Query Strings
Redirect values can also be controlled through query string params.
Success url example
- Test here to see that you will be redirected to this page after a successful checkout.
https://priceblocs.com/test/links/_bLNfgxub3XDMr-y-thdR?success_url=https://priceblocs.com/docs/checkout/redirects
Cancel url example
- Test here to see that you will be redirected to this page after a canceled checkout.
https://priceblocs.com/test/links/_bLNfgxub3XDMr-y-thdR?cancel_url=https://priceblocs.com/docs/checkout/redirects
To see these query string customizations in action, the following test payment links can completed using these test payment details:
-- Test payment details to use --cc: 4242 4242 4242 4242cvc: 123mm/yy: any future date
Order of specificity
Redirect urls can be set in multiple places, but only one value will be used at checkout time.
Due to this, when there are multiple values present for the same redirect url value, they will be applied in a certain order, with the most specific value overriding the others.
The following are ordered in descending levels of override specificity (i.e. 1 overrides 2, 2 overrides 3 etc.)
Redirect urls set within:
- A payment link
- Query string params
- PriceBlocs checkout settings
- Stripe general business settings