无法使用 Rails 3 服务器让 ActiveMerchant 做出响应
我正在使用 Rails 3.1 和 ActiveMerchant 1.17
我正在调用 PaymentExpress 网关,使用正确的测试信用卡详细信息。但是,它不断给出某种形式的无效响应。
我最多能看出的是,response.params 数组包含
{"re_co"=>"Zz", "response_text"=>"Error in getting response.", "success"=>"0"}
This is using the local Rails server。
我有预感,这可能与 SSL verify_peer 选项有关,尽管我无法证明这一点,而且我不知道如何配置该选项。
这是我的代码,相当标准的东西:
credit_card = ActiveMerchant::Billing::CreditCard.new(params[:credit_card])
gateway = ActiveMerchant::Billing::PaymentExpressGateway.new(:login => APP_CONFIG[:dps_username], :password => APP_CONFIG[:dps_password])
response = gateway.authorize total_cents, credit_card
有趣的是,它似乎在 Rails 控制台上运行良好。我应该采取任何步骤来调试这个吗?
I'm using Rails 3.1 and ActiveMerchant 1.17
I'm calling the PaymentExpress gateway, using the correct test credit card details. However, it keeps giving some form of invalid response.
The most I can make out is that the response.params array contains
{"re_co"=>"Zz", "response_text"=>"Error in getting response.", "success"=>"0"}
This is using the local rails server.
I have a hunch that it may be to do with the SSL verify_peer option, though I have no way of proving that, and I have no idea how to configure that option.
This is my code, fairly standard stuff:
credit_card = ActiveMerchant::Billing::CreditCard.new(params[:credit_card])
gateway = ActiveMerchant::Billing::PaymentExpressGateway.new(:login => APP_CONFIG[:dps_username], :password => APP_CONFIG[:dps_password])
response = gateway.authorize total_cents, credit_card
Interestingly, it seems to work fine from the rails console. Are there any steps I should be taking to debug this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,事实证明问题根本与 ActiveMerchant 无关。
我应该使用
而不是
啊,简单的问题
Ok, it turns out the problem wasn't to do with ActiveMerchant at all.
I should have been using
instead of
Ahh, the simple problems