Documentation Index Fetch the complete documentation index at: https://primer.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
<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, disabledEmits None — subscribes to parent events (see Events )
Examples
Multiple Methods
< primer-checkout client-token = "your-token" >
< primer-main slot = "main" >
< div slot = "payments" >
< primer-payment-method type = "PAYMENT_CARD" ></ primer-payment-method >
< primer-payment-method type = "PAYPAL" ></ primer-payment-method >
< primer-payment-method type = "GOOGLE_PAY" ></ primer-payment-method >
</ div >
</ primer-main >
</ primer-checkout >
Disabled
< primer-payment-method type = "PAYPAL" disabled ></ primer-payment-method >
Dynamic Rendering
checkout . addEventListener ( 'primer:methods-update' , ( event ) => {
const methods = event . detail . toArray ();
const container = document . getElementById ( 'payment-methods' );
methods . forEach ( method => {
const el = document . createElement ( 'primer-payment-method' );
el . setAttribute ( 'type' , method . type );
container . appendChild ( el );
});
});
Disable During Processing
checkout . addEventListener ( 'primer:state-change' , ( event ) => {
document . querySelectorAll ( 'primer-payment-method' ). forEach ( pm => {
event . detail . isProcessing
? pm . setAttribute ( 'disabled' , '' )
: pm . removeAttribute ( 'disabled' );
});
});
Properties
Property Attribute Type Default Description typetypestring— Payment method identifier disableddisabledbooleanfalseDisables 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
const checkout = document . querySelector ( 'primer-checkout' );
checkout . addEventListener ( 'primer:methods-update' , ( event ) => {
const methods = event . detail . toArray ();
const available = methods . map ( m => m . type );
// Only render methods that are available for this checkout
available . forEach ( type => {
const el = document . createElement ( 'primer-payment-method' );
el . setAttribute ( 'type' , type );
document . getElementById ( 'methods' ). appendChild ( el );
});
});
Common Types
Type Description PAYMENT_CARDCard form APPLE_PAYApple Pay button GOOGLE_PAYGoogle Pay button PAYPALPayPal button KLARNAKlarna ADYEN_KLARNAKlarna via Adyen ADYEN_BLIKBLIK (Poland)
See Available Payment Methods for full list.
Rendering Behavior
Renders only when all conditions are met:
type attribute is set
Method is enabled in Primer Dashboard
Method is returned by server for this checkout
If unavailable, renders nothing (no error).
Configuration
Configure via SDK options on <primer-checkout>:
checkout . options = {
card: {
cardholderName: { required: true }
},
googlePay: {
buttonTheme: 'dark' ,
buttonType: 'buy'
}
};
CSS Properties
CSS properties vary by payment method type. Each renders different internal components.
Uses Input Styling Tokens for input fields.
Property Description Default --primer-space-smallGap between buttons 8px--primer-space-mediumButton 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-smallInternal spacing 8px--primer-space-mediumContainer padding 12px--primer-radius-smallBorder radius 4px--primer-color-border-outlined-defaultContainer border rgba(33, 33, 33, 0.14) --primer-color-background-outlined-defaultContainer background white --primer-color-text-primaryPrimary text color #212121 --primer-color-text-secondarySecondary text color rgba(33, 33, 33, 0.62) --primer-animation-durationTransition 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 setMuted appearance, no interaction
Type-Specific States
Card Form (PAYMENT_CARD):
Inherits states from <primer-card-form>
Native Buttons (APPLE_PAY, GOOGLE_PAY, PAYPAL):
Loading, Ready, Processing states managed by native SDKs
Alternative Methods (KLARNA, BLIK, etc.):
May show additional states like category selection or code entry
Usage Guidelines
Use primer:methods-update to discover available methods
Disable all methods during processing
Configure payment options on <primer-checkout>
Don’t
Don’t use alongside <primer-card-form> for PAYMENT_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
See also
primer-payment-method-container Declarative filtering
SDK options reference Payment method options
Available payment methods Full list of supported payment methods