Class: ActiveMerchant::Billing::Integrations::FirstData::Helper

Inherits:
AuthorizeNetSim::Helper show all
Defined in:
lib/active_merchant/billing/integrations/first_data/helper.rb

Overview

First Data payment pages emulates the Authorize.Net SIM API. See ActiveMerchant::Billing::Integrations::AuthorizeNetSim::Helper for more details.

An example. Note the username as a parameter and transaction key you will want to use later.

payment_service_for('order_id', 'first_data_payment_page_id', :service => :first_data,  :amount => 157.0) do |service|

  # You must call setup_hash and invoice

  service.setup_hash :transaction_key => '8CP6zJ7uD875J6tY',
      :order_timestamp => 1206836763
  service.customer_id 8
  service.customer :first_name => 'g',
                     :last_name => 'g',
                     :email => '[email protected]',
                     :phone => '3'
 service.billing_address :zip => 'g',
                 :country => 'United States of America',
                 :address => 'g'

 service.ship_to_address :first_name => 'g',
                          :last_name => 'g',
                          :city => '',
                          :address => 'g',
                          :address2 => '',
                          :state => address.state,
                          :country => 'United States of America',
                          :zip => 'g'

 service.invoice "516428355" # your invoice number
 # The end-user is presented with the HTML produced by the notify_url
 # (using the First Data Receipt Link feature).
 service.return_url "http://mysite/first_data_receipt_generator_page"
 service.payment_header 'My store name'
 service.add_line_item :name => 'item name', :quantity => 1, :unit_price => 0
 service.test_request 'true' # only if it's just a test
 service.shipping '25.0'
 # Tell it to display a "0" line item for shipping, with the price in
 # the name, otherwise it isn't shown at all, leaving the end user to
 # wonder why the total is different than the sum of the line items.
 service.add_shipping_as_line_item
 server.add_tax_as_line_item # same with tax
 # See the helper.rb file for various custom fields

end

Instance Attribute Summary

Attributes inherited from Helper

#fields

Method Summary

Methods inherited from AuthorizeNetSim::Helper

#add_custom_field, #add_line_item, #add_shipping_as_line_item, #add_tax_as_line_item, #billing_address, #email_merchant_from_authorizes_side, #initialize, #invoice, #setup_hash, #ship_to_address, #yes_email_customer_from_authorizes_side

Methods inherited from Helper

#add_field, #add_fields, #add_raw_html_field, #billing_address, #form_fields, #form_method, #initialize, mapping, #raw_html_fields, #shipping_address, #test?

Constructor Details

This class inherits a constructor from ActiveMerchant::Billing::Integrations::AuthorizeNetSim::Helper

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActiveMerchant::Billing::Integrations::Helper