Remove Simple References to Bogus Gateway

This commit is contained in:
Neal Chambers
2023-10-24 09:42:23 +09:00
parent 74870ff0ad
commit 0663f04535
6 changed files with 1 additions and 16 deletions

View File

@@ -128,10 +128,6 @@ module Spree
def load_providers
providers = Gateway.providers.sort_by(&:name)
unless Rails.env.development? || Rails.env.test?
providers.reject! { |provider| provider.name.include? "Bogus" }
end
unless show_stripe?
providers.reject! { |provider| stripe_provider?(provider) }
end

View File

@@ -59,8 +59,6 @@ module Openfoodnetwork
initializer "spree.register.payment_methods" do |app|
Rails.application.reloader.to_prepare do
app.config.spree.payment_methods = [
Spree::Gateway::Bogus,
Spree::Gateway::BogusSimple,
Spree::PaymentMethod::Check
]
end

View File

@@ -767,12 +767,11 @@ describe Admin::SubscriptionsController, type: :controller do
let!(:paypal) {
Spree::Gateway::PayPalExpress.create!(name: "PayPalExpress", distributor_ids: [shop.id])
}
let!(:bogus) { create(:bogus_payment_method, distributors: [shop]) }
it "only loads Stripe and Cash payment methods" do
controller.send(:load_form_data)
expect(assigns(:payment_methods)).to include payment_method, stripe
expect(assigns(:payment_methods)).to_not include paypal, bogus
expect(assigns(:payment_methods)).to_not include paypal
end
end
end

View File

@@ -18,11 +18,6 @@ FactoryBot.define do
end
end
factory :bogus_payment_method, class: Spree::Gateway::Bogus do
name { 'Credit Card' }
environment { 'test' }
end
factory :stripe_sca_payment_method, class: Spree::Gateway::StripeSCA do
name { 'StripeSCA' }
environment { 'test' }

View File

@@ -138,8 +138,6 @@ describe Spree::PaymentMethod do
.to eq('Cash/EFT/etc. (payments for which automatic validation is not required)')
expect(Spree::Gateway::PayPalExpress.clean_name).to eq('PayPal Express')
expect(Spree::Gateway::StripeSCA.clean_name).to eq('Stripe SCA')
expect(Spree::Gateway::BogusSimple.clean_name).to eq('BogusSimple')
expect(Spree::Gateway::Bogus.clean_name).to eq('Bogus')
end
it "computes the amount of fees" do

View File

@@ -88,7 +88,6 @@ describe OrderSyncer do
let(:payment_method) { subscription.payment_method }
let(:new_payment_method) { create(:payment_method, distributors: [subscription.shop]) }
let(:invalid_payment_method) { create(:payment_method, distributors: [create(:enterprise)]) }
let(:bogus_payment_method) { create(:bogus_payment_method, distributors: [subscription.shop]) }
let(:syncer) { OrderSyncer.new(subscription) }
context "when the payment method on an order is the same as the subscription" do