Skip to content

Remove all payment and Stripe functionality - #148

Merged
ParkerRex merged 1 commit into
devfrom
tooling/migrate-to-bun-biome
Sep 30, 2025
Merged

ParkerRex merged 1 commit into
devfrom
tooling/migrate-to-bun-biome

Conversation

@ParkerRex

@ParkerRex ParkerRex commented Sep 30, 2025 •

Copy link
Copy Markdown
Owner

Removed Components & Pages

  • Deleted components/payments/ directory (12 components)
  • Removed pricing, membership, reactivate pages
  • Removed billing settings page
  • Removed payment admin pages and modals

Removed Backend

  • Deleted convex/stripe/ directory (all Stripe functions)
  • Removed convex/admin/payments.ts
  • Removed subscription/payment helper functions
  • Removed 4 payment-related migration files
  • Removed stripe webhook route

Schema Changes

  • Removed subscriptions, payments, stripeWebhookEvents tables
  • Removed payment fields from members table:
    • tier, subscriptionStatus, subscriptionEndDate
    • billingInterval, stripeCustomerId, stripeSubscriptionId
    • lastPaymentDate, amountCents, lastPaymentFailure
  • Removed by_stripeCustomerId index
  • Removed payment_reminder notification type
  • Removed payment notification category
  • Updated member status (removed 'cancelled', 'churned')

Dependencies

  • Removed stripe package
  • Removed react-number-format package

42 files changed, significant code reduction


Note

Removes all Stripe/payment features (frontend pages/components, backend modules, webhooks) and related DB schema, migrations, and dependencies.

  • Frontend:
    • Delete payment-related UI: app/pricing, app/reactivate, app/settings/billing, app/admin/payments, app/membership/success/*, and all components/payments/* and admin payment modals.
  • Backend (Convex/Next):
    • Remove all Stripe modules: convex/stripe/* (checkout, portal, webhooks, refunds, monitoring, direct checkout, subscription info, retry, reminders).
    • Delete admin payments API: convex/admin/payments.ts.
    • Remove webhook route: app/api/stripe/webhook/route.ts.
    • Drop subscription helpers: convex/helpers/subscriptionAccess.ts and checkout status query.
    • Remove payment-related migrations: convex/migrations/* (import/populate/test/reactivation/status checks).
  • Database Schema (convex/schema.ts):
    • Remove tables: subscriptions, payments, stripeWebhookEvents.
    • Strip member payment fields: tier, subscriptionStatus, subscriptionEndDate, billingInterval, stripeCustomerId, stripeSubscriptionId, lastPaymentDate, amountCents, lastPaymentFailure (and related index by_stripeCustomerId).
    • Remove notification types related to payments (payment_reminder) and payment entity category.
    • Simplify member status values (drop cancelled, churned).
  • Dependencies:
    • Remove stripe and react-number-format from package.json.

Written by Cursor Bugbot for commit b99d76b. This will update automatically on new commits. Configure here.

## Removed Components & Pages
- Deleted components/payments/ directory (12 components)
- Removed pricing, membership, reactivate pages
- Removed billing settings page
- Removed payment admin pages and modals

## Removed Backend
- Deleted convex/stripe/ directory (all Stripe functions)
- Removed convex/admin/payments.ts
- Removed subscription/payment helper functions
- Removed 4 payment-related migration files
- Removed stripe webhook route

## Schema Changes
- Removed subscriptions, payments, stripeWebhookEvents tables
- Removed payment fields from members table:
  - tier, subscriptionStatus, subscriptionEndDate
  - billingInterval, stripeCustomerId, stripeSubscriptionId
  - lastPaymentDate, amountCents, lastPaymentFailure
- Removed by_stripeCustomerId index
- Removed payment_reminder notification type
- Removed payment notification category
- Updated member status (removed 'cancelled', 'churned')

## Dependencies
- Removed stripe package
- Removed react-number-format package

42 files changed, significant code reduction
@ParkerRex
ParkerRex merged commit 4b8e0b8 into dev Sep 30, 2025
2 checks passed
@ParkerRex
ParkerRex deleted the tooling/migrate-to-bun-biome branch September 30, 2025 21:15
@claude

claude Bot commented Sep 30, 2025 •

Copy link
Copy Markdown

Claude finished @ParkerRex's task —— View job


Pull Request Review - Payment System Removal

I've completed a comprehensive review of this massive payment system removal PR. Here's my analysis:

Todo List:

  • Analyze the scope and completeness of payment system removal
  • Check for any remaining payment references in the codebase
  • Review schema changes for consistency
  • Assess potential impact on other system components
  • Evaluate cleanup completeness
  • Provide final recommendations

✅ Excellent Work - Well-Executed Large-Scale Removal

This PR demonstrates impressive thoroughness in removing a complex payment system. The 9,314 line reduction across 42 files shows the massive scope and careful execution.

What Was Done Well:

🎯 Comprehensive Component Removal:

  • ✅ Removed entire components/payments/ directory (12 components)
  • ✅ Deleted payment-specific pages (pricing, billing, reactivate, membership success)
  • ✅ Cleaned up admin payment interfaces completely

🗄️ Schema Changes:

  • ✅ Properly removed payment tables (subscriptions, payments, stripeWebhookEvents)
  • ✅ Cleaned up payment fields from members table in convex/schema.ts:82-175
  • ✅ Removed payment-specific indexes and notification types

📦 Dependency Cleanup:

  • ✅ Removed stripe and react-number-format packages from package.json
  • ✅ Clean removal without leaving dead dependencies

⚠️ Critical Issues Requiring Immediate Attention

🔴 BROKEN IMPORTS - WILL CAUSE RUNTIME ERRORS:

Several files still reference deleted Stripe functions that will cause application crashes:

1. Generated API References (convex/_generated/api.d.ts:170-180)

"stripe/checkout": typeof stripe_checkout;
"stripe/directCheckout": typeof stripe_directCheckout;
// ... 9 more deleted stripe imports

Impact: TypeScript compilation will fail, application won't start.

2. Active Frontend Components Still Using Stripe APIs:

  • components/posts/post-paywall-direct.tsx:26 - api.stripe.directCheckout.createDirectCheckout
  • components/members/membership-cta-modal.tsx - api.stripe.checkout.createCheckoutSession
  • app/admin/monitoring/page.tsx - api.stripe.monitoring.* functions
  • app/api/guest-session/route.ts:26 - Direct Stripe SDK usage

3. Backend Functions With Broken References:

  • convex/crons.ts:74 - internal.stripe.renewalReminders.checkAndSendReminders
  • convex/admin/manualWebhookProcessing.ts - Direct Stripe SDK calls

4. Access Control Logic Still References Payment Fields:
convex/helpers/access.ts:29-89 contains extensive subscription logic that will fail:

// These fields no longer exist in schema but are still used
member.subscriptionStatus
member.subscriptionEndDate  
member.tier
member.stripeCustomerId

🔧 Required Follow-Up Actions

PRIORITY 1 - Fix Broken Application:

  1. Regenerate Convex API types - Run convex dev to update generated files
  2. Remove/Replace Paywall Components - These components are now non-functional
  3. Update Access Control Logic - Replace subscription checks with new access model
  4. Remove Stripe SDK imports - Clean up remaining Stripe dependencies

PRIORITY 2 - Clean Up Remaining References:

  1. Update Member Types - Remove payment fields from TypeScript interfaces in convex/members.ts:44-52
  2. Clean Up Analytics - Remove payment-related tracking in lib/analytics.ts
  3. Update Member Profile Components - Remove tier badges and subscription status displays

PRIORITY 3 - Remove Dead Code:

  1. Paywall Copy Library - lib/conversion-copy.ts is now unused
  2. Payment Error Utils - Referenced but deleted lib/payment-error-utils.ts
  3. Migration Cleanup - Remove .bak files and payment migration scripts

🏗️ Architecture Recommendations

Access Control Strategy:
Since you've removed all payment logic, you need to decide on the new access model:

  • Option A: Make all content free (remove all access checks)
  • Option B: Implement simple member-only access (authenticated vs public)
  • Option C: Use a different pricing system (external service, one-time payments, etc.)

Content Migration:
Consider what happens to existing posts marked as premium-only - they may become inaccessible without updated access logic.


📊 Code Quality Assessment

Aspect Rating Notes
Scope Completeness ⭐⭐⭐⭐⭐ Excellent removal of payment infrastructure
Schema Consistency ⭐⭐⭐⭐⭐ Clean schema changes
Component Cleanup ⭐⭐⭐⭐⭐ Thorough removal of UI components
Runtime Safety ⭐⭐⚫⚫⚫ CRITICAL: Multiple broken imports
Documentation ⭐⭐⭐⚫⚫ Missing access model documentation

🎉 Overall Assessment

This is an exceptional large-scale refactor that successfully removed a complex payment system. The thoroughness and attention to detail in removing components, schema, and dependencies is commendable.

However, the broken imports and references are critical issues that must be addressed immediately to prevent application crashes.

Recommendation: Address the broken imports before merging or immediately after to ensure application stability.


@claude

claude Bot commented Sep 30, 2025

Copy link
Copy Markdown

Code Review for PR #148: Remove all payment and Stripe functionality

Thank you for this comprehensive cleanup PR! I've reviewed the changes and have the following feedback:

✅ Strengths

  • Clean removal: The payment/Stripe functionality has been systematically removed across frontend, backend, and database layers
  • Dependency cleanup: Stripe and react-number-format packages properly removed from package.json
  • Schema simplification: Database schema cleanly updated with payment-related tables and fields removed
  • No orphaned code: Migration files and admin interfaces properly cleaned up

🔍 Issues Found

1. Remaining Payment References 🚨

Several files still contain references to payment/subscription functionality that should be addressed:

  • convex/posts.ts: Lines 29, 513-565, 639-695 contain imports and logic for subscriptionAccess and fullContentRequiresTier
  • convex/helpers/subscriptionAccess.ts: This file is imported but should have been removed
  • Various type definitions and member status fields may need updating

2. Missing Access Control Updates ⚠️

With payment tiers removed, the content access control logic needs to be updated:

  • The canViewFullContent and canViewPost functions from helpers/subscriptionAccess are still being used
  • Post paywall logic (isFree field, fullContentRequiresTier) needs a new access model or complete removal

3. Member Status Simplification

The PR mentions removing 'cancelled' and 'churned' statuses, but verify all references are updated:

  • Check migration files that might reference these statuses
  • Ensure any UI components that display member status handle the reduced set

📋 Recommendations

  1. Remove or replace subscription access helpers:

    • Either remove convex/helpers/subscriptionAccess.ts entirely
    • Or replace with simpler access control that doesn't depend on payment tiers
  2. Update post content access logic:

    • Remove fullContentRequiresTier from post queries
    • Decide on new content access model (all free? member-only? admin-only?)
  3. Run comprehensive search:

    • Search for any remaining references to: tier, subscription, payment, billing, stripe, checkout
    • Update or remove as appropriate
  4. Test coverage:

    • Ensure any tests that relied on payment functionality are updated or removed
    • Add tests for the new simplified access control model
  5. Documentation updates:

    • Update CLAUDE.md to remove payment-related sections
    • Document the new content access model

🎯 Next Steps

Before merging, please address:

  1. The remaining subscription access imports and logic in convex/posts.ts
  2. Define and implement the new content access control strategy
  3. Clean up any orphaned helper functions

The overall approach is solid - just needs these final cleanup items to ensure the codebase is fully consistent without payment functionality.

Great work on this significant refactor! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant