How a payment slot id is built
A payment slot id is derived from the payment method’s name and id:- Take the method
name. - Remove accents and lowercase it.
- Replace every run of non-alphanumeric characters with
_. - Append the method
id.
{ id: "203", name: "Pay in Installments" }:
| Step | Value |
|---|---|
| Method name | Pay in Installments |
| Sanitized name | pay_in_installments |
| Method id | 203 |
| Slot id | payment_pay_in_installments_203_content |
Finding the method name and id
Thename and id come straight from the checkout session — you don’t need to look them up in your payment provider’s admin.
Read session.payment.availableMethods. Each entry is a payment method with an id and a name:
Creating a custom payment component
1. Build the component
The component receiveschildren — the method’s default content — and renders it, then adds your own content below. Keep the copy inline:
2. Add meta.json
Point the component at the slot id.meta.json only needs the slot plus the required identifiers:
slot must match the id you built from the method’s name and id.
3. Deploy
Deploy the component from Studio. Once the build succeeds, the component renders whenever that payment method is selected in the checkout. See Studio for the deploy flow.Styling
Style your component with a CSS module and the checkout’s CSS variables so it follows the active theme:Troubleshooting
The payment method doesn't appear in checkout
The payment method doesn't appear in checkout
The method is provided by your payment provider, not by the component. Confirm it’s enabled for your store and that any eligibility rules (order value, categories, region) are met.
The slot renders nothing
The slot renders nothing
The
slot in meta.json must exactly match the generated id. Re-derive it from the method’s name and id (payment_<sanitized_name>_<id>_content) and confirm the method id is correct.Styling looks off
Styling looks off
Make sure your CSS module is imported in the component and deployed alongside it. Use the checkout CSS variables for colors so it follows the active theme.
Testing before you deploy
Testing before you deploy
Run the dev server and open Studio to preview your component live in the checkout. Select the payment method to see your component render. See Studio.
Related
- Studio — preview and deploy components
- Slots — the slot system in general
- Components — how components work