I'm trying to make a test payment using the example in the ActiveMerchant documentation and i'm getting a response with result=508, message= Invalid timestamp: Value exceeds allowable limit.
This is the code i am using:
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
Anyone encounter such an error?
Thanks, Uri
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