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
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 adata-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 inevent.detail.
Buttons added later
The script mounts everydata-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
AfterinitEscrowCheckout(), 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.