Usage
To use Bias Checkout, first include the web SDK on your site:
Note
For security, always load the SDK directly from https://js.biaspay.com.
Usage with bundlers
The @biaspay/checkout package handles loading the script for you. It also provides types definitions for projects using TypeScript.
Once installed, initialize the Checkout browser library:
When the user begins the checkout process, create a checkout session on your server. Usually, this is when they click a "Checkout" or "Buy" button.
Send the checkout session's client_secret to the browser and use it to call beginCheckout:
Customizing appearance
Use the appearance option to change the the components’ colors, fonts, spacing, focus states, and more.
Creating components
Create checkout components by calling checkout.createElement with the component type and an element to mount to:
Client completion event
A success message can be shown by adding an event listener to the checkout instance:
Server completion event
Order fulfillment should be handled on the server side by subscribing to the API event stream:
server.ts
Learn more about how to interact with the components in the SDK reference.