require 'rubygems'
require 'active_merchant'
# Use the TrustCommerce test servers
ActiveMerchant::Billing::Base.mode = :test
# ActiveMerchant accepts all amounts as Integer values in cents
# $10.00
amount = 1000
# The card verification value is also known as CVV2, CVC2, or CID
credit_card = ActiveMerchant::Billing::CreditCard.new(
:first_name => 'Bob',
:last_name => 'Bobsen',
:number => '349298720353895',
:month => '8',
:year => '2012',
:verification_value => '1234'
)
puts credit_card.valid?
No comments:
Post a Comment