<PayWithCard>
is a React component that renders the card payment flow:
onSuccess
is called when the user's payment is complete. Once the transaction is fully complete on-chain, Paper sends a transfer:succeeded
webhook associated with the transaction.
Optional event callback functions onCancel
and onError
can be passed to handle events associated with this step.RequiredThe ID of the Paper checkout created for the NFT you're selling. See the Checkout API for more information about creating or fetching a checkout.
RequiredThe public address of where the NFT will ultimately be received. If the user is using a Paper wallet, you may use the CreateWallet component to create a wallet for them, or if you already know the user has previously registered a Paper wallet, you may use/api/v1/wallet/:emailAddress
to get the public wallet address associated with an email address.
RequiredThe email address of the user. We require this email to send useful information regarding the purchase (e.g. receipts).
OptionalThis callback is invoked after Paper has successfully received payment from the buyer.The NFT may not yet be transferred to the user. UseonTransferSuccess
if you expect the NFT to be in the buyer's wallet.
OptionalThis callback is invoked after the NFT is successfully transferred to the buyer's wallet.
OptionalThis callback is invoked when the buyer closes this flow without completing the payment.
OptionalThis callback is invoked if there is any error in the purchase process. An error reason is passed in as an argument to this function.
Optional1{2width: number;3height: number;4...5}Copied!width: number (default = 400px)The width of the checkout. Valid forPOPUP
,MODAL
,DRAWER
.height: number (default = 800px)The height of the checkout. Valid forPOPUP
,MODAL
.colorPrimary: string (in hex, e.g.#cf3781
)The primary brand color for buttons and links.colorBackground: string (in hex)The background color of the page.colorText: string (in hex)The color for text on the page and UI elements.borderRadius: string (e.g.0
for sharp corners,12px
for rounded corners,24px
for pill shape)The roundness of buttons and input elements.fontFamily: string (COMING SOON)