Create a fully customized memecoin checkout experience that accepts credit cards
Solana Wallet
Get API Keys
orders.create
, orders.read
, orders.update
.Finally, create your key and save it for subsequent steps.solana:${tokenMintHash}
(tokenMintHash is commonly known as contract address, CA, or mint hash).
maxSlippageBps
: Optional slippage tolerance (default provided if not specified)receiptEmail
: Required for delivering payment receiptsexecutionParameters.mode
: Set to “exact-in” for memecoin purchases (specifies exact USD amount to spend). Exact-out is for NFT’s, exact-in is for fungibles.
@crossmint/client-sdk-react-ui
dependency and add the embedded checkout component. To get started:
Create a new Next.js application
y
and press Enter
to proceed:Name your app `crossmint-embedded-checkout-demo` and accept the default options
Change into the directory created in previous steps
Install @crossmint/client-sdk-react-ui
Open the project in your preferred code editor
Add environment variables
.env.local
in your project root:Create the checkout page
/src/app/page.tsx
with:Run your app
http://localhost:3000
to see your checkout!Test your app
POST
https://www.crossmint.com/api/2022-06-09/orders
Refer to the complete create order API reference here.
Example Response
maxSlippageBps
: Optional, or else default autogenerated slippage will be applied.receiptEmail
: Required for credit card payments to deliver receiptexecutionParameters.mode
: The execution method for the order. Exact-out is for NFT’s, exact-in is for fungibles.onPaymentCompleted
callback will be triggered with the payment response.
Unlike with Stripe, you don’t need to manually submit the payment form. The Checkout.com Flow component takes care of the entire payment process, including validation, submission, and handling the response.
Here’s how the payment flow works with Checkout.com:
onPaymentCompleted
callback is triggered with the payment responseonError
callback will be triggered:
GET
https://www.crossmint.com/api/2022-06-09/orders/<orderId>
Example response from the Get Order API:
payment.status
is completed
but the order also contains a payment.refunded
property. This indicates that the payment was initially successful but has since been refunded.
payment.refunded
object includes the following fields:
amount
: The amount that was refundedcurrency
: The currency of the refundtxId
: The on-chain transaction ID the refund was sent inchain
: The blockchain where the refund transaction occurredtxId
) so users can verify the refund on-chainIs there a UI Crossmint provides?
Do I need to complete KYC to purchase memecoins?
What happens if my transaction fails?
What are the transaction limits?
Is there a limit on how much of a single token I can sell in a day?
What do the order creation parameters mean?
method
: Set to checkoutcom-flow
for Checkout.com credit card paymentscurrency
: Set to usd
for US Dollar paymentsreceiptEmail
: Required for credit card payments to deliver receipttokenLocator
: Specifies the memecoin token address in the format solana:tokenAddress
executionParameters
:
mode
: Set to “exact-in” for memecoin purchases (specifies exact USD amount to spend)amount
: Amount to purchase in USDmaxSlippageBps
: Set to “500” for 5% slippage tolerance. If not provided, the default slippage will be applied from the available liquidity provider.checkoutcomPaymentSession
: Contains the payment session information from Checkout.com
id
: The payment session IDpayment_session_secret
: The secret used to authenticate with Checkout.compayment_session_token
: The token used to initialize the Checkout.com Flow componentcheckoutcomPublicKey
: The public key used to initialize the Checkout.com Flow component