lib/solidus_nexio/engine.rb in solidus_nexio-0.5.1 vs lib/solidus_nexio/engine.rb in solidus_nexio-0.5.2
- old
+ new
@@ -21,11 +21,17 @@
end
config.after_initialize do |app|
app.config.spree.payment_methods << SolidusNexio::PaymentMethod
::Spree::PermittedAttributes.source_attributes.push(:encrypted_number)
+
app.config.spree.payment_methods << SolidusNexio::AlternativePaymentMethod
- ::Spree::PermittedAttributes.checkout_payment_attributes[0][:payments_attributes].push(:nexio_apm_transaction_id)
+ ::Spree::PermittedAttributes.checkout_payment_attributes.each do |item|
+ next unless item.is_a?(Hash) && item.key?(:payments_attributes)
+
+ item[:payments_attributes].push(:nexio_apm_transaction_id)
+ end
+
SolidusNexio::Engine.routes.default_url_options = app.routes.default_url_options
end
unless Rails.env.production?
initializer 'solidus_nexio.setup_gateway_logger' do