dialexa/authorize_net — pull request #1 by markysharky70 (2012-10-02 17:29:33+00:00)
Title: Fixed missing order invoice number bug in CIM transaction.create_transaction

Fixed bug when passing order object which contains an invoice number, the invoice number was not being passed along in the transaction to authorize.net.

#sample code

order = AuthorizeNet::Order.new(:invoice_num => invoice.id, :description => invoice.description)

transaction = AuthorizeNet::CIM::Transaction.new(ENV['AUTHNET_LOGIN'], ENV['AUTHNET_API_KEY'], :gateway => :sandbox)

response = transaction.create_transaction_auth_capture(invoice.balance_due, customer_profile_id, payment_profile_id, order)

if response.success? && response.direct_response.success?
response.direct_response.fields[:invoice_number]
end