Merge pull request #6296 from luisramos0/remove_migs

Remove Migs payment gateway
This commit is contained in:
Pau Pérez Fabregat
2021-02-04 22:07:35 +01:00
committed by GitHub
7 changed files with 11 additions and 25 deletions

View File

@@ -396,7 +396,6 @@ Style/CaseEquality:
Style/ClassAndModuleChildren:
Exclude:
- 'app/models/calculator/flat_percent_per_item.rb'
- 'app/models/spree/gateway/migs.rb'
- 'app/models/spree/gateway/pin.rb'
- 'app/models/tag_rule/discount_order.rb'
- 'app/models/tag_rule/filter_order_cycles.rb'
@@ -613,7 +612,6 @@ Style/FrozenStringLiteralComment:
- 'app/models/product_import/unit_converter.rb'
- 'app/models/proxy_order.rb'
- 'app/models/schedule.rb'
- 'app/models/spree/gateway/migs.rb'
- 'app/models/spree/gateway/pin.rb'
- 'app/models/spree/gateway/stripe_connect.rb'
- 'app/models/spree/preferences/file_configuration.rb'

View File

@@ -1,16 +0,0 @@
module Spree
class Gateway::Migs < Gateway
preference :login, :string
preference :password, :string
def provider_class
ActiveMerchant::Billing::MigsGateway
end
def options_with_test_preference
options_without_test_preference.merge(test: preferred_test_mode)
end
alias_method_chain :options, :test_preference
end
end

View File

@@ -125,7 +125,6 @@ module Openfoodnetwork
# Register Spree payment methods
initializer "spree.gateway.payment_methods", :after => "spree.register.payment_methods" do |app|
app.config.spree.payment_methods << Spree::Gateway::Migs
app.config.spree.payment_methods << Spree::Gateway::Pin
app.config.spree.payment_methods << Spree::Gateway::StripeConnect
app.config.spree.payment_methods << Spree::Gateway::StripeSCA

View File

@@ -3444,7 +3444,6 @@ See the %{link} to find out more about %{sitename}'s features and to start using
providers:
provider: "Provider"
check: "Cash/EFT/etc. (payments for which automatic validation is not required)"
migs: "MasterCard Internet Gateway Service (MIGS)"
pin: "Pin Payments"
paypalexpress: "PayPal Express"
stripeconnect: "Stripe"

View File

@@ -0,0 +1,7 @@
class RenameMigsPaymentMethodsToCheck < ActiveRecord::Migration
def change
Spree::PaymentMethod
.where(type: "Spree::Gateway::Migs")
.update_all(type: "Spree::PaymentMethod::Check")
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20210127174120) do
ActiveRecord::Schema.define(version: 20210203215049) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -1252,9 +1252,9 @@ ActiveRecord::Schema.define(version: 20210127174120) do
add_foreign_key "proxy_orders", "subscriptions", name: "proxy_orders_subscription_id_fk"
add_foreign_key "spree_addresses", "spree_countries", column: "country_id", name: "spree_addresses_country_id_fk"
add_foreign_key "spree_addresses", "spree_states", column: "state_id", name: "spree_addresses_state_id_fk"
add_foreign_key "spree_inventory_units", "spree_orders", column: "order_id", on_delete: :cascade
add_foreign_key "spree_inventory_units", "spree_orders", column: "order_id", name: "spree_inventory_units_order_id_fk", on_delete: :cascade
add_foreign_key "spree_inventory_units", "spree_return_authorizations", column: "return_authorization_id", name: "spree_inventory_units_return_authorization_id_fk"
add_foreign_key "spree_inventory_units", "spree_shipments", column: "shipment_id", on_delete: :cascade
add_foreign_key "spree_inventory_units", "spree_shipments", column: "shipment_id", name: "spree_inventory_units_shipment_id_fk", on_delete: :cascade
add_foreign_key "spree_inventory_units", "spree_variants", column: "variant_id", name: "spree_inventory_units_variant_id_fk"
add_foreign_key "spree_line_items", "spree_orders", column: "order_id", name: "spree_line_items_order_id_fk"
add_foreign_key "spree_line_items", "spree_variants", column: "variant_id", name: "spree_line_items_variant_id_fk"
@@ -1290,7 +1290,7 @@ ActiveRecord::Schema.define(version: 20210127174120) do
add_foreign_key "spree_roles_users", "spree_roles", column: "role_id", name: "spree_roles_users_role_id_fk"
add_foreign_key "spree_roles_users", "spree_users", column: "user_id", name: "spree_roles_users_user_id_fk"
add_foreign_key "spree_shipments", "spree_addresses", column: "address_id", name: "spree_shipments_address_id_fk"
add_foreign_key "spree_shipments", "spree_orders", column: "order_id", on_delete: :cascade
add_foreign_key "spree_shipments", "spree_orders", column: "order_id", name: "spree_shipments_order_id_fk", on_delete: :cascade
add_foreign_key "spree_state_changes", "spree_users", column: "user_id", name: "spree_state_changes_user_id_fk"
add_foreign_key "spree_states", "spree_countries", column: "country_id", name: "spree_states_country_id_fk"
add_foreign_key "spree_tax_rates", "spree_tax_categories", column: "tax_category_id", name: "spree_tax_rates_tax_category_id_fk"

View File

@@ -59,7 +59,6 @@ module Spree
it "generates a clean name for known Payment Method types" do
expect(Spree::PaymentMethod::Check.clean_name).to eq(I18n.t("spree.admin.payment_methods.providers.check"))
expect(Spree::Gateway::Migs.clean_name).to eq(I18n.t("spree.admin.payment_methods.providers.migs"))
expect(Spree::Gateway::Pin.clean_name).to eq(I18n.t("spree.admin.payment_methods.providers.pin"))
expect(Spree::Gateway::PayPalExpress.clean_name).to eq(I18n.t("spree.admin.payment_methods.providers.paypalexpress"))
expect(Spree::Gateway::StripeConnect.clean_name).to eq(I18n.t("spree.admin.payment_methods.providers.stripeconnect"))