mollie / spree-mollie-gateway

Mollie payments for Spree Commerce.
https://www.mollie.com
16 stars 23 forks source link

Error running: bundle exec rails g spree_mollie_gateway:install #83

Closed dickboogerd closed 4 years ago

dickboogerd commented 4 years ago

When running the above command, I get the error that the constantSpree::CheckoutControllerDecorator is not defined. Please see the complete error message below. Can you have a look at that? Thanks and Kind Regards

/Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/zeitwerk-2.2.2/lib/zeitwerk/loader/callbacks.rb:17:in on_file_autoloaded': expected file /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/spree_mollie_gateway-3.0.3/app/controllers/spree/checkout_controller_decorator.rb to define constant Spree::CheckoutControllerDecorator, but didn't (Zeitwerk::NameError) from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/zeitwerk-2.2.2/lib/zeitwerk/kernel.rb:17:inblock in require' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/zeitwerk-2.2.2/lib/zeitwerk/kernel.rb:16:in tap' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/zeitwerk-2.2.2/lib/zeitwerk/kernel.rb:16:inrequire' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/spree_auth_devise-4.0.0/lib/controllers/frontend/spree/checkout_controller_decorator.rb:2:in <top (required)>' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:inload' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in load' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/spree_auth_devise-4.0.0/lib/spree/auth/engine.rb:46:inblock in activate' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/spree_auth_devise-4.0.0/lib/spree/auth/engine.rb:45:in glob' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/spree_auth_devise-4.0.0/lib/spree/auth/engine.rb:45:inactivate' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:429:in instance_exec' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:429:inblock in make_lambda' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:201:in block (2 levels) in halting' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:607:inblock (2 levels) in default_terminator' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:606:in catch' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:606:inblock in default_terminator' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:202:in block in halting' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:514:inblock in invoke_before' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:514:in each' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:514:ininvoke_before' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/callbacks.rb:134:in run_callbacks' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/reloader.rb:88:inprepare!' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/railties-6.0.2.1/lib/rails/application/finisher.rb:113:in block in <module:Finisher>' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/railties-6.0.2.1/lib/rails/initializable.rb:32:ininstance_exec' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/railties-6.0.2.1/lib/rails/initializable.rb:32:in run' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/railties-6.0.2.1/lib/rails/initializable.rb:61:inblock in run_initializers' from /Users/dickboogerd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:228:in block in tsort_each' from /Users/dickboogerd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:350:inblock (2 levels) in each_strongly_connected_component' from /Users/dickboogerd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:431:in each_strongly_connected_component_from' from /Users/dickboogerd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:349:inblock in each_strongly_connected_component' from /Users/dickboogerd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:347:in each' from /Users/dickboogerd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:347:incall' from /Users/dickboogerd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:347:in each_strongly_connected_component' from /Users/dickboogerd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:226:intsort_each' from /Users/dickboogerd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/tsort.rb:205:in tsort_each' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/railties-6.0.2.1/lib/rails/initializable.rb:60:inrun_initializers' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/railties-6.0.2.1/lib/rails/application.rb:363:in initialize!' from /Users/dickboogerd/rails/flexistore/config/environment.rb:5:in<top (required)>' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:inblock in require_with_bootsnap_lfi' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:inrequire_with_bootsnap_lfi' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/polyglot-0.3.5/lib/polyglot.rb:65:inrequire' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/zeitwerk-2.2.2/lib/zeitwerk/kernel.rb:23:in require' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:inblock in require' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in load_dependency' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:inrequire' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/spring-2.1.0/lib/spring/application.rb:106:in preload' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/spring-2.1.0/lib/spring/application.rb:157:inserve' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/spring-2.1.0/lib/spring/application.rb:145:in block in run' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/spring-2.1.0/lib/spring/application.rb:139:inloop' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/spring-2.1.0/lib/spring/application.rb:139:in run' from /Users/dickboogerd/.rvm/gems/ruby-2.5.1/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in<top (required)>' from /Users/dickboogerd/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' from /Users/dickboogerd/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:inrequire' from -e:1:in `

'

Oldharlem commented 4 years ago

Seems to be an issue with the spree decorator pattern on newer ruby versions. Will push an update tomorrow.

Oldharlem commented 4 years ago

84 should fix this issue. Can you post an update about if this works for you?

dickboogerd commented 4 years ago

I have installed the gem now without errors. So, the fix works. I was also able to setup the mollie payment method in the backed. However a new issue arised at the frontend. In the payment step of the checkout I receive the following error when I select Mollie and press Save and Continue:

_There were problems with the following fields:

Payments source can't be blank_

Not sure yet where this is coming from but it prevents me from completing the order. I have already checked my website profile in the Mollie portal and there is one active payment method(Ideal).

Can you have a look at that too?

Thanks!

Oldharlem commented 4 years ago

Are you using a custom template for the payment step in the checkout or the template provided by mollie?

dickboogerd commented 4 years ago

I am not using any custom templates at the moment. I am currently focussing on getting things working.

dickboogerd commented 4 years ago

Update: I was using a website profile at Mollie with only the Ideal payment method active. Once I switched to another profile with also creditcard and paypal active, I was able to complete the order. However, I could only choose between creditcard and paypal. Is the Ideal payment method somehow filtered when a test api key is used?

vernondegoede commented 4 years ago

@dickboogerd All active payment methods will be returned when using the test api key. Our customer support can help debug the issue that you're currently running into. You can reach them by sending an email to info@mollie.com.

As the module is now successfully installed, I'm closing this issue.

Thanks for reporting!