Reply
Highlighted
Solution
Accepted by topic author museminder
‎12-29-2017 08:16 AM
Contributor
Posts: 13
Registered: ‎12-17-2017

Re: Parsing error when creating ARB from existing CIM

I have found the answer to my question.  When setting up an ARB using an existing customer profile you must not include any PaymentType, Order, or BillTo properties in your request.  

 

As you might deduce from my code, I was using the same constructor to create a subscription, and then building a profile if my profile object was not null, but in so doing I left in these lines of code

 

    arbSubscriptionType.setPayment(pmt);
    arbSubscriptionType.setOrder(order);

 

and I left in  

 

    NameAndAddressType name = new NameAndAddressType();
    name.setFirstName(customer.getName());
    name.setLastName(customer.getSurName());

    arbSubscriptionType.setBillTo(name);

 

These should NOT be part of a createsubscription request when it is being created from an existing profile.

 

To clarify things in my code, I have created two separate wrapper methods to construct the create subscription request, one to create a subscription with a fresh set of payment info, and the other that leaves those things out but contains the reference to the existing profile.

 

As it happens, if you leave out the order and payment setters and leave in the billto segment, Authorize.net will return a clear response with a helpful error message that says something like "BillTo should not be used along with profile info".  At least that points you somewhere.  However, if you include the payment and order, all you get is a parsing error.

 

Many thanks to @rajvpate for helping me get on the right track to understanding my error.

Highlighted
Authorize.Net Expert
Posts: 39
Registered: ‎11-28-2017

Re: Parsing error when creating ARB from existing CIM

Hi

 

Glad that you were able to look into this and find a solution.

Apologies I couldnt get back promptly on this.

 

Please let us know in case you have more questions. I will try to be prompt :)

Best wishes for New Year!