diff --git a/app/models/spree/gateway/stripe_sca.rb b/app/models/spree/gateway/stripe_sca.rb index 21fa698c3b..02681ae210 100644 --- a/app/models/spree/gateway/stripe_sca.rb +++ b/app/models/spree/gateway/stripe_sca.rb @@ -57,8 +57,11 @@ module Spree # NOTE: the name of this method is determined by Spree::Payment::Processing def void(response_code, _creditcard, gateway_options) + payment_intent_id = response_code + payment_intent_response = Stripe::PaymentIntent.retrieve(payment_intent_id, + stripe_account: stripe_account_id) gateway_options[:stripe_account] = stripe_account_id - provider.void(response_code, gateway_options) + provider.refund(payment_intent_response.amount_received, response_code, gateway_options) end # NOTE: the name of this method is determined by Spree::Payment::Processing