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, for each of your payment links, the success_url and cancel_url are pre-populated with default values. Both values can be customized for your use case.

Success url

By default, after a successful checkout, your customers will be redirected to the standard PriceBlocs checkout success page.

The url for this page will include both:

  • your PriceBlocs application subdomain or account alias (depending on your account type)
  • 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
Example checkout success

If you choose to customize the success_url, you can use the session id appended to the url to fetch any checkout session information you need.

Cancel url

By default, the cancel url will be your business url, which is set within your Stripe account settings.

If you don't have a business url set in your Stripe account settings, the cancel_url will default to the standard 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 for the cancel url)

Query Strings

The cancel_url can be customized through query string params.

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/tutorial/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 4242
cvc: 123
mm/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:

  1. Query string params (cancel_url only)
  2. The payment link configuration
  3. PriceBlocs checkout settings
  4. Stripe general business settings
Have any questions or feedback?
Let us know in the chat.
Previous
Checkout
Next
Checkout