Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Member
Posts: 2
Registered: ‎07-26-2019

PHP API - Setting Billing Phone & Company in a Subscription

[ Edited ]

I can't seem to find the right API methods to allow me to set a customer's billing company and billing phone number. When I used the CustomerAddressType and called setPhoneNumber(), I received an error about it not being a valid child of that namespace.

 

When subscriptions are created via the API, I see the "phone" and "company" are blank - how can I set them into an ARB subscription via the API? 

 

The email field is also blank and I would like to populate that progamatically with the newly created subscription.

Member
Posts: 2
Registered: ‎07-26-2019

Re: PHP API - Setting Billing Phone & Company in a Subscription

This is the exact error

 

The element 'billTo' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'phoneNumber' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.

 

From this code;

 

...

$customerAddress->setCountry($countryCode);
$customerAddress->setPhoneNumber($phoneNumber);

 

$subscription->setBillTo($customerAddress);

 

All Star
Posts: 733
Registered: ‎11-05-2018

Re: PHP API - Setting Billing Phone & Company in a Subscription

@nox7

The phone number goes in as a property of a customerDataType object, if I remember correctly. You are putting in the company correctly.
All Star
Posts: 733
Registered: ‎11-05-2018

Re: PHP API - Setting Billing Phone & Company in a Subscription

It would help if I looked at your code. You are passing country. For company you use that same class as you are using.