Skip to main content
Log payment errors with diagnostic information to help debug issues and work with Primer support.

Recipe

How it works

  1. Listen for the primer:ready event to access the Primer SDK instance
  2. Set the onPaymentFailure callback
  3. Log the error details including diagnosticsId which helps Primer support investigate issues
The diagnosticsId is a unique identifier for the error. When contacting Primer support, always include this ID to help them quickly locate and diagnose the issue.

Variations

Send errors to logging service

Custom error display

Inline error handling

See also

Track payment in analytics

Send payment events to your analytics platform

Error handling

Handle payment failures and display error messages