refactor: replace resolveStripeCustomerId with ensureStripeCustomer, harden sync (refs #209, refs #210)
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 6m33s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 52s
Deploy to Staging / Verify Staging (pull_request) Successful in 9s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 9s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 6m33s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 52s
Deploy to Staging / Verify Staging (pull_request) Successful in 9s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 9s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
Delete resolveStripeCustomerId() and replace with ensureStripeCustomer() that includes orphaned Stripe customer cleanup on DB failure. Make syncTierToUserProfile() blocking (errors propagate). Add null guards to cancel/reactivate for admin-set subscriptions. Fix getInvoices() null check. Clean controller comment. Add deleteCustomer() to StripeClient. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -220,7 +220,7 @@ export class SubscriptionsController {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update payment method via service (handles admin_override_ customer IDs)
|
||||
// Update payment method via service (creates Stripe customer if needed)
|
||||
await this.service.updatePaymentMethod(userId, paymentMethodId, email);
|
||||
|
||||
reply.status(200).send({
|
||||
|
||||
Reference in New Issue
Block a user