Open Modem Pay’s checkout in a pop-up on your page, and react to the result in JavaScript.
The pop-up lets customers pay without leaving your site. You open it with one function call and get told when the payment finishes or the customer closes it.
Just need a button? The pay button wraps this pop-up in a single HTML tag.
Add it to your page
<link rel="stylesheet" href="https://api.modempay.com/dist/main.css" /><script src="https://api.modempay.com/js/v1.js"></script><button type="button" onclick="pay()">Pay now</button><script> function pay() { const modal = ModemPayCheckout({ public_key: "pk_test_...", amount: 450, title: "Course payment", customer_email: "customer@example.com", metadata: { order_id: "1042" }, callback: (transaction) => { // The payment finished. Confirm it on your server before delivering. fetch("/orders/1042/confirm", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ transaction_id: transaction.id }), }); modal.close(); }, onClose: (cancelled) => { if (cancelled) console.log("Customer closed checkout without paying."); }, }); }</script>
This code runs in the browser, so it uses your public key. Never put your secret key here.
Options
Option
What it does
Example
public_key
Your public key. Required.
"pk_test_…"
amount
Amount to charge, in GMD. Required.
450
currency
Defaults to GMD.
"GMD"
payment_methods
Which kinds of method to offer.
"wallet,card"
title
Short title shown at checkout.
"Course payment"
description
Longer description.
"Access to premium content"
customer
An existing customer ID. Their saved payment methods are offered.
"7e1908bb-…"
customer_name, customer_email, customer_phone
Fill in checkout for the customer.
"Awa Jallow"
metadata
Your own data. Comes back on the transaction and webhook.
{ "order_id": "1042" }
return_url
Redirect here after payment, instead of calling callback.
"https://yoursite.com/thanks"
cancel_url
Redirect here on cancel, instead of calling onClose.
"https://yoursite.com/cart"
callback
Called with the transaction when the payment finishes.
(transaction) => {}
onClose
Called when the pop-up closes. cancelled is true if the customer didn’t pay.
(cancelled) => {}
Redirects or callbacks?
If you set return_url, the customer is redirected after paying and callback is not called.
If you set cancel_url, the customer is redirected on cancel and onClose is not called.
Use the callbacks to stay on the page, like a single-page app. Use the URLs for a classic “thank you” page.
callback fires as soon as the payment finishes, while the pop-up may still be open. Close it with modal.close() when you’re ready.
Confirm on your server
A browser callback can be faked. Before you deliver anything, check the payment on your server, either from the charge.succeededwebhook or by looking it up with your secret key.See a full example with a “verifying…” state: CodePen.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Modem Pay","description":"Accept mobile money and card payments, send payouts, and split revenue in The Gambia.","colors":{"primary":"#08a591","light":"#08a591","dark":"#08a591"},"logo":{"light":"https://mintcdn.com/modem/yM7VtPyYTpEqFm00/logo/logo.png?fit=max\u0026auto=format\u0026n=yM7VtPyYTpEqFm00\u0026q=85\u0026s=583edb50d45d5f0c7c7cfe8bed561521","dark":"https://mintcdn.com/modem/yM7VtPyYTpEqFm00/logo/logo.png?fit=max\u0026auto=format\u0026n=yM7VtPyYTpEqFm00\u0026q=85\u0026s=583edb50d45d5f0c7c7cfe8bed561521"},"favicon":"https://mintcdn.com/modem/yM7VtPyYTpEqFm00/favicon.png?fit=max\u0026auto=format\u0026n=yM7VtPyYTpEqFm00\u0026q=85\u0026s=7904dfabeae04746c6800ed6c3b3d49d","api":{"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["curl","python","javascript","php","go","java","ruby"],"prefill":false}},"navbar":{"links":[{"href":"https://docs.modempay.com/documentation/cli","label":"CLI"},{"href":"mailto:info@modempay.com","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://merchant.modempay.com"}},"footer":{"socials":{"linkedin":"https://linkedin.com/company/modempay"}},"contextual":{"options":["copy","chatgpt","claude","mcp","cursor"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"modem","hasAudioNarration":false,"actualSubdomain":"modem","customDomains":["docs.modempay.com"],"gitSource":{"type":"github","owner":"chibuike-okpara","repo":"documentation","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6af71e922856bcaabf06157c","clientVersion":"0.0.4205","searchFilterCounts":[{"language":"default","tag":"Guides","count":37},{"language":"default","tag":"Send money","count":7},{"language":"default","tag":"Get started","count":6},{"language":"default","tag":"Accept payments","count":6},{"language":"default","tag":"Payment intents","count":6},{"language":"default","tag":"Plugins and frameworks","count":6},{"language":"default","tag":"Billing","count":5},{"language":"default","tag":"Invoices","count":5},{"language":"default","tag":"API Reference","count":5},{"language":"default","tag":"Split payments","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":":not(pre)>code{font-size:0.925em!important;padding:0.12em 0.4em!important;border-radius:6px;word-break:break-word}.prose table,.prose table td,.prose table th{font-size:0.95rem}.prose table :not(pre)>code{font-size:0.9em!important}pre code{font-size:0.875rem!important;line-height:1.6}"}],"page":{"pagePath":"documentation/payments/modem-inline","slug":"/documentation/payments/modem-inline","pageMetadata":{"title":"Checkout pop-up","description":"Open Modem Pay's checkout in a pop-up on your page, and react to the result in JavaScript.","href":"/documentation/payments/modem-inline"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Open Modem Pay’s checkout in a pop-up on your page, and react to the result in JavaScript.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Table,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`The pop-up lets customers pay without leaving your site. You open it with one function call and get told when the payment finishes or the customer closes it.`}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Just need a button? The `,_jsx(_components.a,{href:`/documentation/payments/drop-in`,children:`pay button`}),` wraps this pop-up in a single HTML tag.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`add-it-to-your-page`,children:`Add it to your page`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`28`,language:`html`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`html`,children:_jsxs(_components.code,{language:`html`,numberOfLines:`28`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`link`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` rel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stylesheet\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` href`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.modempay.com/dist/main.css\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:` />`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`script`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` src`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.modempay.com/js/v1.js\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>\u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`script`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`button`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"button\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` onclick`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`pay`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`()\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`Pay now`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`button`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`script`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` pay`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` modal`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` ModemPayCheckout`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` public_key:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"pk_test_...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` amount:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 450`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` title:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Course payment\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` customer_email:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"customer@example.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` metadata:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`order_id:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"1042\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` callback`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`transaction`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // The payment finished. Confirm it on your server before delivering.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/orders/1042/confirm\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`transaction_id:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` transaction`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` modal`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`close`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` onClose`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`cancelled`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`cancelled`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Customer closed checkout without paying.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`script`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#808080`},children:`>`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`This code runs in the browser, so it uses your `,_jsx(_components.strong,{children:`public`}),` key. Never put your secret key here.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`options`,children:`Options`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Option`}),_jsx(_components.th,{children:`What it does`}),_jsx(_components.th,{children:`Example`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`public_key`})}),_jsx(_components.td,{children:`Your public key. Required.`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`\"pk_test_…\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`amount`})}),_jsx(_components.td,{children:`Amount to charge, in GMD. Required.`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`450`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`currency`})}),_jsxs(_components.td,{children:[`Defaults to `,_jsx(_components.code,{children:`GMD`}),`.`]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`\"GMD\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`payment_methods`})}),_jsx(_components.td,{children:`Which kinds of method to offer.`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`\"wallet,card\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`title`})}),_jsx(_components.td,{children:`Short title shown at checkout.`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`\"Course payment\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`description`})}),_jsx(_components.td,{children:`Longer description.`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`\"Access to premium content\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`customer`})}),_jsxs(_components.td,{children:[`An existing `,_jsx(_components.a,{href:`/documentation/core/customers`,children:`customer`}),` ID. Their saved payment methods are offered.`]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`\"7e1908bb-…\"`})})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`customer_name`}),`, `,_jsx(_components.code,{children:`customer_email`}),`, `,_jsx(_components.code,{children:`customer_phone`})]}),_jsx(_components.td,{children:`Fill in checkout for the customer.`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`\"Awa Jallow\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`metadata`})}),_jsx(_components.td,{children:`Your own data. Comes back on the transaction and webhook.`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`{ \"order_id\": \"1042\" }`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`return_url`})}),_jsxs(_components.td,{children:[`Redirect here after payment, instead of calling `,_jsx(_components.code,{children:`callback`}),`.`]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`\"https://yoursite.com/thanks\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`cancel_url`})}),_jsxs(_components.td,{children:[`Redirect here on cancel, instead of calling `,_jsx(_components.code,{children:`onClose`}),`.`]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`\"https://yoursite.com/cart\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`callback`})}),_jsx(_components.td,{children:`Called with the transaction when the payment finishes.`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`(transaction) => {}`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`onClose`})}),_jsxs(_components.td,{children:[`Called when the pop-up closes. `,_jsx(_components.code,{children:`cancelled`}),` is `,_jsx(_components.code,{children:`true`}),` if the customer didn’t pay.`]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`(cancelled) => {}`})})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`redirects-or-callbacks`,children:`Redirects or callbacks?`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`If you set `,_jsx(_components.code,{children:`return_url`}),`, the customer is redirected after paying and `,_jsx(_components.code,{children:`callback`}),` is `,_jsx(_components.strong,{children:`not`}),` called.`]}),`\n`,_jsxs(_components.li,{children:[`If you set `,_jsx(_components.code,{children:`cancel_url`}),`, the customer is redirected on cancel and `,_jsx(_components.code,{children:`onClose`}),` is `,_jsx(_components.strong,{children:`not`}),` called.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Use the callbacks to stay on the page, like a single-page app. Use the URLs for a classic “thank you” page.`}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`callback`}),` fires as soon as the payment finishes, while the pop-up may still be open. Close it with `,_jsx(_components.code,{children:`modal.close()`}),` when you’re ready.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`confirm-on-your-server`,children:`Confirm on your server`}),`\n`,_jsxs(_components.p,{children:[`A browser callback can be faked. Before you deliver anything, check the payment on your server, either from the `,_jsx(_components.code,{children:`charge.succeeded`}),` `,_jsx(_components.a,{href:`/documentation/core/webhooks`,children:`webhook`}),` or by `,_jsx(_components.a,{href:`/documentation/core/transactions#get-a-transaction`,children:`looking it up`}),` with your secret key.`]}),`\n`,_jsxs(_components.p,{children:[`See a full example with a “verifying…” state: `,_jsx(_components.a,{href:`https://codepen.io/mercury-sms/embed/EaYNGOv?default-tab=html%2Cresult`,children:`CodePen`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Checkout pop-up","description":"Open Modem Pay's checkout in a pop-up on your page, and react to the result in JavaScript.","href":"/documentation/payments/modem-inline"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Add it to your page","slug":"add-it-to-your-page","depth":2,"children":[]},{"title":"Options","slug":"options","depth":2,"children":[]},{"title":"Redirects or callbacks?","slug":"redirects-or-callbacks","depth":2,"children":[]},{"title":"Confirm on your server","slug":"confirm-on-your-server","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"modem","siteName":"Modem Pay","title":"Checkout pop-up - Modem Pay","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-13T14:06:29.602Z","originalFileLocation":"documentation/payments/modem-inline.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Open Modem Pay\u0026#x27;s checkout in a pop-up on your page, and react to the result in JavaScript.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Modem Pay\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/modem/9S6xKPPgd1tjvN3Y/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/modem/9S6xKPPgd1tjvN3Y/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/modem/9S6xKPPgd1tjvN3Y/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/modem/9S6xKPPgd1tjvN3Y/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/modem/9S6xKPPgd1tjvN3Y/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/modem/9S6xKPPgd1tjvN3Y/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/modem/9S6xKPPgd1tjvN3Y/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/modem/9S6xKPPgd1tjvN3Y/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/modem/9S6xKPPgd1tjvN3Y/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Checkout pop-up - Modem Pay\">\u003cmeta data-mint-head property=\"og:description\" content=\"Open Modem Pay\u0026#x27;s checkout in a pop-up on your page, and react to the result in JavaScript.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Modem Pay\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.modempay.com/documentation/payments/modem-inline\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://modem.mintlify.site/_mintlify/api/og/v2?division=Accept+payments\u0026amp;title=Checkout+pop-up\u0026amp;description=Open+Modem+Pay%27s+checkout+in+a+pop-up+on+your+page%2C+and+react+to+the+result+in+JavaScript.\u0026amp;theme=8b63399a521ea05c9a774dec\u0026amp;signature=f6a13b80e49600977c4bd1feb99afff83de3a50557a94d2547d8569b3856d435\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Checkout pop-up - Modem Pay\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Open Modem Pay\u0026#x27;s checkout in a pop-up on your page, and react to the result in JavaScript.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://modem.mintlify.site/_mintlify/api/og/v2?division=Accept+payments\u0026amp;title=Checkout+pop-up\u0026amp;description=Open+Modem+Pay%27s+checkout+in+a+pop-up+on+your+page%2C+and+react+to+the+result+in+JavaScript.\u0026amp;theme=8b63399a521ea05c9a774dec\u0026amp;signature=f6a13b80e49600977c4bd1feb99afff83de3a50557a94d2547d8569b3856d435\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/modem/9S6xKPPgd1tjvN3Y/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Modem Pay\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#08a591\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.modempay.com/documentation/payments/modem-inline\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/documentation/payments/modem-inline.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.modempay.com/#organization\",\"name\":\"Modem Pay\",\"url\":\"https://docs.modempay.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/modem/yM7VtPyYTpEqFm00/logo/logo.png?fit=max\u0026auto=format\u0026n=yM7VtPyYTpEqFm00\u0026q=85\u0026s=583edb50d45d5f0c7c7cfe8bed561521\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.modempay.com#website\",\"name\":\"Modem Pay\",\"url\":\"https://docs.modempay.com\",\"publisher\":{\"@id\":\"https://docs.modempay.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.modempay.com/documentation/payments/modem-inline#webpage\",\"url\":\"https://docs.modempay.com/documentation/payments/modem-inline\",\"name\":\"Checkout pop-up\",\"description\":\"Open Modem Pay's checkout in a pop-up on your page, and react to the result in JavaScript.\",\"dateModified\":\"2026-11-13T14:06:29.602Z\",\"isPartOf\":{\"@id\":\"https://docs.modempay.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.modempay.com/documentation/payments/modem-inline#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.modempay.com/documentation/payments/modem-inline#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accept payments\",\"item\":\"https://docs.modempay.com/documentation/payments/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Checkout pop-up\",\"item\":\"https://docs.modempay.com/documentation/payments/modem-inline\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.modempay.com/documentation/payments/modem-inline#article\",\"headline\":\"Checkout pop-up\",\"name\":\"Checkout pop-up\",\"description\":\"Open Modem Pay's checkout in a pop-up on your page, and react to the result in JavaScript.\",\"url\":\"https://docs.modempay.com/documentation/payments/modem-inline\",\"mainEntityOfPage\":{\"@id\":\"https://docs.modempay.com/documentation/payments/modem-inline#webpage\"},\"dateModified\":\"2026-11-13T14:06:29.602Z\",\"publisher\":{\"@id\":\"https://docs.modempay.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.modempay.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Modem Pay\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Modem Pay\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/documentation/payments/modem-inline.md","siteName":"Modem Pay","nav":{"global":{"anchors":[]},"tabs":[{"tab":"Guides","groups":[{"group":"Get started","pages":[{"title":"Modem Pay documentation","sidebarTitle":"Introduction","href":"/documentation/introduction"},{"title":"Quickstart","href":"/documentation/quickstart"},{"title":"SDKs and libraries","sidebarTitle":"SDKs","href":"/documentation/installation"},{"title":"API keys","href":"/documentation/authentication"},{"title":"Test mode and going live","sidebarTitle":"Test mode and going live","href":"/documentation/test-mode"},{"title":"Errors","href":"/documentation/errors"}]},{"group":"Developer tools","pages":[{"title":"Modem Pay CLI","href":"/documentation/cli"}]},{"group":"Accept payments","pages":[{"title":"Choose an integration","href":"/documentation/payments/overview"},{"title":"Payment links","href":"/documentation/core/payment-links"},{"title":"Pay button","description":"One HTML tag adds a Modem Pay button to any page. No build step, no framework.","href":"/documentation/payments/drop-in"},{"title":"Checkout pop-up","href":"/documentation/payments/modem-inline"},{"title":"HTML Checkout","description":"Accept payments with a plain HTML form. No backend, no JavaScript.","href":"/documentation/payments/html-checkout"},{"title":"Your own checkout","href":"/documentation/payments/custom"}]},{"group":"Payment intents","pages":[{"title":"Payment intents","sidebarTitle":"Overview","href":"/documentation/payment-intents/overview"},{"title":"Create a payment intent","sidebarTitle":"Create","href":"/documentation/payment-intents/create"},{"title":"Direct charge","href":"/documentation/payment-intents/direct-charge"},{"title":"Check, list and cancel","href":"/documentation/payment-intents/management"},{"title":"Callback URL","href":"/documentation/payment-intents/callback_url"},{"title":"Refunds","href":"/documentation/payment-intents/refund"}]},{"group":"Customers and discounts","pages":[{"title":"Customers","href":"/documentation/core/customers"},{"title":"Mandates","href":"/documentation/core/mandates"},{"title":"Coupons","href":"/documentation/core/coupons"}]},{"group":"Send money","pages":[{"title":"Payouts","sidebarTitle":"Overview","href":"/documentation/payouts/overview"},{"title":"Send a mobile money payout","sidebarTitle":"Mobile money","href":"/documentation/payouts/mobile-money"},{"title":"Bulk payouts","sidebarTitle":"Bulk payouts","href":"/documentation/payouts/bulk-payout"},{"title":"Payout fees","sidebarTitle":"Fees","href":"/documentation/payouts/fees"},{"title":"Daily limits and queued payouts","sidebarTitle":"Daily limits","href":"/documentation/payouts/daily-limits"},{"title":"Payout channels","sidebarTitle":"Payout channels","href":"/documentation/payouts/payout-channels"},{"title":"Reverse a payout","href":"/documentation/payouts/reversals"}]},{"group":"Split payments","pages":[{"title":"Split payments","sidebarTitle":"Overview","href":"/documentation/split-payments/overview"},{"title":"Sub-accounts","href":"/documentation/split-payments/sub-accounts"},{"title":"Sub-account groups","href":"/documentation/split-payments/sub-account-groups"},{"title":"Split a payment","href":"/documentation/split-payments/initialize-payment"}]},{"group":"In person","pages":[{"title":"Virtual terminals","href":"/documentation/virtual-terminal"}]},{"group":"Your money","pages":[{"title":"Balances","href":"/documentation/core/balances"},{"title":"Transactions","href":"/documentation/core/transactions"}]},{"group":"Webhooks","pages":[{"title":"Webhooks","href":"/documentation/core/webhooks"}]}]},{"tab":"Billing","pages":[{"title":"Billing","href":"/billing/invoices/introduction"}]},{"tab":"Plugins and frameworks","pages":[{"title":"Plugins and frameworks","href":"/laravel/quickstart"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/create-a-payment-intent"}]}]},"basePath":"","title":"Checkout pop-up - Modem Pay","deploymentId":"dpl_FZMKUpaaKiVETbfqhoUe4sPFDTmY","buildId":"dpl_FZMKUpaaKiVETbfqhoUe4sPFDTmY","dynamics":[],"chunks":[]}