This example showcases how to integrate Crossmint's "Pay with Card" feature with the Abstract Global Wallet in a Next.js application. Users can connect their Abstract Global Wallet and purchase NFTs using credit cards or Google Pay via Crossmint.
-
Get a copy of the
crossmintexample directory from the Abstract Examples repository:mkdir -p crossmint && curl -L https://codeload.github.com/Abstract-Foundation/examples/tar.gz/main | tar -xz --strip=2 -C crossmint examples-main/crossmint && cd crossmint
-
Install dependencies
pnpm install
-
Set up environment variables:
Create a Crossmint Token Collection on the Abstract testnet. Import your existing collection or create a new one (a basic example is provided in the
contractsdirectory).Create a
.env.localfile in the root directory:NEXT_PUBLIC_CROSSMINT_API_KEY=your_crossmint_client_api_key NEXT_PUBLIC_CROSSMINT_COLLECTION_ID=your_collection_id
NEXT_PUBLIC_CROSSMINT_API_KEY: Your Crossmint client-side API keyNEXT_PUBLIC_CROSSMINT_COLLECTION_ID: The ID of your Crossmint collection
-
Run the development server:
pnpm run dev
Visit http://localhost:3000 to see the app.
- Connect Wallet: Users first connect their Abstract Global Wallet
- Purchase NFT: The Crossmint embedded checkout appears, allowing credit card payments
- NFT Delivery: The purchased NFT is minted directly to the connected wallet address
- Payment Processing: Crossmint handles all payment processing and blockchain interactions