-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Stripe API upgrade #8405
Stripe API upgrade #8405
Conversation
https://docs.stripe.com/changelog/2019-03-14/renames-date-field-invoices-created
Need to change
Should also add test examples to catch this. |
https://docs.stripe.com/changelog/2018-02-05/plans-link-individual-products-several-fields-moved
Need to change
Should also add test examples to catch this. |
https://docs.stripe.com/changelog/2018-07-27/coupons-use-floats-specify-percent-off
Need to check the calculations in alaveteli/app/models/alaveteli_pro/subscription_with_discount.rb Lines 74 to 80 in fb4d9f5
|
75cc85b
to
499acb0
Compare
The above comments have been addressed. While I can write failing tests for them (stripe-ruby-mock doesn't enforce valid attributes, and it does expand Stripe resources) I have ensured they are all fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question about a plan.name
that's left. There's also one more mention in app/models/webhook.rb that could be updated, but I guess you'd have to call something else to get the product name - the webhook includes the new data as well as the old, I've just checked (e.g. https://dashboard.stripe.com/events/evt_1QA8dQLoAAr9vgdbpgEl1nZm ) so you could switch there, but might not be worth it.
Sorry, after reviewing the last PR (incoming soon), I have a question - the commit message here says "Bumps the API version to the latest version support by stripe-ruby-mock." - but according to https://github.com/stripe-ruby-mock/stripe-ruby-mock/blob/master/CHANGELOG.md it supports up to SDK v11 which is the most recent Stripe SDK? Just checking I hadn't missed something there. Think the only major change since the one you're upgrading to here is the change from tax_percent to tax rate IDs. |
In the I tried later versions of the Stripe API version but unfortunately it resulted in so many broken specs. The change to allow SDK v11 is just a change to relax the version requirement on the main Stripe ruby client gem. It does nothing to actually support those changes. |
Use Stripe mocks instead of doubles. Ideally this would mean if the attributes change upstream we get test failures, unfortunately this doesn't appear to happen due to how stripe-ruby-mock works.
Bumps the API version to the latest version support by stripe-ruby-mock. Also remove gem lock allowing us to upgrade both stripe-ruby-mock and the main stripe gem. Fixes broken tests and other changes which aren't testable, such as: 1. Invoice#date being rename Invoice#created 2. Plan#name being moved to Plan#product & Product#name and not loaded/ expanded automatically.
These have been replaced with calls to `create` or `update`.
eb0f277
to
157d9bf
Compare
Since Stripe API version upgrade [1] in core this hasn't worked as expected. This is because of changes to ProAccount#update_stripe_customer required to support the newer API and changes to prevent deprecation warnings. [1] mysociety/alaveteli#8405
Since Stripe API version upgrade [1] in core this hasn't worked as expected. This is because of changes to ProAccount#update_stripe_customer required to support the newer API and changes to prevent deprecation warnings. [1] mysociety/alaveteli#8405
Since Stripe API version upgrade [1] in core this hasn't worked as expected. This is because of changes to ProAccount#update_stripe_customer required to support the newer API and changes to prevent deprecation warnings. [1] mysociety/alaveteli#8405
What does this do?
Upgrades the Stripe API version used.
Why was this needed?
To hopefully help in migrating from Stripe plans to prices which in turn will help us add new prices and change existing subscriptions.