Closed AlesDspot closed 1 year ago
This plugin is not catching the events canceled or failed in "PaymentFlow" upon canceling the process or even if the actual card is declined... Only listening to Completed event... In "PaymentSheet" failed eventt is working... But kindly fix the Payment Flow one...
I tried even with PaymentSheet, and it also doesn't catch Failed, only Completed
That's right, because Stripe returns completed:
I think the implementation needs to check separately whether the customer's payment has been successfully completed on the back end.
This Issue is closed because the information has not been updated. Thank you.
@rdlabo If thats the case then its a big flaw. If the plugin cannot say whether the transaction is completed or not...not throwing proper errors then how will it be detected anywhere... it should pass at least some parameter to track it down...with payment gateways cant take any chance at all... as it involves money
But that makes it unusable. If the transaction failes, how can you notify the user about this?
For anyone looking at this in the future, when you call Stripe.confirmPaymentFlow(), you can easily check on your backend if the payment has been completed or errors ([stripe.paymentIntents.retrieve] (https://docs.stripe.com/api/payment_intents/retrieve?lang=node) and check if there are last_payment_error), in my case (as I think in many others) you may also use the endpoint to confirm the payment and put eventual data in your db.
Platform
Describe the bug Inputing a test card number which fails (4100000000000019) makes a call to api.stripe.com: https://api.stripe.com/v1/payment_intents/pi_3MdXWFCyDbRyOrdF01urgsUD/confirm
which returns the correct response:
But the confirmPaymentFlow always returns Completed. I cannot seem to catch the event for failed.
Also (not sure if it's related), the Postal code input is disabled and cannot be typed in.
Expected behavior Catch the failed response.