Fully custom implementation
- Web
- Android
- iOS
For complete control, you can bypass Option B: Custom error element
<primer-main> entirely and provide your own implementation.Choose one error display approach:Option A: Built-in error containerEvents
When implementing a custom layout, you need to listen for events to manage checkout states. For comprehensive information on all available events, event payloads, and best practices, see the Events Guide.- Web
- Android
- iOS
Key events to listen for
Key events to listen for
primer:state-change- Fired when checkout state changesprimer:methods-update- Fired when available payment methods are loadedprimer:ready- Fired when the SDK is ready
Configuring payment methods
- Web
- Android
- iOS
When customizing the payment method layout, you can include specific payment methods:The Payment method filtering with
The This approach automatically filters available payment methods without requiring event listeners or manual state management. See the Payment Method Container SDK Reference documentation for complete usage guide.
This approach ensures you only display payment methods that are actually available.
type attribute specifies which payment method to display. If a payment method isn’t available in your Dashboard configuration, it simply won’t render.Payment method filtering with include, exclude and type
The primer-payment-method-container component provides a declarative way to organize payment methods:Dynamic rendering with events
You can also dynamically render payment methods by listening to theprimer:methods-update event:Example: Dynamic payment method rendering
Example: Dynamic payment method rendering
Avoiding duplicate card forms
- Web
- Android
- iOS
PAYMENT_CARD payment method in your layout.Filtering to avoid duplicate card forms
Filtering to avoid duplicate card forms
Important: If you’re using a custom card form, you should filter out the
PAYMENT_CARD type to avoid duplicate card forms:Best practices
See also
Error handling
Handle payment failures and display error messages
Events guide
Complete reference for all checkout events