上述问题。我有一个提交交易的表单,我正在尝试在沙盒模式下使用它进行测试。每当我在我收到的网站上提交测试详情时:
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.
我假设在沙盒模式下运行时不会出现这种情况,但无法让它以沙盒模式运行..
我已经尝试在我的secrets.yml文件中使用他们的沙箱详细信息: http://integrations.sagepay.co.uk/content/sandbox-testing
但是当我接到
时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
最后在我的配置文件中:
unless Rails.env.production?
ActiveMerchant::Billing::Base.mode = :test
end
ActiveMerchant::Billing::SagePayGateway.simulate = Rails.env.development?
当我在表单中并抛出binding.pry时,ActiveMerchant :: Billing :: Base.mode返回:test和ActiveMerchant :: Billing :: SagePayGateway.simulate为true。
我非常感谢任何关于如何让这个表单以沙箱/测试模式提交而不是直播的建议。