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: Remove 'id' from the Card update payload. #551

Merged
merged 1 commit into from Oct 12, 2019
Merged

fix: Remove 'id' from the Card update payload. #551

merged 1 commit into from Oct 12, 2019

Conversation

jbottigliero
Copy link
Contributor

Although the id parameter is listed as "Required" in the Stripe documentation. Passing the id as a parameter will result in the following error:

 %Stripe.Error{
   code: :invalid_request_error,
   extra: %{
     http_status: 400,
     param: :id,
     raw_error: %{
       "message" => "A parameter provided in the URL (id) was repeated as a GET or POST parameter. You can only provide this information as a portion of the URL.",
       "param" => "id",
       "type" => "invalid_request_error"
     }
   },
   message: "A parameter provided in the URL (id) was repeated as a GET or POST parameter. You can only provide this information as a portion of the URL.",
   request_id: nil,
   source: :stripe,
   user_message: nil
 }}

This update removes the id from the payload similar to customer.

Removing :id from the guard is also an option (I ran into this issue based on Dialyzer failures).

The test I've added will assert {:error, _}without this change.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 88.467% when pulling 3d3545a on jbottigliero:fix-card-update into 560dbf4 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.

Very nice PR! Thank you 👏

@snewcomer snewcomer merged commit 07a71a1 into beam-community:master Oct 12, 2019
@jbottigliero jbottigliero deleted the fix-card-update branch October 14, 2019 14:02
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.

None yet

3 participants