jeudi 30 novembre 2017

Rails - Sagepay - Forcing sandbox mode for transactions

Question as above. I've a form submitting a transaction and I'm trying to use it in sandbox mode to test. Whenever I submit the test details on the site I receive:

The IP address of the server sending the transaction does not match the valid IP address ranges listed in the Simulator.
The IP address Simulator sees for your server is ****.
You can add this IP in the Accounts section of Simulator if you wish.

I'm assuming when running in sandbox mode this won't be the case, however can't get it to process in sandbox mode..

I've tried using their sandbox details in my secrets.yml file: http://ift.tt/2zRcyEP

But when I do I receive

Simulator cannot find your vendor name in its database. The simulator saw the Vendor Name 'sandbox' - See more at: http://localhost:5000/portal/expeditions/redland-green-2018/17606/payment-schedule/add-payment#sthash.iuYLoZkL.dpuf

Finally in my config files:

unless Rails.env.production?
  ActiveMerchant::Billing::Base.mode = :test
end

ActiveMerchant::Billing::SagePayGateway.simulate = Rails.env.development?

When I'm in the form and throw in a binding.pry, ActiveMerchant::Billing::Base.mode returns :test and ActiveMerchant::Billing::SagePayGateway.simulate is true.

Any advice as to how I can get this form to submit in sandbox / testing mode rather than live is greatly appreciated.

Aucun commentaire:

Enregistrer un commentaire