extension installed and found an issue when amazon payment is disable
gogo52cn opened this issue · 4 comments
when the exntion installed but the payment method is not enabled in the back end. The view, _login.html.erb will throw an exception because the code call the "preferred_test_mode" method on "nil".
I suggest adding conditions to avoid this issue.
<% amazon_payment_instances = Spree::Gateway::Amazon.all
if amazon_payment_instances.count == 1
amazon = amazon_payment_instances.last
if amazon.preferences[:test_mode] && spree_current_user.try(:admin?) || !amazon.preferences[:test_mode] %>
also the
It looks like there was a formatting error with the last part of your issue (also the... onwards) so I'm unable to comment on that.
Test mode isn't necessarily meant to be restricted to admin users.
I've solved this in PR #17 by hiding the ability to get to the amazon screens when it isn't configured.
Hi Matt.
Sorry. I meant there seems to be a closing div tag missing in this partial which may mess up the footer part of the site.
@gogo52cn A fix for this has now been merged.