我正在尝试使用 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
有人遇到这样的错误吗?
谢谢,乌里