feat: add PingPay subscription payment integration#130
Draft
petersalomonsen wants to merge 2 commits into
Draft
Conversation
Integrate PingPay for treasury subscription payments, allowing users to pay in any token while Trezu receives USDC. Backend implementation includes: - Database migration for subscription tables (plans, subscriptions, payments, invoices) - PingPay client for checkout session creation - API endpoints: plans, status, checkout, callback - Environment variables for PingPay configuration API Endpoints: - GET /api/subscriptions/plans - List available plans (3m, 6m, 12m) - GET /api/subscriptions/status - Check treasury subscription status - POST /api/subscriptions/checkout - Create PingPay checkout session - GET /api/subscriptions/callback - Handle payment redirect Closes #120 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
akorchyn
reviewed
Feb 3, 2026
| - `txStatus` - `SUCCESS` | `FAILED` | `REFUNDED` | ||
| - `depositAddress` - Transaction reference | ||
|
|
||
| ## Database Schema |
Member
There was a problem hiding this comment.
That's a bit sad that we didt clarify and both doing own ways haha
Collaborator
Author
There was a problem hiding this comment.
hehe - I am only in draft mode. I was going to check with you. I think I will adjust to your schema, but I just had to have something to play with while waiting
- Fix response structs to match actual PingPay API (amount is object, recipient is object with address, not flat strings) - Fix double /api in URL construction for PingPay client - Fix callback URLs to route through backend before redirecting to frontend (PingPay → backend callback → frontend success/cancel) - Add BACKEND_URL env var for constructing PingPay callback URLs - Update implementation plan with verified API responses, remaining frontend/mock/invoice/test work documented in detail Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Backend (Rust)
GET /api/subscriptions/plans- List available plansGET /api/subscriptions/status- Check subscription statusPOST /api/subscriptions/checkout- Create checkout sessionGET /api/subscriptions/callback- Handle payment redirectDocumentation
docs/implementation-plans/pingpay-subscription-integration.mdStill TODO
Test plan
sqlx migrate runGET /api/subscriptions/plansreturns 3 plansGET /api/subscriptions/status?account_id=test.nearreturns statusPOST /api/subscriptions/checkoutcreates session (requires API key)Related
🤖 Generated with Claude Code