class HeartlandPortico class ACH # Credentials include: # developer_i_d # device_id # license_id # password # site_id # user_name # version_nbr def initialize(credentials, test=true) @credentials = credentials @test = test end # Params: # sec_code (PPD for consumer, CCD for corporate) # routing_number # account_number # account_type (CHECKING or SAVINGS) # check_type (PERSONAL, BUSINESS, or PAYROLL) # first_name # last_name # address # city # state # zip # phone def sale(amount, params) client.check_sale( :check_action => 'SALE', # OVERRIDE, RETURN :data_entry_mode => 'MANUAL', # SWIPE :amt => "%.2f" % (amount.to_i / 100.0), :s_e_c_code => params[:sec_code], # PPD, CCD :account_info => { :routing_number => params[:routing_number], :account_number => params[:account_number], #:check_number # Populate this with transaction ID? #:m_i_c_r_data :account_type => params[:account_type], # CHECKING, SAVINGS }, :check_type => params[:check_type], # PERSONAL, BUSINESS, PAYROLL #:verify_info #:check_verify #:a_c_h_verify :consumer_info => { :first_name => params[:first_name], :last_name => params[:last_name], :check_name => params[:memo], :address1 => params[:address], #:address2 :city => params[:city], :state => params[:state], :zip => params[:zip], :phone_number => params[:phone], #:email_address => params[:email], #:d_l_state #:d_l_number #:courtesy_card #:identity_info #:s_s_n_l4 #:d_o_b_year } #:additional_txn_fields #:payment_method_key #:recurring_data #:token_value ) end def void(authorization) client.check_void(authorization) end private def client HeartlandPortico.new(@credentials, @test) end end end