【发布时间】:2014-01-21 15:18:44
【问题描述】:
我正在尝试使用 ActiveMerchant 文档中的示例进行测试付款,我收到结果=508,消息=无效时间戳:值超出允许限制的响应。
这是我正在使用的代码:
ActiveMerchant::Billing::Base.mode = :test
gateway = ActiveMerchant::Billing::RealexGateway.new(
:login => 'myUsername',
:password => 'myPassword')
amount = 1000 # $10.00
credit_card = ActiveMerchant::Billing::CreditCard.new(
:first_name => 'Bob',
:last_name => 'Bobsen',
:number => 'valid card number',
:month => '8',
:year => '2015',
:verification_value => '123')
if credit_card.valid?
response = gateway.purchase(amount, credit_card)
if response.success?
puts "Successfully charged $#{sprintf("%.2f", amount / 100)} to the credit card #{credit_card.display_number}"
else
raise StandardError, response.message
end
end
有人遇到过这样的错误吗?
谢谢, 乌里
【问题讨论】:
标签: ruby-on-rails activemerchant realex-payments-api