ActiveMerchant响应错误:“无效的时间戳:值超出允许的限制”

时间:2014-01-21 15:18:44

标签: ruby-on-rails activemerchant realex-payments-api

我正在尝试使用ActiveMerchant文档中的示例进行测试付款,我收到的结果为= 508,message = Invalid timestamp:Value超出允许限制。

这是我正在使用的代码:

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

有人遇到过这样的错误吗?

谢谢, URI

1 个答案:

答案 0 :(得分:2)

此错误表示您在请求中发送的时间戳超过24小时已过期。你能检查服务器上的时间并确保它准确吗?

这不是一个非常好的消息 - 为此道歉! 欧文