pass return_url option to gateway authorize

This commit is contained in:
Andy Brett
2020-12-14 14:06:10 -08:00
parent 802e49bed3
commit 8507dacc10
3 changed files with 6 additions and 6 deletions

View File

@@ -153,7 +153,7 @@ module Spree
def authorize_stripe_sca_payment
return unless @payment.payment_method.class == Spree::Gateway::StripeSCA
@payment.authorize!
@payment.authorize!(spree.order_path(@payment.order, only_path: false))
if @payment.cvv_response_message.present?
PaymentMailer.authorize_payment(@payment).deliver
raise Spree::Core::GatewayError, I18n.t('action_required')

View File

@@ -110,7 +110,7 @@ module Spree
def options_for_authorize(money, creditcard, gateway_options)
options = basic_options(gateway_options)
options[:return_url] = full_checkout_path
options[:return_url] = gateway_options[:return_url] || full_checkout_path
customer_id, payment_method_id =
Stripe::CreditCardCloner.new(creditcard, stripe_account_id).find_or_clone

View File

@@ -23,9 +23,9 @@ module Spree
end
end
def authorize!
def authorize!(return_url = nil)
started_processing!
gateway_action(source, :authorize, :pend)
gateway_action(source, :authorize, :pend, return_url: return_url)
end
def purchase!
@@ -222,7 +222,7 @@ module Spree
refund_amount.to_f
end
def gateway_action(source, action, success_state)
def gateway_action(source, action, success_state, options = {})
protect_from_connection_error do
check_environment
@@ -230,7 +230,7 @@ module Spree
action,
(amount * 100).round,
source,
gateway_options
gateway_options.merge(options)
)
handle_response(response, success_state, :failure)
end