-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Summary
Integrate PingPay for treasury subscription payments, enabling Trezu monetization.
Goals
- Pay in any token - Treasury members pay subscriptions using any token they have
- Receive in USDC - Trezu always receives stable USDC (configured in PingPay dashboard)
- Upfront payments - 3, 6, or 12 month subscription tiers
- Invoice generation - Provide invoice documents on request
- Track paid periods - Know if a treasury's subscription is active/expired
Why PingPay?
- Powered by NEAR Intents (same infrastructure Trezu already uses)
- No custody risk - payments flow directly through the protocol
- Cross-chain support - users can pay from multiple chains
- Planning to add subscriptions and cards in the future
Technical Approach
Backend API Endpoints
GET /api/subscriptions/plans- List available plansGET /api/subscriptions/status?account_id=...- Check subscription statusPOST /api/subscriptions/checkout- Create PingPay checkout sessionGET /api/subscriptions/callback- Handle payment redirect
Payment Flow
- User selects plan → clicks Subscribe
- Backend creates checkout session via PingPay API
- User redirected to PingPay checkout (pays in any token)
- PingPay converts to USDC via NEAR Intents
- User redirected back with payment status
- Backend activates subscription
Database
subscription_plans- Configurable tiers with pricingtreasury_subscriptions- Links treasuries to active planssubscription_payments- Payment records with PingPay trackingsubscription_invoices- Generated invoices
Resources
Tasks
- Database migration for subscription tables
- Backend API endpoints
- PingPay client integration
- Mock PingPay service for sandbox testing
- Frontend subscription tab in settings
- Invoice generation
- Tests
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels