Use new stripe confirm path and remove dead code

This commit is contained in:
Matt-Yorkley
2021-12-16 23:21:19 +00:00
parent 3f3bfadb59
commit 072f4f4c60
3 changed files with 1 additions and 18 deletions

View File

@@ -3,8 +3,6 @@
module Spree
module Admin
class PaymentsController < Spree::Admin::BaseController
include FullUrlHelper
before_action :load_order, except: [:show]
before_action :load_payment, only: [:fire, :show]
before_action :load_data

View File

@@ -1,13 +0,0 @@
# frozen_string_literal: true
module FullUrlHelper
def url_helpers
# This is how we can get the helpers with a usable root_url outside the controllers
Rails.application.routes.default_url_options = ActionMailer::Base.default_url_options
Rails.application.routes.url_helpers
end
def full_checkout_path
URI.join(url_helpers.root_url, url_helpers.checkout_path).to_s
end
end

View File

@@ -10,8 +10,6 @@ require 'active_merchant/billing/gateways/stripe'
module Spree
class Gateway
class StripeSCA < Gateway
include FullUrlHelper
VOIDABLE_STATES = [
"requires_payment_method", "requires_capture", "requires_confirmation", "requires_action"
].freeze
@@ -143,7 +141,7 @@ module Spree
def options_for_authorize(money, creditcard, gateway_options)
options = basic_options(gateway_options)
options[:return_url] = gateway_options[:return_url] || full_checkout_path
options[:return_url] = gateway_options[:return_url] || payment_gateways_confirm_stripe_url
customer_id, payment_method_id =
Stripe::CreditCardCloner.new(creditcard, stripe_account_id).find_or_clone