Skip to main content
Use the Pasteaza browser SDK when you want customers to pay without leaving your website. The SDK works with the same checkout session returned by POST /v1/checkout/sessions.
Create checkout sessions from your backend with your secret key. The browser SDK renders a native Pasteaza modal on your page using only your public key and the returned checkout reference.

Install

Add the SDK script to your checkout page.

Open checkout

Create the checkout session on your backend, then pass the returned reference to the SDK.
You can also pass callbacks.

Pay button

Use button.js when you want Pasteaza to render a ready-made button.
You can customize the button text.

How it works

1

Create session

Your backend creates a checkout session using your Pasteaza secret key.
2

Pass reference

Your frontend passes the returned reference to PasteAZA.checkout.
3

Confirm checkout

The SDK retrieves the public checkout session and confirms the merchant, amount, currency, and status.
4

Open modal

The SDK renders a responsive Pasteaza modal on your page. Desktop uses a centered modal. Mobile uses a bottom sheet.
5

Receive event

The SDK calls your onSuccess, onFailed, onClose, or onError callback.

Full example

Events

Options

Notes

  • PasteAZA.checkout("ch_...") and PasteAZA.checkout({ checkout: "ch_..." }) both open the same hosted checkout session.
  • Never expose your secret key in browser code.
  • Use webhooks as your source of truth for order fulfillment. SDK callbacks are for user experience.