Inspiration
Failed PayPal renewals often aren’t cancels - funding failed, and the subscription sits SUSPENDED with outstanding balance. Merchants need a desk that recovers that cash with a human in the loop, not a black-box auto-charge.
What it does
Renewal Rescue is a merchant recovery desk:
- Refresh — live PayPal Billing GETs on seeded sandbox subscriptions
- Propose — Google Gemini suggests an action + customer draft (IDs/amounts stay code-owned)
- Policy — blocks write-offs; caps revise; optional merchant Capture now override
- Approve — human + demo passcode → live sandbox capture with idempotent
PayPal-Request-Id - Prove — verified balance recovery from first COMPLETED ≥ $5 per sub (demo board moved $16 → $21)
AI recommends. The merchant Approves. PayPal moves money. We do not claim ACTIVE unless a follow-up GET shows it — cash can clear while status stays SUSPENDED (reactivation pending).
How I built it
- Next.js / TypeScript recovery desk on Vercel
- PayPal REST Subscriptions / Billing (sandbox)
- Google Gemini for structured propose JSON
- Zod policy + proposal schema; activate GET verification after capture
- Seed scripts for outstanding SUSPENDED shells (setup-fee / drain path)
Challenges I ran into
- Serverless state: recoveries must be proven from PayPal transactions, not in-memory optimism alone
- Sandbox seeding: Agree while funded → ACTIVE/$0; CCREJECT unreliable on GB buyer
- Honesty: Gemini
retry_latermust not imply PayPal will auto-retry a suspended sub - Attribution: first COMPLETED ≥ $5 vs ordinary renewals — labeled carefully for the demo ledger
Accomplishments that I'm proud of
- End-to-end live sandbox capture on camera (not Webhooks Simulator)
- Gemini Propose + HITL Approve with amber pending → settled verified recovery
- Honest UI: reactivation pending, Capture now override, no false ACTIVE claim
- Judge spare left after film (Brightline)
What I learned
PayPal outstanding-balance capture is async; “pending” ≠ recovered. Merchant approval + idempotency + txn probe beat “AI said so.” Sandbox funding state is the whole seed game.
What's next for Renewal Rescue
- Reliable outstanding seeding / more judge spares
- Stronger capture↔txn correlation for verified recovery
- Optional webhooks as a secondary signal (never as sole money proof)
- Reactivation UX when GET confirms ACTIVE
Built With
- google-gemini
- nextjs
- paypal
- paypal-subscriptions
- react
- typescript
- vercel
- zod
