๐ต Payments - Stripe, Radom & Okto
This page is showing how stripe Radom and okto is being used in our application
Skoragents.ai enables users to subscribe to AI-powered gaming agents using fiat or crypto payments and further stake tokens on the Solana blockchain. This document defines the expected behaviors and tests for our subscription and wallet flow, supporting Stripe, Radom (USDC), and Okto Smart Wallet.
๐ Subscription Plans
Novice
$29
$348
Basic AI assistance, 5 games, standard response time, email support
Expert
$49
$588
Advanced AI, 20 games, faster response time, priority email support
Master
$69
$828
Elite AI, all games, real-time response, 24/7 support
๐งช Subscription Flow: TDD Tests
1. Stripe (Fiat Payments)
Stripe payment links for payments
User Pays with Card
After successful payment stripe send us subscription event via webhook
After successful payment we make entry of subscription in DB
2. Radom (Crypto w/ USDC Payments)
Generates a crypto payment link using Radomโs API with correct metadata (amount, plan, billing cycle).
Asserts payment link redirects properly to Radom-hosted checkout.
After users successful payment, randomly send us event via webhook
After the successful subscription we then update DB
3. Okto Smart Wallet Integration
Simulates Google OAuth login and Okto smart wallet generation.
Asserts that the user gets a wallet address and session token securely.
Submits an on-chain transaction (e.g., staking) via the Okto wallet.
Asserts that the user did not sign with a private key or pay gas (the paymaster absorbed it).
Asserts that the Okto smart wallet address is mapped to the user subscription record.
Useful for syncing staking logic and AI agent access control.
4. Core Subscriptions & Agent Access Logic
A valid subscription should allow the user to access the AI dashboard with relevant tier-based capabilities.
Asserts tier correctly gates features (number of games, response time, etc.).
Users with an active subscription can stake SKOR tokens.
Asserts the staking contract only accepts calls from whitelisted (subscribed) wallets.
Allows user to switch plans mid-cycle (pro-rated or effective from next billing cycle).
Asserts user sees new plan info and pricing reflected in Stripe/Radom metadata.
๐งฐ Tools & Libraries Used
Stripe SDK for fiat subscriptions
Radom SDK + USDC for crypto subscriptions
Okto SDK for smart wallet management and paymaster usage
Next.js API Routes for REST endpoint testing
๐ Subscription Lifecycle Diagram
Last updated