Skip to content

Remove Stripe::CardError leftover#58

Merged
aldesantis merged 1 commit into
solidusio:masterfrom
spaghetticode:spaghetticode/remove-stripe-gem-leftovers
May 16, 2020
Merged

Remove Stripe::CardError leftover#58
aldesantis merged 1 commit into
solidusio:masterfrom
spaghetticode:spaghetticode/remove-stripe-gem-leftovers

Conversation

@spaghetticode

Copy link
Copy Markdown
Member

Fixes #55

The error Stripe::CardError is defined inside the official Stripe gem, which was used in the beginnig for developing a early version of the payment intents flow. We later switched to Active Merchant in order to reduce the number of dependencies, as the latter was already in use on this extension and since version 1.101 is capable of handing Stripe Payment Intents as well.

The begin/rescue block was completely removed since there's no known error that can be generated during the creation of the Payment Intent that makes sense to rescue. This is also due to the fact that Active Merchant already tries to manage many possible errors at a lower level.

The fact that this leftover remained unnoticed for so long is proof that no error is usually generated in that part of the code, @rainerdema was able to exercise the rescue block while writing tests, where current_order was left to nil by mistake.

The error `Stripe::CardError` is defined inside the official Stripe gem,
which was used in the beginnig for developing a early version of the
payment intents flow. We later switched to Active Merchant in order to
reduce the number of dependencies, as the latter was already in use on
this extension and since version 1.101 is capable of handing Stripe
Payment Intents as well.

The begin/rescue block was completely removed since there's no known
error that can be generated during the creation of the Payment Intent
that makes sense to rescue. This is also due to the fact that Active
Merchant already tries to manage many possible errors at a lower level.
The fact that this leftover remained unnoticed for so long is proof
that no error is usually generated in that part of the code.
@spaghetticode spaghetticode self-assigned this May 15, 2020

@aldesantis aldesantis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the detailed explanation and the fix @spaghetticode.

@aldesantis aldesantis merged commit d519c17 into solidusio:master May 16, 2020
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.

Payment Intent creation exception handling with class not present in the gem

2 participants