-
-
Notifications
You must be signed in to change notification settings - Fork 61
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 payment_intent_unexpected_state error when voiding payment intents #115
base: v4
Are you sure you want to change the base?
Fix payment_intent_unexpected_state error when voiding payment intents #115
Conversation
…xpected_state error since it was already voided by Stripe
Codecov Report
@@ Coverage Diff @@
## master #115 +/- ##
==========================================
- Coverage 95.45% 94.69% -0.77%
==========================================
Files 15 15
Lines 352 358 +6
==========================================
+ Hits 336 339 +3
- Misses 16 19 +3
Continue to review full report at Codecov.
|
This issue has been automatically marked as stale because it has not had recent activity. It might be closed if no further activity occurs. Thank you for your contributions. |
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 for your contribution @jfturcot!
I was wondering if there's a way to add this logic to SolidusStripe::PaymentMethod
instead, in order to avoid overriding the payment class (which will be used by other payment methods as well).
The class I referenced has Spree::PaymentMethod
as parent class, which implements a generic try_void
method, which is called when the subclass doesn't implement one.
What do you think? Would it make sense to move this logic there?
Hello @jfturcot! Are you still interested in moving this PR forward? Otherwise, we can probably continue the work to fix the issue. Thanks! |
@kennyadsl Sure! Sorry I have been very busy lately, but I would love to get this merged. I will take a look at it over the weekend. |
@jfturcot any chance you pick this up again? |
Solves #64
If a payment intent has been created but the order is never completed, Stripe will eventually time out the intent and change its state. When a new payment intent is created, it first tries to void all the previous uncompleted payment intents of the user and this would break with the Stripe error payment_intent_unexpected_state since Stripe's state machine does not allow that change.