Skip to main content
Your browser worker is the code that runs the merchant’s checkout in a browser session you control. When a transaction is ready, it fills checkout with a placeholder card. Our Browser Pay SDK relays it via Sapiom, which sends it on with the buyer’s real card. You need:
  • A transaction whose nextAction.type is payment_ready. See Authorize a transaction.
  • A Chromium browser your code controls, with a Chrome DevTools Protocol (CDP) WebSocket endpoint.
  • The buyer’s key.

Install

Get the placeholder card

List the buyer’s placeholders and pick the one whose transactionId matches your transaction:
Each placeholder has a number, expMonth, expYear, cvc and injectionRef. Your code, not your AI model, should fill the card fields. Keep placeholders out of logs and out of the model’s context.

Attach Browser Pay, then fill the form

Attach before typing any card field, and wait for attachInterceptor to resolve:
Then open continueUrl, fill the card fields with the placeholder’s number, expiry and cvc, and submit. When checkout finishes, call await handle.detach(). cdpUrl is a CDP WebSocket URL, or a Puppeteer or Playwright object that provides one through wsEndpoint().

Check the result

Whatever the event, the next step is the same: confirm the order. No event proves that money did or did not move. Browser Pay currently works with Shopify card checkout. It does not support Shop Pay yet. Options, events and reason codes are in the Browser Pay SDK reference.