Feature/pingpay phase 1#623
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (17)
WalkthroughThis PR integrates PingPay payment processing into the application, adding four API routes to create checkout sessions and verify transactions, UI components for fast donations to campaigns and projects, a payment callback handler, and cross-tab communication support. Integration points include campaign donation buttons, profile donation buttons, and PingPay donation badges. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Frontend
participant Backend as Backend API
participant PingPay as PingPay API
participant NEAR as NEAR RPC
participant Other as Other Tabs
User->>Frontend: Click FastDonateButton
Frontend->>Frontend: Open PingPayModal
User->>Frontend: Enter amount & submit
Frontend->>Backend: POST /api/pingpay/create-checkout<br/>(amount, campaignId)
Backend->>PingPay: POST /checkout/sessions<br/>(NEAR recipient, amount, metadata)
PingPay-->>Backend: Return sessionUrl & sessionId
Backend-->>Frontend: Return session details
Frontend->>Frontend: Store sessionId in localStorage
Frontend->>Frontend: Display payment link, open in new tab
User->>PingPay: Complete payment
PingPay->>Frontend: Redirect to /pingpay/callback
Frontend->>Backend: GET /api/pingpay/session-status<br/>(sessionId)
Backend->>PingPay: Fetch session & payment details
PingPay-->>Backend: Return txHash, payer
Backend-->>Frontend: Return payment status
Frontend->>Backend: POST /api/pingpay/verify-tx<br/>(txHash, senderId)
Backend->>NEAR: Query tx_status, find donation log
NEAR-->>Backend: Return on-chain donation data
Backend-->>Frontend: Confirm transaction landed
Frontend->>Frontend: Trigger syncApi (refresh donations)
Frontend->>Other: BroadcastChannel: pingpay-complete
Other->>Other: Show success toast, invalidate cache
Frontend->>Frontend: Display confirmation, close window
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit