Overview
Keep customers on your website throughout the payment flow. The embed option uses the mount method to display the checkout on any HTML element you desire - giving you complete control over where and how the payment form appears on your page.
See It in Action
Visit embedcheckout.payonify.com to see live demos for some of the embedded checkout possibilities.
Mount Examples
| Option | Description | Best For |
|---|---|---|
| Drop-In | Modal overlay appears when customer clicks pay | Quick checkout without leaving the page |
| Sidebar | Payment form displays next to your product | E-commerce product pages |
| Slide-In | Payment form slides in from the right | Mobile-friendly experiences |
How It Works
Quick Start
All embedded checkout options follow the same basic integration pattern:
-
Create a Checkout Session (Server-Side)
CodeResponse:
ResponsePass the
client_secretfrom the response above to your frontend. -
Add the Payonify SDK
CodeAvailable Library Formats
Format File Extension Best For UMD (recommended) .umd.jsBrowser script tags, universal compatibility ES Modules .esm.jsModern bundlers (Vite, Webpack 5+), tree-shaking CommonJS .jsNode.js, older build tools - UMD — Works in browsers and Node.js. Supports AMD, CommonJS, and global variables. Ideal for direct
<script>tag inclusion. - ES Modules — Modern JavaScript standard. Supports tree-shaking for smaller bundles. Recommended for new projects.
- CommonJS — Best for Node.js environments. Compatible with older build tools. Maximum compatibility.
Choosing the Right Format
- Web Development: Use UMD for direct script inclusion or ESM for modern bundlers
- Node.js Backend: Use CommonJS for server-side code
- Modern Projects: Prefer ESM for better tree-shaking and smaller bundles
- UMD — Works in browsers and Node.js. Supports AMD, CommonJS, and global variables. Ideal for direct
-
Initialize and Mount
The
mountmethod gives you complete flexibility to display the checkout on any HTML element in your page:Code -
Handle Webhooks (Server-Side)
Same as hosted checkout - use webhooks for reliable order fulfillment. See the Webhooks Guide.
Choose Your Display Option
Select the integration guide that best fits your UX:
- Drop-In Modal - Full HTML, CSS, and JavaScript for a modal overlay
- Sidebar - Full integration for a side-by-side layout
- Slide-In - Full integration for a slide-in panel
Next Steps
- Hosted Checkout - Simpler integration with redirect
- Webhooks Guide - Handle payment events reliably
- API Reference - Full checkout session parameters