Replace PayPal Payouts with Whop’s global treasury — 180+ countries, crypto, ACH, wire. Runs side-by-side with PayPal. No rip-and-replace, no new dependencies.
This file gives Cursor and Claude Code full context about your Whop migration. Every file path, schema change, and Python code example — ready to implement.
Save as CLAUDE.md in your project root. Open Cursor. Say “implement the Whop migration.”
Whop runs alongside PayPal in production. No staging environment needed, no new dependencies. Routing is controlled by an env var with per-creator override.
PAYOUT_PROVIDER env var defaults to "paypal". Per-creator override: payout_methods.provider column. All routing lives in routes/post_my_cashout.py — one check, not scattered across files.Whop client, webhook controller, migration, both flow paths. PayPal stays default. Deploy with zero behavior change.
Set payout_methods.provider to "whop" on a test creator. Cash out with real money internally.
Enable Whop for 5–10 trusted creators. Verify transfer parity, webhook delivery, and withdrawal timing.
Flip PAYOUT_PROVIDER=whop globally. PayPal path stays in code as fallback until you’re confident.
How funds move from Spencer Agent to creators via Whop.
How your existing schemas and modules map to Whop. These are the columns that get added.
| Your Schema | File | Whop Entity | New Columns |
|---|---|---|---|
uploaders |
db/db.neon.contracted/schema.sql |
Company (connected account) | — linked via payout_methods |
payout_methods |
db/db.neon.contracted/schema.sql |
Payout Method + Company | provider TEXT, whop_company_id TEXT |
payouts |
db/db.neon.contracted/schema.sql |
Transfer (ctt_xxx) |
provider TEXT |
credits |
db/db.neon.contracted/schema.sql |
— | No changes |
| New table | migration | Webhook idempotency | whop_webhook_events (event_id, event_type, processed_at) |
Side-by-side: the calls you have today vs. the Whop equivalents.
POST /v1/oauth2/token — get access tokenPOST /v1/payments/payouts — send payout to emailPOST /companies — create creator accountPOST /transfers — send payout to walletPayPal has no webhooks in your current setup. Whop adds real-time status tracking — this is an upgrade.
| PayPal (Today) | Whop Event | What Happens |
|---|---|---|
| None | payment.succeeded | Platform top-up confirmed |
| None | payment.failed | Platform top-up failed — alert ops |
| None | transfer.completed | Cashout transfer to creator confirmed |
| None | withdrawal.completed | Creator withdrew to bank/crypto |
| None | withdrawal.failed | Creator withdrawal failed — evaluate re-credit |
| None | company.created | Creator connected account confirmed |
/webhooks/whop is a new endpoint. PayPal had no webhook listener — this gives you real-time payout status for the first time.Where Whop fits. Orange is new, green stays unchanged. Both providers coexist.
┌──────────────────────┐
│ earnings.tsx (UI) │
└─────────┬────────────┘
│
┌─────────┴────────────┐
│ POST /me/cashout │
│ get_payout_provider() │
└────┬─────────────┬────┘
│ │
provider= │ │ provider=
"paypal" │ │ "whop"
│ │
┌───────┴──┐ ┌────┴───────┐
│ PayPal │ │ Whop API │
│ Payouts │ │ /transfers │
└─────┬────┘ └────┬───────┘
│ │
│ ┌───┴───────┐
│ │ Creator │
│ │ Whop Wallet │
│ └────┬───────┘
│ │
┌─────┴─────────┴────┐
│ Creator’s bank / │
│ crypto / PayPal │
└────────────────────┘
Live by April 7. PayPal stays live the entire time.
Most of your stack is unchanged. Whop replaces only the payout execution layer.
urllib.