BasePayButton is a ready-to-use React component that provides a seamless payment experience using Coinbase Wallet. It handles the entire payment flow including user interaction, transaction processing, and result handling.
Installation
Basic Usage
PaymentForm.tsx
Props
paymentOptions (Required)
Payment configuration object with the following properties:Styling Props
Event Handlers
Payment Options
Basic Payment
Basic Payment
Payment with User Info Collection
Payment with User Info Collection
Styling Options
Color Schemes
Color Schemes
Sizes and Variants
Sizes and Variants
Event Handling
Payment Result Handling
Payment Result Handling
Custom Click Handler
Custom Click Handler
Complete Example
CheckoutPage.tsx
TypeScript Support
The component is fully typed when using TypeScript:TypeScript Support
Testing
For testing your integration:- Use testnet mode: Set
testnet: truein payment options - Get test USDC: Use Circle’s faucet on Base Sepolia
- Test different scenarios: Try successful payments, cancellations, and errors
- Verify user info collection: Test with different
payerInfoconfigurations