diff --git a/app/models/spree/gateway/stripe_sca.rb b/app/models/spree/gateway/stripe_sca.rb index 10253377bd..fc9768e670 100644 --- a/app/models/spree/gateway/stripe_sca.rb +++ b/app/models/spree/gateway/stripe_sca.rb @@ -106,6 +106,12 @@ module Spree provider.refund(money, payment_intent_id, gateway_options) end + # NOTE: this method is required by Spree::Payment::Processing + def refund(money, payment_intent_id, gateway_options) + gateway_options[:stripe_account] = stripe_account_id + provider.refund(money, payment_intent_id, gateway_options) + end + def create_profile(payment) return unless payment.source.gateway_customer_profile_id.nil? diff --git a/app/models/spree/payment/processing.rb b/app/models/spree/payment/processing.rb index 4a78e9f727..46a1e784fd 100644 --- a/app/models/spree/payment/processing.rb +++ b/app/models/spree/payment/processing.rb @@ -107,20 +107,11 @@ module Spree refund_amount = calculate_refund_amount(refund_amount) - response = if payment_method.payment_profiles_supported? - payment_method.refund( - (refund_amount * 100).round, - source, - response_code, - gateway_options - ) - else - payment_method.refund( - (refund_amount * 100).round, - response_code, - gateway_options - ) - end + response = payment_method.refund( + (refund_amount * 100).round, + response_code, + gateway_options + ) record_response(response)