change states after failure/requiring auth

This commit is contained in:
Andy Brett
2021-05-27 15:21:00 -07:00
parent a3d9f1f3cc
commit 674ca3026b
2 changed files with 2 additions and 0 deletions

View File

@@ -240,6 +240,7 @@ module Spree
if response.cvv_result
self.cvv_response_code = response.cvv_result['code']
self.cvv_response_message = response.cvv_result['message']
self.require_authorization if self.cvv_response_message.present?
end
end
__send__("#{success_state}!")

View File

@@ -41,6 +41,7 @@ class ProcessPaymentIntent
Result.new(ok: true)
else
payment.failed_authorization
Result.new(ok: false, error: I18n.t("payment_could_not_complete"))
end