Skip to main content
The Pay with Payluk button shows the Payluk icon and the text “Pay with Payluk”. When the buyer clicks it, it creates a checkout session and opens the escrow checkout widget. While the session is being created, the button shows a spinner and ignores further clicks. You can add it in three ways: All three render the same button and accept the same checkout inputs as pay(). Your backend still creates the escrow and gives your page its payment token.

Appearance

Pay with Payluk buttons: purple default, hover, keyboard focus, loading, disabled and custom label on light backgrounds; white theme default, hover and loading on a dark background.

The button in both themes and every state.

The button is 44px tall with a minimum width of 220px. It has hover, pressed, keyboard focus and disabled states. Screen readers announce it as “Pay with Payluk”, and the icon is hidden from them. To change the text, set the label (label or data-label). The icon stays. To add your own styles, target the .payluk-btn class, or pass a className in React.

Plain HTML

Add the script once, then put a data-payluk-button element where the button should appear.
With a test key, load the script from staging: https://staging.live.payluk.ng/v1/checkout/button.js. The script opens checkout sessions on the server it was loaded from.

Attributes

The button reads the attributes when it is clicked, so you can change them after the page loads (for example, when the cart changes).

Events

The element fires these events. They bubble, and the result is in event.detail.

Buttons added later

The script mounts every data-payluk-button element on the page when it loads. If you add one later (for example, in a single-page app), call:

JavaScript or TypeScript

After initEscrowCheckout(), render the button into an element or a CSS selector:
mountCheckoutButton(target, options) takes every pay() input, plus these: It throws an EscrowCheckoutError with code INVALID_INPUT if the target element does not exist, and BROWSER_ONLY if it runs on the server.

React

Use <EscrowCheckoutButton>. It renders the same button by default.