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

Fail if no payment method on confirm #230

Merged

Conversation

bpcreech
Copy link

I added the ability to add a payment method by ID on confirm here: #226

Per testing with the actual Stripe API, and common sense, we should return a 400 error if neither payment_method nor payment_method_data are supplied to the confirm request (the point of the confirm is to add a payment method, so it makes no sense to call confirm with no payment method). So I added validation and changed an old test case that seemed to be asserting a behavior unlike what Stripe actually does.

This also addresses a one-liner review comment from this PR: #226

I was resetting payment_method_types within the confirm handler. Upon testing, this is not what the real Stripe API does, so I removed that recent addition.

I added the ability to add a payment method by ID on confirm here:
adrienverge#226

Per testing with the actual Stripe API, and common sense, we should return
a 400 error if neither payment_method nor payment_method_data are supplied to
the confirm request (the point of the confirm is to add a payment method, so it
makes no sense to call confirm with no payment method). So I added validation
and changed an old test case that seemed to be asserting a behavior unlike what
Stripe actually does.

This also addresses a one-liner review comment from this PR:
adrienverge#226

I was resetting payment_method_types within the confirm handler. Upon testing,
this is not what the real Stripe API does, so I removed that recent addition.
@bpcreech
Copy link
Author

this is the same as #229 but with a corrected commit message. :) Now I'm doing the right thing for the right reasons, instead of the right thing for the wrong reasons!

Copy link
Collaborator

@H--o-l H--o-l left a comment

Choose a reason for hiding this comment

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

OK thanks, good for me!

Copy link
Owner

@adrienverge adrienverge left a comment

Choose a reason for hiding this comment

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

I haven't tested it, but it makes sense 👍

@H--o-l H--o-l merged commit b90061c into adrienverge:master Sep 26, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants