-
-
Notifications
You must be signed in to change notification settings - Fork 76
Fix ambiguous behavior in generate_token method #209
Fix ambiguous behavior in generate_token method #209
Conversation
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.
Left same comments of the ones left in #212 (just noticed this one and got the git mess there 👍 )
app/controllers/solidus_paypal_braintree/client_tokens_controller.rb
Outdated
Show resolved
Hide resolved
@skukx thanks! Last thing: I'd also squash everything in a single commit, what do you think? |
@kennyadsl yeah, I'll do that now |
92d164b
to
40b99a9
Compare
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.
Thanks!
@ericsaupe I'm curious if |
40b99a9
to
687b697
Compare
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.
Thanks, this is helpful, but I would rather not use exceptions as control flow. Could we rewrite this without exceptions?
app/controllers/solidus_paypal_braintree/client_tokens_controller.rb
Outdated
Show resolved
Hide resolved
Yes, force pushes trigger a new build on Travis. The random failures are because of the nature of the "not so ideal written" integrations tests. |
@skukx Hey there, from the future! I would like to merge this in soon. Do you have a moment to give this a rebase? Thanks! |
@seand7565 Yes, I'll do that asap |
The `SolidusPaypalBraintree::Gateway#generate_token` method is ambiguous on success and failure. Both results will return a string. To be more explicit, this method should raise an error which can be handled by the app.
9168828
to
8d1d921
Compare
Fantastic, thanks! Looks like there's just two small linting issues and this should be good to go. |
…ler.rb Co-Authored-By: Thomas von Deyen <[email protected]>
8d1d921
to
f28ef52
Compare
This is another breaking change, people relying on that specific response even for failing cases. We will definitely need to release a new version with a clear changelog for this issue. |
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.
Code wise 👌
I agree with Alberto that this is a breaking change, but in a good sense. The former behavior was just wrong.
The
SolidusPaypalBraintree::Gateway#generate_token
method is ambiguouson success and failure. Both results will return a string. To be more
explicit, this method should raise an error which can be handled by the
app.
Closes #208