Authorize.net options

32 views
Skip to first unread message

Josh

unread,
Jan 4, 2008, 8:16:21 PM1/4/08
to Active Merchant
How does one go about passing values like Invoice ID, Description, and
e-mail to Authorize.net? Also, how do you get the transaction ID back?
I have been looking around the API and can't find the code anywhere.

Cody Fauser

unread,
Jan 4, 2008, 8:22:30 PM1/4/08
to activem...@googlegroups.com
Josh,

The 'invoice_id' field is mapped to ActiveMerchant's :order_id option, the 'description' field is mapped to AM's :description option, and the 'email' field to AM's :email option.

This would look something like the following:

gateway = ActiveMerchant::Billing::AuthorizeNetGateway.new (:login => 'l', :password => 'p')

response = gateway.purchase(100, credit_card,
  :order_id => '1025',
  :description => 'Store purchase',
  :email => 'co...@example.com'
)

# The transaction ID is returned in the method Response#authorization
puts response.authorization

Take a look at the file remote_authorize_net_test.rb for some good examples.


--
Cody Fauser
http://shopify.com - e-commerce done right
http://www.codyfauser.com - blog
http://www.oreilly.com/catalog/rjsrails - RJS Templates for Rails
Message has been deleted

Cody Fauser

unread,
Jan 5, 2008, 12:27:35 PM1/5/08
to activem...@googlegroups.com
Josh,

It should return a transaction ID using the test credentials in the test environment, but only if Test Mode is off. 

ActiveMerchant::Billing::Base.mode controls whether or not AuthorizeNetGateway will use the test or live servers. Constructing the gateway with :test => true will enable what Authorize.net calls Test Mode. Test Mode is available in both Authorize.net's test and live servers.

This has been discussed before on the list if you need more explanation.



On 1/5/08, Josh <jdel...@voxxit.com> wrote:

Cody,

Does Authorize.net even pass back a transaction ID during test mode?

On Jan 4, 8:22pm, "Cody Fauser" <codyfau...@gmail.com> wrote:

> # The transaction ID is returned in the method Response#authorization
> puts response.authorization
>
> Take a look at the file remote_authorize_net_test.rb for some good examples.


Reply all
Reply to author
Forward
0 new messages