Embedded checkout places Ruba’s hosted payment experience in an iframe over your product. Start with an HTML trigger when you only need to open it; install the package when your application must control its lifecycle or react to events.
Choose the integration depth
Open checkout from HTML
Create a Checkout Link, copy its embed code, and place it on any page that accepts HTML:data-ruba-checkout and opens the URL inline. The trigger can use your own markup and styling; keep the attribute in place.
Initialize it in an application
Install the checkout package with your package manager:RubaEmbedCheckout.init() once after the application mounts. It attaches behavior to the same declarative triggers used by the HTML version.
Control an instance directly
create() opens checkout without a declarative trigger and resolves after the iframe is ready. Supply light or dark as the theme.
onLoaded instead of registering a later loaded listener. It cannot miss a checkout that finishes loading immediately.
Respond to the payment lifecycle
An instance emits three events:event.preventDefault() inside a listener only when your application will replace the corresponding default behavior.
Manage it in React
Keep the active instance in state, register events immediately after creation, and close it when the component unmounts.Close checkout from your code
Store the instance returned bycreate() and call close() when another application state must take priority. The normal close event still fires, so clear your reference in its listener.