Method: ActiveMerchant::Billing::TransactProGateway#authorize

Defined in:
lib/active_merchant/billing/gateways/transact_pro.rb

#authorize(amount, payment, options = {}) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/active_merchant/billing/gateways/transact_pro.rb', line 47

def authorize(amount, payment, options={})
  post = PostData.new
  add_invoice(post, amount, options)
  add_payment(post, payment)
  add_address(post, payment, options)
  add_customer_data(post, options)
  add_credentials(post)
  post[:rs] = @options[:terminal]

  MultiResponse.run do |r|
    r.process { commit('init_dms', post) }
    r.process do
      post = PostData.new
      post[:init_transaction_id] = r.authorization
      add_payment_cc(post, payment)
      post[:f_extended] = '4'

      commit('make_hold', post, amount)
    end
  end
end