Payment setting stripes
The payment setting stripe object and the allowed CRUD operations on the related resource endpoint
Stripe payment settings are the Stripe-specific subtype of payment settings. They hold the credentials and configuration required to process payments through the Stripe payment gateway.
Credentials
Setting up a Stripe payment setting requires the following credential attributes:
api_key
Stripe secret API key for server-side requests.
public_key
Stripe publishable key for client-side SDK usage.
connected_account
Stripe Connect account ID for marketplace scenarios.
webhook_endpoint_id
ID of the automatically created Stripe webhook endpoint.
webhook_endpoint_secret
Signing secret used to verify incoming Stripe webhook events.
Gateway versions
Stripe payment settings support the following gateway versions, corresponding to Stripe's API version:
2019-05-162025-11-17.clover(default)
Capabilities
Stripe payment settings support the following Commerce Layer features:
Payment sessions
Payment wallets
Payment links
3DS / SCA
Client-side integration
Stripe requires payment details to be collected and the payment intent confirmed client-side using Stripe.js and Elements (or the mobile SDKs). Commerce Layer creates the payment intent server-side when a payment session is created with a Stripe payment setting. The client_secret needed to initialize Elements and confirm the payment intent is available in the response_data attribute of the payment session. Once the customer completes the form, including any 3DS/SCA challenge, payment details must be submitted back (more details here).
Wallet vaulting
When a payment wallet is created against a Stripe payment setting without a customer_token supplied, Commerce Layer creates a customer profile on Stripe and stores its ID as the wallet's customer token. Either way — auto-created or supplied by you — Commerce Layer attaches the payment method to that customer as part of the same vaulting request. It only fails if the payment method is already attached to a different Stripe customer.
Vaulting during a payment
When a payment session has vaulting enabled, Commerce Layer asks Stripe to store the payment method with the payment intent, and creates the wallet from it once the payment succeeds. The setup_future_usage value sent to Stripe depends on whether the order has line items with a frequency:
Storing a new card — no line item with a frequency.
on_session — the card is reused on later orders, with the shopper present.
Storing a new card — at least one line item with a frequency.
off_session — the card is set up for the renewals charged without the shopper.
Paying with a wallet — at least one line item with a frequency.
off_session — the saved card is set up for the renewals that follow.
Paying with a wallet — no line item with a frequency.
Not sent.
Renewing an order subscription.
Not sent — the payment intent is confirmed off session.
Duplicate wallets
Stripe issues a new payment method every time a card is collected, even when it's the same card of the same customer. Commerce Layer deduplicates wallets by payment method only, so every payment session with vaulting enabled — and every wallet created directly with a newly collected payment method — produces a new wallet for that card.
Webhook management
When a Stripe payment setting is created, Commerce Layer automatically registers a webhook endpoint with Stripe and stores the resulting webhook_endpoint_id and webhook_endpoint_secret. If the request fails — e.g. because the API key lacks the necessary permissions — the payment setting is still created, but stays in the pending status until the webhook is provisioned (more details here). The webhook endpoint is removed from Stripe when the payment setting is deleted.
Webhook events
Commerce Layer listens to the following Stripe webhook notification events:
payment_intent.amount_capturable_updated
Creates or updates a payment authorization — succeeded.
payment_intent.payment_failed
Creates or updates a payment authorization — failed.
payment_intent.canceled
Creates or updates a payment void — succeeded.
payment_intent.succeeded
Creates or updates a payment capture — succeeded.
charge.expired
Transitions the payment authorization to expired.
charge.refunded
Creates or updates a payment refund — succeeded.
setup_intent.requires_action
Transitions a payment wallet to requires_action.
setup_intent.canceled
Transitions a payment wallet to canceled.
setup_intent.succeeded / payment_method.updated
Transitions a payment wallet to succeeded.
checkout.session.expired
Transitions a payment link to expired.
checkout.session.completed
Transitions a payment link to completed and creates the associated payment session.
Session events are matched using the payment_intent ID, and link events using the checkout session ID. Wallet events are matched using the setup intent ID, except payment_method.updated, which is matched using the Stripe payment method ID instead. Missing transactions are created automatically when an event arrives.
Last updated