Skip to content

refactor(stripe): read subscriptions with the new Stripe API version - #428

Merged
xabg2 merged 1 commit into
refactor/stripe-v18-preparationfrom
refactor/stripe-basil-subscriptions
Oct 28, 2026
Merged

xabg2 merged 1 commit into
refactor/stripe-v18-preparationfrom
refactor/stripe-basil-subscriptions

Conversation

@xabg2

@xabg2 xabg2 commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

What's new

  • Second step of the Stripe SDK upgrade: subscriptions are now read with the new Stripe API version, while the rest of the code keeps using the current one until its turn comes.
  • The next payment date and the end of the current billing period are taken from where the new Stripe version provides them, so they keep showing correctly after the upgrade.

Depends on #427.

List and retrieve subscriptions with the Stripe client pinned to 2025-08-27.basil and read the current period end from the subscription item.
@xabg2 xabg2 added the enhancement New feature or request label Oct 26, 2026
@xabg2 xabg2 self-assigned this Oct 26, 2026
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
83.3% Coverage on New Code (required ≥ 85%)

See analysis details on SonarQube Cloud

@xabg2
xabg2 added this pull request to stack #433 October 27, 2026 07:37
@xabg2
xabg2 marked this pull request as ready for review October 27, 2026 09:37
@xabg2
xabg2 requested review from jzunigax2 and sg-gs as code owners October 27, 2026 09:37

const result = await paymentService.getUserSubscription('cus_test', UserType.Individual);

expect(result.type === 'subscription' && result.nextPayment).toBe(1800000000);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a bit hacky, try to be more explicit. Better to be clear about this:

expect(result.type === 'subscription').toBe(true);
expect(result.nextPayment).toBe(1800000000);

@sg-gs sg-gs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am pre-approving, please review that detail @xabg2 and feel free to merge if needed.

@xabg2
xabg2 merged commit 88eaa73 into master Oct 28, 2026
13 of 14 checks passed
@xabg2
xabg2 deleted the refactor/stripe-basil-subscriptions branch October 28, 2026 08:30

This branch was previously deployed

1 inactive deployment
test — 86c79147 Deployed Oct 26, 2026 by xabg2 via Run tests (24.11.0) #1178
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ready-for-preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants