Skip to main content
The payment-method embed keeps card collection inside Ruba while your product controls where and when the UI appears.

Getting a session token

Create a customer session on the server, where the organization access token remains private. Send only its one-hour, customer-scoped token to the browser.
Server

Build sequence

Open a modal

Browser

Mount inline

Browser
React applications can render the frame directly:
React

Initialize from HTML

Localization

Pass a BCP 47 value such as fr-FR through locale. The setting applies to both embed copy and Stripe Elements. See checkout localization for supported languages.

Events

Every signal is a cancelable CustomEvent on the embed instance.

Redirect-based payment methods

Amazon Pay, Klarna, and other off-site authorization methods navigate the complete tab to the provider and back to returnUrl. Read the returned status once the page loads again:
Browser
React can use usePaymentMethodRedirectResult. Both routes remove the status query parameter after reading it, preventing a refresh from replaying an old result. Card 3DS stays inside the modal and does not use this return path.

Configure behavior

HTML triggers use the same settings through data-ruba-payment-method-theme, data-ruba-payment-method-set-as-default, data-ruba-payment-method-return-url, and data-ruba-payment-method-locale.