The application was failing at the payment verification step with error:
Payment verification failed: Invalid payment
Status: 402 (Payment Required)
Error Code: PAYMENT_VERIFICATION_FAILED
Network Name Mismatch: The x402 protocol specification requires specific network names for Solana:
- Mainnet:
"solana"(NOT"solana-mainnet") - Devnet:
"solana-devnet"
The application was using "solana-mainnet" internally but the PayAI facilitator expects "solana" according to the official x402 spec.
Before:
const requirementNetwork =
isSolana && chainConfig.network === "solana-mainnet"
? "solana"
: chainConfig.network;After:
// Map network names to x402 spec format
// x402 spec uses "solana" for mainnet, not "solana-mainnet"
let requirementNetwork = chainConfig.network;
if (isSolana) {
if (chainConfig.network === "solana-mainnet") {
requirementNetwork = "solana";
} else if (chainConfig.network === "solana-devnet") {
requirementNetwork = "solana-devnet";
}
}This ensures that:
- Internal config uses
"solana-mainnet"for clarity - Payment requirements sent to facilitator use
"solana"per x402 spec - Payment verification matches the correct network name
- Frontend sends payment with
network: "solana"(from payment requirement) - Backend now sends payment requirement with
network: "solana"(mapped from internal"solana-mainnet") - Facilitator receives matching network names and can verify the payment correctly
The PayAI facilitator expects this exact structure for Solana payments:
{
"x402Version": 1,
"scheme": "exact",
"network": "solana", // Must be "solana" not "solana-mainnet"
"payload": {
"transaction": "base64-encoded partially-signed transaction"
}
}Our implementation now conforms to this specification.
- The
solanaPayment.jsservice exists but is NOT used (confirmed via grep) - The middleware correctly uses the PayAI facilitator for Solana verification
- No changes needed to frontend code - it correctly follows the payment requirements
- The facilitator handles all Solana transaction verification per x402 spec
- Test Solana mainnet payment flow
- Verify payment verification succeeds
- Confirm transcription begins after successful payment
- Test with different Solana wallets (Phantom, etc.)
- PayAI x402 Documentation: https://docs.payai.network/x402/quickstart
- PayAI Facilitator URL: https://facilitator.payai.network
- x402 Spec: Network name must be "solana" for mainnet