mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-28 01:53:25 +00:00
pass return_url option to gateway authorize
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user