<primer-payment-method>
Renders the appropriate payment interface for a specified type. Only displays if the method is configured in your Dashboard and available for this checkout.Quick Reference
| Parent | <primer-checkout> |
| Properties | type, disabled |
| Emits | None — subscribes to parent events (see Events) |
Examples
Multiple Methods
Disabled
Dynamic Rendering
Disable During Processing
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
type | type | string | — | Payment method identifier |
disabled | disabled | boolean | false | Disables interaction |
Events
<primer-payment-method> does not emit its own events. Payment outcomes are reported by the parent <primer-checkout> component.
Relevant Parent Events
| Event | Emitted by | How it affects this component |
|---|---|---|
primer:methods-update | <primer-checkout> | Determines whether this method renders — only methods in the collection are displayed |
primer:state-change | <primer-checkout> | Provides isProcessing to disable the method during payment |
primer:payment-success | <primer-checkout> | Indicates payment completed — includes paymentMethodType to identify which method was used |
primer:payment-failure | <primer-checkout> | Indicates payment failed — includes paymentMethodType |
Checking availability before rendering
Common Types
| Type | Description |
|---|---|
PAYMENT_CARD | Card form |
APPLE_PAY | Apple Pay button |
GOOGLE_PAY | Google Pay button |
PAYPAL | PayPal button |
KLARNA | Klarna |
ADYEN_BLIK | BLIK (Poland) |
Rendering Behavior
Renders only when all conditions are met:typeattribute is set- Method is enabled in Primer Dashboard
- Method is returned by server for this checkout
Configuration
Configure via SDK options on<primer-checkout>:
CSS Properties
CSS properties vary by payment method type. Each renders different internal components.Card Form (PAYMENT_CARD)
Uses Input Styling Tokens for input fields.Native Payment Buttons (APPLE_PAY, GOOGLE_PAY, PAYPAL)
| Property | Description | Default |
|---|---|---|
--primer-space-small | Gap between buttons | 8px |
--primer-space-medium | Button container padding | 12px |
Note: Apple Pay, Google Pay, and PayPal buttons use their native styling which cannot be customized via CSS properties. Button appearance is controlled through SDK options.
Alternative Payment Methods (KLARNA, ADYEN_BLIK, etc.)
| Property | Description | Default |
|---|---|---|
--primer-space-small | Internal spacing | 8px |
--primer-space-medium | Container padding | 12px |
--primer-radius-small | Border radius | 4px |
--primer-color-border-outlined-default | Container border | rgba(33, 33, 33, 0.14) |
--primer-color-background-outlined-default | Container background | white |
--primer-color-text-primary | Primary text color | #212121 |
--primer-color-text-secondary | Secondary text color | rgba(33, 33, 33, 0.62) |
--primer-animation-duration | Transition duration | 200ms |
States
| State | Description | Visual Change |
|---|---|---|
| Hidden | Method unavailable | Not rendered |
| Loading | Initializing method | Loading indicator |
| Ready | Ready for interaction | Standard appearance |
| Processing | Payment in progress | Loading state, disabled |
| Disabled | disabled attribute set | Muted appearance, no interaction |
Type-Specific States
Card Form (PAYMENT_CARD):- Inherits states from
<primer-card-form>
- Loading, Ready, Processing states managed by native SDKs
- May show additional states like category selection or code entry
Usage Guidelines
Do
- Use
primer:methods-updateto discover available methods - Disable all methods during processing
- Configure payment options on
<primer-checkout>
Don’t
- Don’t use alongside
<primer-card-form>forPAYMENT_CARD(causes duplicate) - Don’t assume a method is available — check
primer:methods-update
Content Guidelines
Section headings
| Do | Don’t |
|---|---|
| ”Pay with card" | "PAYMENT_CARD” (internal type name) |
| “Other payment methods" | "APMs” (jargon) |
| Use sentence case | Use title case or all caps |
Unavailable method messaging
| Do | Don’t |
|---|---|
| Render nothing (default behavior) | “This payment method is unavailable” |
| Show only available methods | Show disabled/grayed-out unavailable methods |
Related
- primer-payment-method-container — Declarative filtering
- SDK Options Reference — Payment method options
- Available Payment Methods — Full list