overflowDocs
Dashboard
DocumentationAPI reference

Get started

  • Introduction
  • Quickstart
  • Integrate with AI
  • Agents (MCP)
  • Selling

Payments

  • Checkout
  • Loader
  • Webhooks

Risk and privacy

  • Fraud gate
  • Dispute evidence
  • Privacy
  • Dashboard
  • Sign in

Get started

  • Introduction
  • Quickstart
  • Integrate with AI
  • Agents (MCP)
  • Selling

Payments

  • Checkout
  • Loader
  • Webhooks

Risk and privacy

  • Fraud gate
  • Dispute evidence
  • Privacy

Payments

Loader

overflow.js is the script that opens a checkout on your own page. It is about 5 KB, has no dependencies and does nothing until you ask it to.

<script src="https://overflowpay.net/v1/overflow.js" async></script>

Load it from that address. Don't copy it into your bundle: the script works out where Overflow lives from its own URL.

What it does to your page

Nothing, until a checkout opens. On load the script defines window.Overflow and adds one click listener. It sets no cookies, reads and writes no local or session storage, and sends no requests.

When a checkout opens, the loader adds an <iframe> that points at Overflow. The payment form, the fraud checks and Stripe all run inside that frame, on Overflow's origin. So does the small proof-of-work puzzle the buyer's browser solves before the form shows. Your page's cookies, storage and DOM are out of their reach. See Privacy for the measurements.

Open a checkout

const checkout = Overflow.checkout({
	id:"co_...",
	mode:"modal",
	on:{
		success:({id,returnUrl}) => {
			// the buyer finished. show a thank you, the webhook does the real work
		},
		close:() => {}
	}
})

checkout.open()

Options

OptionTypeNotes
idstringA checkout id from your server. Give this or link.
linkstringA pay link id (lnk_...) or its full address. Opens a fresh checkout for that link.
modestringmodal (default), drawer, inline or redirect.
containerelement or selectorWhere the frame goes in inline mode.
onobjectEvent handlers, listed below.

Modes

  • modal: a centred dialog over your page. Escape or a click outside closes it, and focus returns to the button that opened it.
  • drawer: the same dialog docked to the right edge, full height.
  • inline: the frame is placed inside container and grows with its content. No overlay.
  • redirect: leaves your page for the full-page checkout. Use this as the fallback when a frame is not an option.

Methods

open() shows the checkout. close() and destroy() remove it.

Events

EventWhenPayload
readyThe payment form is on screen.{id}
successThe buyer paid.{id, returnUrl}
processingThe buyer finished, but the money hasn't arrived yet. Bank payments such as SEPA Direct Debit can take a few business days. success only follows if it clears while the checkout is still open, so rely on the payment.succeeded webhook to learn when it does.{id}
blockedThe fraud gate turned the buyer away.{id}
failedA delayed payment failed.{id}
expiredThe checkout expired before it was paid.{id}
closeThe modal or drawer was closed.none

If you don't handle success and the checkout has a return_url, the loader sends the buyer there after a short pause.

A success event is not proof of payment. It runs in the buyer's browser, where anything can be faked. Deliver orders from the webhook.

Without writing JavaScript

Put an attribute on any button or link and the loader handles the click.

<button data-overflow-link="lnk_...">Buy the preset pack</button>

<button data-overflow-checkout="co_..." data-overflow-mode="drawer">Pay now</button>

React

"use client"

import Script from "next/script"

export default function BuyButton() {
	async function buy() {
		const {id} = await fetch("/api/checkout",{method:"POST"}).then(res => res.json())
		window.Overflow.checkout({id}).open()
	}
	return (
		<>
			<Script src="https://overflowpay.net/v1/overflow.js" />
			<button onClick={buy}>Buy Pro</button>
		</>
	)
}

Allowed sites

The checkout frame only loads on origins listed under Settings → Sites allowed to open the checkout. Anywhere else the browser refuses to render it. This stops another site from wrapping your checkout in its own page.

While Overflow runs in test mode, http://localhost and http://127.0.0.1 on any port are always allowed, so you can develop without changing settings.

Content Security Policy

If your site sends a CSP header, allow the loader and the frame:

script-src https://overflowpay.net;
frame-src https://overflowpay.net;

Limits

  • Cards and wallets complete inside the frame. Payment methods that send the buyer to their bank may need to leave the frame. If you rely on those, use mode: "redirect".
  • Apple Pay only shows up inside a frame on your page once your site's domain is registered with Stripe on the platform's account. Ask the person who runs Overflow if you need it.
  • Browsers block third-party frames in some private modes and extensions. redirect mode always works.
PreviousCheckoutNextWebhooks

On this page

  • What it does to your page
  • Open a checkout
  • Options
  • Modes
  • Methods
  • Events
  • Without writing JavaScript
  • React
  • Allowed sites
  • Content Security Policy
  • Limits