-
Notifications
You must be signed in to change notification settings - Fork 126
feat(stripe): Upgrading Stripe version #3300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
julienbourdeau
wants to merge
1
commit into
main
Choose a base branch
from
feat/stripe-version
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
julienbourdeau
commented
Mar 6, 2025
julienbourdeau
commented
Mar 6, 2025
a62a935
to
6c97773
Compare
vincent-pochet
previously approved these changes
Mar 6, 2025
6c97773
to
f27b70d
Compare
e603a04
to
5113764
Compare
julienbourdeau
added a commit
that referenced
this pull request
May 26, 2025
## Context This PR is part of [upgrading Stripe](#3300) (clients + API version). ## Description This is extracted from #3300. **You cannot update the `api_version` of an existing WebhookEndpoint**. You must create a new WebhookEndpoint with the new version and delete the old one once you migrated. This is the best way to not have any downtime. https://docs.stripe.com/webhooks/versioning It means to set the version for all our customers, we'll need to recreate the endpoint for all organization. It's fine but I'd rather upgrade to a more recent version before we enforce it in the webhook. * Replace `PaymentProviders::StripeService.new.refresh_webhook` by dedicated `RefreshWebhookService` * Tried to make `PaymentProviders::StripeService.create_or_update` a little clearer as secrets cannot be updated
julienbourdeau
added a commit
that referenced
this pull request
Jun 9, 2025
## Context See #3300 ## Description When upgrading stripe versions, your app will continue to receive older version of the webhook for while (exactly like when running rails db migrations) so all modifications made to webhooks processing need to be backward compatible. We run tests with all versions to ensure compat'. **Make sure you hide whitespace to review!** 
rsempe
pushed a commit
that referenced
this pull request
Jun 11, 2025
## Context See #3300 ## Description When upgrading stripe versions, your app will continue to receive older version of the webhook for while (exactly like when running rails db migrations) so all modifications made to webhooks processing need to be backward compatible. We run tests with all versions to ensure compat'. **Make sure you hide whitespace to review!** 
julienbourdeau
added a commit
that referenced
this pull request
Jun 24, 2025
## Roadmap Task 👉 https://getlago.canny.io/feature-requests/p/{{FEATURE_SLUG}} ## Context Everything you need to know: #3300 ## Description From now on, all Stripe API calls made by lago will be made using the API version `2025-04-30.basil`. Lago users can continue to use Stripe in any versions they like on their side. They can keep their stripe account configured with any version too. Until now, Lago would use the user's account version, which could lead to different response shape, breaking the code. It never did yet because we use very core and simple feature of Stripe, but it could in the future.
diegocharles
pushed a commit
that referenced
this pull request
Jul 11, 2025
## Roadmap Task 👉 https://getlago.canny.io/feature-requests/p/{{FEATURE_SLUG}} ## Context Everything you need to know: #3300 ## Description From now on, all Stripe API calls made by lago will be made using the API version `2025-04-30.basil`. Lago users can continue to use Stripe in any versions they like on their side. They can keep their stripe account configured with any version too. Until now, Lago would use the user's account version, which could lead to different response shape, breaking the code. It never did yet because we use very core and simple feature of Stripe, but it could in the future.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
The version of the Stripe can be set in your Stripe account or passed in each requests. Versions are date strings with optional tags.
Note that the API version is unrelated to the version of the gem. FYI we use 6.5.0, latests version is 13.5.0.
With Lago, each customer use their own Stripe account which my use any version by default. We don't set the version explicitly but fortunately we use very stable features and our calls work in all version.
We intend to save the payment method information when we receive the
payment_intent.succeeded
but for the first time, we experienced the difference between webhook versions. Thecharges
array was removed:Overview
Our current version is
2020-08-27
. We will upgrade to2025-04-30.basil
.The version is set in the client during Rails boot so the client will set it explicitly for all requests.
https://docs.stripe.com/changelog/basil
Webhooks
You cannot update the
api_version
of an existing WebhookEndpoint. You must create a new WebhookEndpoint with the new version and delete the old one once you migrated. This is actually the best way to not have any downtime.https://docs.stripe.com/webhooks/versioning
It means to set the version for all our customers, we'll need to recreate the endpoint for all organization. It's fine but before we upgrade the endpoint, we should move to a more recent version. We'll need to keep the fixtures virtually forever for the same reason we keep migrations.
See #3718
The Plan
feat(stripe): Introduce integration tests (calling Stripe API) #3783
chore(stripe): Add fixtures version and helper #3723
2025-04-30.basil
feat(stripe): Prepare test suite to use Stripe 2025-04-30.basil #3787
feat(stripe): Ensure webhook specs run with multiple versions #3799
feat(stripe): Fix Stripe.api_version to
2025-04-30.basil
#3823stripe
gem to latest versionOther related PRs