Because you render the subtitle yourself, the component can’t read its size; it’s a sibling in your DOM, and CSS can’t inherit sideways. To make the expanded content match your subtitle, set
font-size on the group to the same value: resurs-payment-method-group { font-size: 14px; }. See Font size.Fetch payment method groups
- Frontend (JS API)
- Backend (REST API)
flattened parameter is optional. When true, every payment method is returned as its own group with a single entry in methodIds. When false or omitted, related payment methods may be grouped together (e.g. part-payment options bundled into one group).
Response shape:
Interactive example
Render the components
active: toggling it only switches between the expanded and collapsed views under the header you built.
Props
Controlled component pattern
This component is fully controlled and never mutates its own props. When the user interacts with the component (for example, by selecting an installment option), it fires aresursPaymentMethodSelected event. To update the UI, pass the id from that event back to the component via the selected-id prop.
When active is false, the group renders a collapsed view instead of being hidden. This view displays payment method copy, which may include legally required content such as representative examples. If a payment method has no collapsed copy, nothing is rendered and no space is reserved.
Changing active to true expands the group and fires the initial resursPaymentMethodSelected event described below.
When active becomes true, the component fires an initial resursPaymentMethodSelected event with the default selection. Always handle this event. The id is what you pass to the Merchant API when creating a payment.
Payment method icon
<resurs-payment-method-icon> renders the brand icon for a given payment method. Pass a payment method type via the type attribute and the component displays the corresponding logo.
string
Payment method type, from
type in the payment methods group response. If an unsupported type is passed, a warning is logged to the console and no icon is rendered.Resurs payment methods
Third-party payment methods
Example
Styling
The<resurs-payment-method-icon> component renders SVG logos and can be styled with standard CSS. The SVG scales proportionally, so setting one dimension (e.g. height) and leaving the other as auto keeps the aspect ratio.
Custom sizing via inline style
Custom sizing via CSS
Badge-style