Skip to main content
Display a personalized success message or modal to users after their payment completes.

Recipe

How it works

  1. Listen for the primer:ready event to access the Primer SDK instance
  2. Set the onPaymentSuccess callback
  3. Access payment details and paymentMethodType from the callback parameters
  4. Display your custom UI (modal, toast, inline message, etc.)

Variations

Custom success with payment details

Handle checkout dismissal

See also

Redirect after payment

Navigate to a confirmation page after payment

Error handling

Handle payment failures and display error messages