Forum Moderators: coopster

Message Too Old, No Replies

InvoiceNumber in Authorize.net

Setting the InvoiceNumber field in Authorize.net

         

SeanF

1:05 am on Aug 10, 2019 (gmt 0)

5+ Year Member Top Contributors Of The Month



Hi

I am hoping someone with some experience programming with the Authorize.net PHP AIM API can help me:

I am trying to set the field "invoiceNumber" so that it will show up in the authorize.net Transaction Details report.

Currently, my code looks like:
 $transaction = new AuthorizeNetAIM;
$transaction->setFields(
array(
'amount' => $pmt_amt,
'invoice_number' => $invoice_number,
'invoice_num' => $invoice_number,
'card_num' => $_POST['x_card_num'],
'exp_date' => $_POST['x_exp_date'],
'first_name' => $_POST['x_first_name'],
'last_name' => $_POST['x_last_name'],
'company' => $_POST['x_company'],
'address' => $_POST['x_address'],
'city' => $_POST['x_city'],
'state' => $_POST['x_state'],
'country' => $_POST['x_country'],
'zip' => $_POST['x_zip'],
'email' => $_POST['x_email'],
'card_code' => $_POST['x_card_code'],
)
);
$response = $transaction->authorizeAndCapture();

But I don't think "invoice_number" and "invoice_num" actually do anything
Some research on the web show that I need to set:
 $order = new AnetAPI\OrderType();
$order->setInvoiceNumber("10101");

But I am not sure how that fits into the code I already have.

Can anyone give me some pointers?

Thanks

not2easy

3:46 am on Aug 10, 2019 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I set up an Authorize.net connection but it was over 15 years ago. For my setup, the Invoice Number was generated by my shopping cart. Your setup may be very different, but you might want to look at your cart documentation. Also check with Authorize.net, they may still offer instructions for integration with various carts.

SeanF

9:29 am on Aug 10, 2019 (gmt 0)

5+ Year Member Top Contributors Of The Month



Thanks for the reply. I guess it's not so much an authorize.net issue as it is an OOP issue. I didn't use a shopping cart, I simply added the authorize.net code directly to my web site.

The question is really "How do i set the "$order" object included in the "$transaction" object so that it is included in the "$response = $transaction->authorizeAndCapture();" statement

(I have much more experience in procedural coding and I'm pretty new to OOP.)

Thanks

Dimitri

11:43 am on Aug 10, 2019 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



I never ever used authorized.net , so I can't help much, however, on this page : [developer.authorize.net...] it says the AIM API is depreciated and it's recommended to us the "Authorize.Net API" : [developer.authorize.net...] .

csdude55

8:14 pm on Aug 18, 2019 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I use AIM, too (built about 7 years ago, but it still works), but I don't set an invoice number. I did some research, and it sounds like you would have to do an authorization with the invoice number first, and then capture it separately:

Currently you must include an Invoice Number or Description in the transaction request. It's not possible at this time to add those values during the capture.


[community.developer.authorize.net...]