CheckoutWithEth
CheckoutWithEth embeds a component on your page that accepts ETH payments on Ethereum.
This component also handles:
- Connecting the payment wallet
- Prompting the payment wallet to switch chain, if necessary
- Informing the payment wallet they have insufficient funds
React Integration
- Install the React SDK with your preferred package manager.
npm install @paperxyz/react-client-sdk-checkout-with-eth
yarn add @paperxyz/react-client-sdk-checkout-with-eth
- Copy your API key from the Developer Dashboard: Developers page.
- When a buyer wants to make a purchase, create a
configs
object (see props table below). You will provide some buyer information and configure behavior via this API. - Instantiate a
PaperSDKProvider
provider to store Paper-specific properties. - Within the provider, instantiate the
CheckoutWithEth
component to render this component. Pass the SDK Client Secret to this component.
Example
CheckoutWithEth
props
Javascript Integration
- Install the Javascript SDK with your preferred package manager.
npm install @paperxyz/js-client-sdk
yarn add @paperxyz/js-client-sdk
- Copy your API key from the Developer Dashboard: Developers page.
- When a buyer wants to make a purchase, create a
configs
object (see props table below). You will provide some buyer information and configure behavior via this API. - Call
createCheckoutWithEthElement
to insert the iframe on your page. Pass the SDK Client Secret to this component.- If you don't provide
elementOrId
, this call returns an iframe element for you to insert into your page.
- If you don't provide
Code example
Props
Customization
The optional options
argument allows you to customize the component's styling. All customization fields are optional.