Checkout Modal
The Checkout Modal provides developers with a easy way to implement cryptocurrency payments.
Sequence Checkout allows users to easily purchase an ERC721 or ERC1155 token with a primary or secondary sales contract such as a marketplace, with the following payment options:
- Purchase with any cryptocurrency in the wallet.
- Receive funds from another wallet to a Sequence wallet and purchase.
- Pay using a credit or debit card which will intelligently detect the correct provider for each region, chain and currency.
- Pay with another cryptocurrency in a wallet by doing an automated swap and purchase.
We have an integrated checkout flow that you can leverage by installing the dedicated library @0xsequence/checkout
and using it in conjunction with @0xsequence/connect
.
In order to enable credit card payments for checkout, please get in touch with the Sequence team as your contract address will need to be allowlisted. Credit card payments only work on mainnet.
Installation and Setup
To integrate the checkout feature, follow these steps:
Install the `@0xsequence/checkout` library:
Place the `SequenceCheckoutProvider` below the SequenceConnect Provider in your App:
Now we have the setup done, let’s see how to use the checkout modal for different use cases.
Checkout with an ERC1155 Token
We have convenient utility functions for ERC1155 tokens that make it easy to configure the checkout modal.
Here’s a configuration with example variables:
Custom Contract
We instantiate the useSelectPaymentModal
hook to open the checkout modal and pass a settings object. In addition, for custom contracts, you can specify a contract ABI along with encoding the call data, in this case we are using ethers
and viem
’s encodeFunctionData
utility.
Congratulations! You’ve just learned how to use the Checkout Modal with Web SDK.
Was this page helpful?