cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Invoice/Description to Ruby SDK - AIM

Hi,

 

I'm working on integrating the AIM payment method using the Ruby SDK. I've followed the instructions in the readme and can successfully process payment:

 

  transaction = AuthorizeNet::AIM::Transaction.new('API_LOGIN', 'API_KEY', :gateway => :sandbox)
  credit_card = AuthorizeNet::CreditCard.new('4111111111111111', '1120')
response = transaction.purchase('10.00', credit_card)

Now, I'd like to add an invoice number and description to the transaction before I make a purchase. I'm lost on how to do this - it looks like I need to create an Order object and somehow attach it to the transaction:

 

order = AuthorizeNet::Order.new(invoice_num: invoice_number, description: description)

 

Calling "transaction.order=" doesn't work however. I'm confused because it seems like there are different transaction models for all of the different payment options...

 

jrohrbaugh
Member
2 REPLIES 2

 

Hi jrohrbaugh,

 

There is not an exact way or method to set the invoice number description with your transaction request. The transaction object allows you to use set_fields to set any AIM API field. Please check: http://www.rubydoc.info/gems/authorizenet/1.8.3/AuthorizeNet/Transaction:set_fields

 

Thanks,

Joy

Joy
Administrator Administrator
Administrator

Hi, did you ever figure out how to add the Order object with invoice number and description in Ruby?  I'm struggling and the documentation is terrible.

firebird
Member