From dcc808a8b9c8af7af1450d72126105e1cb0955f3 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 10 Jun 2021 10:39:38 +0100 Subject: [PATCH] Improve #stripe_status return value for failed actions --- app/models/spree/payment.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/spree/payment.rb b/app/models/spree/payment.rb index 8ad498080d..3ec6743e02 100644 --- a/app/models/spree/payment.rb +++ b/app/models/spree/payment.rb @@ -162,6 +162,10 @@ module Spree return if response_code.blank? Stripe::PaymentIntentValidator.new.call(self).status + rescue Stripe::StripeError + # The Stripe::PaymentIntentValidator will raise an error if the Stripe API call indicates + # the last attempted action on the payment intent failed. + "failed" end def stripe_captured?