0

我正在尝试使用 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

有人遇到这样的错误吗?

谢谢,乌里

4

1 回答 1

2

This error means that the timestamp you sent in the request is more than 24 hours out of date. Can you check the time on the server and make sure it is accurate?

This isn't a very good message - apologies for that! Owen

于 2014-01-22T14:20:14.543 回答