The checkout address is always:
https://app.myrocketramp.com/embed/<embed_code>Use your own button, styled however you like, and open this address from it. Do not use a script tag or embed button script. Do not build app.myrocketramp.com/?s=<code> links. Both open the checkout in a way that drops the prefilled recipient (see Common Mistakes).
Desktop: a modal on your page
On desktop Chrome, Edge and Firefox, show the checkout in an iframe inside a modal. Your domain must be approved on the Domain Whitelist (Setup & Credentials). Use exactly these attributes:
<div id="rr-overlay" style="display:none;position:fixed;inset:0;z-index:9999;
background:rgba(0,0,0,.6);align-items:center;justify-content:center">
<div style="position:relative;width:420px;max-width:calc(100vw - 32px);
height:90vh;max-height:750px;border-radius:16px;overflow:hidden;background:#000">
<button onclick="closeRocketRamp()" aria-label="Close"
style="position:absolute;top:8px;right:12px;z-index:2">×</button>
<iframe id="rr-frame" title="RocketRamp payment"
sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox"
allow="clipboard-read; publickey-credentials-create; publickey-credentials-get"
referrerpolicy="origin"
style="width:100%;height:100%;border:0"></iframe>
</div>
</div>| Attribute | Why it is required |
|---|---|
referrerpolicy="origin" | Tells RocketRamp which site is showing the checkout, so it can match your whitelist. Without it the checkout shows Forbidden: missing embed origin. |
sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox" | The checkout needs scripts, forms and its own cookies to sign the payer in, and pop-ups for some payment steps. |
allow="clipboard-read; publickey-credentials-create; publickey-credentials-get" | Lets the payer paste a sign-in code and use passkeys. |
async function payWithRocketRamp() {
const r = await fetch('/api/rocketramp/checkout', { method: 'POST', credentials: 'same-origin' });
const { embed_code } = await r.json();
if (!embed_code) { showError('We could not start the payment. Please try again.'); return; }
const url = 'https://app.myrocketramp.com/embed/' + embed_code;
if (useLinkInsteadOfModal()) { showContinueLink(url); return; } // see below
document.getElementById('rr-frame').src = url;
document.getElementById('rr-overlay').style.display = 'flex';
}
function closeRocketRamp() {
document.getElementById('rr-overlay').style.display = 'none';
document.getElementById('rr-frame').removeAttribute('src');
refreshBalance(); // and again a few seconds later, when the webhook has landed
}Add a small "RocketRamp not loading? Open it in a new tab" link under the modal, pointing at the same address.
Safari and iPhone: a link
Safari, and every browser on iPhone and iPad, do not send RocketRamp's sign-in cookie inside an iframe, so the sign-in code step cannot finish in a modal. On these browsers, show a "Continue to RocketRamp" link that opens the checkout as its own page:
<a href="https://app.myrocketramp.com/embed/EMBED_CODE" target="_blank" rel="noopener">Continue to RocketRamp</a>function useLinkInsteadOfModal() {
const ua = navigator.userAgent;
const iOS = /iPhone|iPad|iPod/.test(ua) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
const safari = /AppleWebKit/.test(ua) && !/Chrome|Chromium|CriOS|FxiOS|EdgiOS|Edg\/|OPR/.test(ua);
return iOS || safari;
}If you open a window with window.open(), call it immediately in the click handler, before any await, then set its address when the code arrives. A window.open() after an await is blocked without any error. A link the customer taps is never blocked.
Styling
Because you use your own button, style it any way you like. Inside the modal, the RocketRamp checkout keeps its own look. Keep the modal at least 360px wide and 600px tall, and make it full-screen below 640px.
After payment
The checkout does not send the customer back to your page when they finish. Tell them: "Pay on RocketRamp, then come back here. Your balance updates automatically." Refresh the balance when the modal closes, when your tab becomes visible again (visibilitychange), and every 10 seconds for a few minutes after the checkout opens.