Requirements
- Min SDK: 23 (Android 6.0)
- WalletKit: 1.6.0+
Installation
First, add the required repositories to your project’ssettings.gradle.kts or root build.gradle.kts:
build.gradle.kts using the BOM (Bill of Materials):
Check the GitHub releases for the latest BOM version.
Initialization
WalletConnectPay is automatically initialized when you initialize WalletKit. No additional setup is required.appIdfrom your WalletConnect Project IDpackageNamefrom your application context
For more details on WalletKit initialization, see the WalletKit Usage documentation.
Payment Link Detection
UseWalletKit.Pay.isPaymentLink() to determine if a scanned URI is a payment link or a standard WalletConnect pairing URI:
Payment Flow
The payment flow consists of five main steps: Detect Payment Link -> Get Options -> Get Actions -> Sign Actions -> Confirm Payment1
Get Payment Options
Retrieve available payment options for a payment link:
2
Get Required Actions
Get the wallet RPC actions needed to complete the payment:
3
Sign Actions
4
Collect User Data (If Required)
Some payments require additional user information:
5
Confirm Payment
Submit signatures and finalize the payment:
Complete Example
Here’s a complete implementation example:API Reference
WalletKit.Pay
The payment operations object within WalletKit.Methods
| Method | Description |
|---|---|
isPaymentLink(uri: String): Boolean | Check if URI is a payment link |
getPaymentOptions(paymentLink, accounts) | Get available payment options |
getRequiredPaymentActions(params) | Get actions requiring signatures |
confirmPayment(params) | Confirm and finalize payment |
Parameters
Wallet.Params.RequiredPaymentActions
Wallet.Params.ConfirmPayment
Data Models
Wallet.Model.PaymentOptionsResponse
Wallet.Model.PaymentInfo
Wallet.Model.PaymentOption
Wallet.Model.PaymentAmount
Wallet.Model.WalletRpcAction
Wallet.Model.PaymentStatus
| Status | Description |
|---|---|
REQUIRES_ACTION | Additional action needed |
PROCESSING | Payment in progress |
SUCCEEDED | Payment completed |
FAILED | Payment failed |
EXPIRED | Payment expired |
Best Practices
- Use WalletKit Integration: If your wallet already uses WalletKit, prefer this approach for automatic configuration
-
Use
isPaymentLink()for Detection: Use the utility method instead of manual URL parsing for reliable payment link detection -
Account Format: Always use CAIP-10 format for accounts:
eip155:{chainId}:{address} - Multiple Chains: Provide accounts for all supported chains to maximize payment options
- Signature Order: Maintain the same order of signatures as the actions array
- Error Handling: Always handle errors gracefully and show appropriate user feedback
- Loading States: Show loading indicators during API calls and signing operations
-
Expiration: Check
paymentInfo.expiresAtand warn users if time is running low -
User Data: Only collect data when
collectDataActionis present in the response