Reply
Highlighted
Member
Posts: 1
Registered: ‎12-17-2012

InvoiceNumber not saved with AuthCapture CIM

I am using the CIM api and passing an invoice number to Authorize.net.  I have two seperate types of transactions, Authorize only, Capture later... and Authorize/Capture.  The code below is pulled directly from the payment module written.  Both types of transactions successfully process.  The code has been stepped through and verified that there is a valid value being passed to invoiceID in the Auth/Capture now scenario, but it does not show up in the invoice column in Auth.net where the Authorize Only does....any clues?  Thanks.

 

This works: (Authorize Only)

        Order oOrder = new Order(ProfileID, ADN_PaymentProfileID, ADN_AddressID);
        oOrder.InvoiceNumber = invoiceID;
        oOrder.AddLineItem("1", "Application Fee", "", 1, ApplicationFee, false);

        // This one will be Authorize now, capture later
        AuthorizeNet.IGatewayResponse orderRespone = cg.Authorize(oOrder);

 

This Does Not: (Authorize/Capture now)

        Order oOrder = new Order(ProfileID, ADN_PaymentProfileID, ADN_AddressID);
        oOrder.InvoiceNumber = invoiceID;
        oOrder.AddLineItem("1", "Application Fee", "", 1, ApplicationFee, false);
        oOrder.AddLineItem("2", "Referal Fee", "", 1, ReferalFee, false);

        AuthorizeNet.IGatewayResponse orderRespone = cg.AuthorizeAndCapture(oOrder);

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: InvoiceNumber not saved with AuthCapture CIM

bug in the dll. in the CustomerGateway.cs

Highlighted
Member
Posts: 1
Registered: ‎03-06-2013

Re: InvoiceNumber not saved with AuthCapture CIM

After line 237 in CustomerGateway.cs add:

 

trans.order = new orderExType();
trans.order.description = order.Description;
trans.order.invoiceNumber = order.InvoiceNumber;
trans.order.purchaseOrderNumber = order.PONumber;

 

I just looked at the Authorize(Order order) method (which was working) and noticed it wasn't getting set.  Once I added it and recompiled, it worked fine.