Remove broken dead code branch

The StripeSCA method is forwarding all missing methods to the provider
gateway. The ActiveMerchant gateway used to be decorated by our code and
that's how this code may have worked one day. But we removed the
decorator years ago:

- 549610bc35

A bit later we found that refunds are broken with Stripe:

- https://github.com/openfoodfoundation/openfoodnetwork/issues/12843

This commit could potentiall fix that, I guess? I haven't tested that.
It's a rare use case and not the aim of this work.
This commit is contained in:
Maikel Linke
2026-02-03 12:51:02 +11:00
parent 4650e30c09
commit f9617b8156
2 changed files with 11 additions and 14 deletions

View File

@@ -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?

View File

@@ -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)