mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-20 04:59:16 +00:00
Use new stripe confirm path and remove dead code
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user