From 072f4f4c6083d5c1833d4aad8b48e867822706c1 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 16 Dec 2021 23:21:19 +0000 Subject: [PATCH] Use new stripe confirm path and remove dead code --- app/controllers/spree/admin/payments_controller.rb | 2 -- app/helpers/full_url_helper.rb | 13 ------------- app/models/spree/gateway/stripe_sca.rb | 4 +--- 3 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 app/helpers/full_url_helper.rb diff --git a/app/controllers/spree/admin/payments_controller.rb b/app/controllers/spree/admin/payments_controller.rb index 73a7ac7764..ffe0a13b3c 100644 --- a/app/controllers/spree/admin/payments_controller.rb +++ b/app/controllers/spree/admin/payments_controller.rb @@ -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 diff --git a/app/helpers/full_url_helper.rb b/app/helpers/full_url_helper.rb deleted file mode 100644 index 8c448f71fb..0000000000 --- a/app/helpers/full_url_helper.rb +++ /dev/null @@ -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 diff --git a/app/models/spree/gateway/stripe_sca.rb b/app/models/spree/gateway/stripe_sca.rb index 29dd5e8b22..5c15fd3429 100644 --- a/app/models/spree/gateway/stripe_sca.rb +++ b/app/models/spree/gateway/stripe_sca.rb @@ -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