ViaklixGateway
gateway = ActiveMerchant::Billing::ElavonGateway.new( :login => "my_virtual_merchant_id", :password => "my_virtual_merchant_pin", :user => "my_virtual_merchant_user_id" # optional ) # set up credit card obj as in main ActiveMerchant example creditcard = ActiveMerchant::Billing::CreditCard.new( :type => 'visa', :number => '41111111111111111', :month => 10, :year => 2011, :first_name => 'Bob', :last_name => 'Bobsen' ) # run request response = gateway.purchase(1000, creditcard) # authorize and capture 10 USD puts response.success? # Check whether the transaction was successful puts response.message # Retrieve the message returned by Elavon puts response.authorization # Retrieve the unique transaction ID returned by Elavon
Capture authorized funds from a credit card.
money - The amount to be captured as an Integer value in cents.
authorization - The approval code returned from the initial authorization.
options
:credit_card - The CreditCard details from the initial transaction (required).
# File lib/active_merchant/billing/gateways/elavon.rb, line 72 def capture(money, authorization, options = {}) requires!(options, :credit_card) form = {} add_reference(form, authorization) add_invoice(form, options) add_creditcard(form, options[:credit_card]) add_customer_data(form, options) commit(:capture, money, form) end
Generated with the Darkfish Rdoc Generator 2.