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

Fix multiple Stripe-Version headers when creating ephemeral key #613

Merged
merged 1 commit into from
Jun 29, 2020

Conversation

jayjun
Copy link
Contributor

@jayjun jayjun commented Jun 27, 2020

Creating an ephemeral key requires passing in a Stripe API version given by the iOS or Android SDK (see documentation). However, Stripe.EphemeralKey.create returns an error because multiple Stripe-Version headers are sent.

Stripe.EphemeralKey.create(%{customer: "cus_xxxxxxxxxxxxxx"}, "2019-05-16")
{:error,
 %Stripe.Error{
   code: :invalid_request_error,
   extra: %{
     http_status: 400,
     raw_error: %{
       "message" => "Invalid Stripe API version: 2019-05-16, 2019-12-03",
       "type" => "invalid_request_error"
     }
   },
   message: "Invalid Stripe API version: 2019-05-16, 2019-12-03",
   request_id: nil,
   source: :stripe,
   user_message: nil
 }}

This pull request overrides the default API version set using the one passed in, and updates links to the latest documentation.

Fixes #606.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 89.855% when pulling a5f0df2 on jayjun:version into 60d69dd on code-corps:master.

Copy link
Collaborator

@snewcomer snewcomer left a comment

Choose a reason for hiding this comment

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

Great find!!

@snewcomer snewcomer merged commit 0dc01d2 into beam-community:master Jun 29, 2020
@jayjun jayjun deleted the version branch June 29, 2020 02:32
jalexander pushed a commit to Frameio/stripity_stripe that referenced this pull request Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Invalid Stripe API version: 2019-12-03, 2019-12-03
3 participants