Skip to content

Add payment plan switching - #47

Open
rechner wants to merge 5 commits into
devfrom
rechner/add-switch-plan
Open

rechner wants to merge 5 commits into
devfrom
rechner/add-switch-plan

Conversation

@rechner

@rechner rechner commented Sep 19, 2026

Copy link
Copy Markdown
Member

Closes #41, focused on switching to another payment plan in the same tier with the same subscription period. Mostly to enable Sudoroom members existing pay-what-you-can dues model.

Complicated to include a durable recovery path. Should hopefully tell you when something is wrong/unrecoverable.

  • Add PaymentPlanSwitchOperation model to track Stripe subscription plan changes durably
  • Implement plan switching logic
  • Enables idempotent payment plan switches with Stripe sync

- Add "type": "module" to package.json to enable ES module support
- Extract axios, i18n, and Sentry configuration into src/services/api.ts service module
- Lazy-load apex charts library
- Add PaymentPlanSwitchOperation model to track Stripe subscription plan changes durably
- Implement plan switching logic
- Enables idempotent payment plan switches with Stripe sync
@github-actions

Copy link
Copy Markdown

Created image with name ghcr.io/pawprintprototyping/membermatters:untrusted-pr-image-PawprintPrototyping-rechner-add-switch-plan. WARNING: run this image at your own risk - it was created from a potentially untrusted PR.

xsrfCookieName: 'csrftoken',
xsrfHeaderName: 'X-CSRFTOKEN',
});
import { api } from '../services/api';

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These frontend changes are unrelated to fix compiler warnings

'axios',
'routeGuards',
'capacitor',
'apexcharts',

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apexcharts is hulking, reworked to lazy load on the necessary page instead.

- Add tests for stripe helper functions accepting dict and string objects
- Add test for idempotentcy when profile already at target plan
- Add test for profile drift detection
- Test for database failure tolerance in error recording
- Add test for unconfirmed stripe update retry logic
- Add tests for plan switch validation (missing plan ID, locked member, same plan)
- Add tests for pending and failed operation rejection
- Add tests for subscription item count and price validation
- Add tests for terminal recovery failure reporting
- Improve test coverage for payment plan switch recovery and error handling
@github-actions

Copy link
Copy Markdown

Created image with name ghcr.io/pawprintprototyping/membermatters:untrusted-pr-image-PawprintPrototyping-rechner-add-switch-plan. WARNING: run this image at your own risk - it was created from a potentially untrusted PR.

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.

Add feature to switch membership tiers

1 participant