Skip to main content
Redirect users to a confirmation or thank you page after a successful payment.

Recipe

How it works

  1. Listen for the primer:payment-success event on the checkout element
  2. Extract the payment object from event.detail
  3. Use window.location.href to redirect to your confirmation page
  4. Pass the orderId as a query parameter so your confirmation page can display order details

Variations

Redirect with payment ID

Redirect to different pages based on payment method

See also

Show custom success message

Display a branded success state after payment

Track payment in analytics

Send payment events to your analytics platform