Skip to content
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

lock stripe api_version used #199

Open
loicginoux opened this issue Mar 1, 2023 · 4 comments
Open

lock stripe api_version used #199

loicginoux opened this issue Mar 1, 2023 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@loicginoux
Copy link
Contributor

for solidus_stripe v5:

Stripe api is versionned and the gem does not clarify what version is used. it should either lock it or make it configurable as an ENV variable.
Not sure what is the best solution but, at least by default it should make it clear and use the last version available:
https://stripe.com/docs/api/versioning
It also ensure that the current documentation correspond to the api the gem is using

Stripe.api_version = '2022-11-15'
@loicginoux loicginoux added the enhancement New feature or request label Mar 1, 2023
@elia
Copy link
Member

elia commented Mar 7, 2023

👍 Probably a payment method preference

@elia elia added this to the v5 milestone Mar 8, 2023
@loicginoux
Copy link
Contributor Author

loicginoux commented Mar 15, 2023

not sure it should be on the payment method preferences, because the gem has a version dependency on the stripe api version.
I realised that on this example that is used on the gem's code:

Stripe::Customer.search({
            query: "email: '#{order.email}'",
          }, stripe_version: "2020-08-27") # search is not supported for previous versions

for this example, my stripe api version globally was 2019-XX-XX. and the search did not work.
If you let my put whatever I want on my method preference, the gem may not work anymore.

if you make it a prefs., maybe having a validation and a minimum stripe api version supported would work...

@waiting-for-dev
Copy link
Contributor

@kennyadsl, different API versions is a good argument in favor of isolating API calls into an adapter class

@kennyadsl
Copy link
Member

@waiting-for-dev right, I don't think we will have a different class for each version (they release very often :P). But people could replace it quickly and use the version they prefer. Also, it's an excellent way to enhance the extension with future features without breaking backward compatibility.

@elia elia modified the milestones: v5, v5.1 Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants