JeremyDunn / php-fedex-api-wrapper

This library provides a fluid interface for constructing requests to the FedEx web service API.
269 stars 184 forks source link

AddressValidationResult is null #49

Closed callerid closed 7 years ago

callerid commented 7 years ago

I don't know if this is an issue or user error. Feels more like user error...

I always get a NULL in AddressValidationResult returned data from FedEx.

Maybe there is an Option I am not setting, I did set "->setReturnParsedElements(true)" thinking that would help, but that did not seem to do anything.

This is what I get back:

AddressValidationReply::set_state(array( 'name' => 'AddressValidationReply', 'values' => array ( 'HighestSeverity' => 'SUCCESS', 'Notifications' => array ( 0 => Notification::__set_state(array( 'name' => 'Notification', 'values' => array ( 'Severity' => 'SUCCESS', 'Source' => 'wsi', 'Code' => '0', 'Message' => 'Success', ), )), ), 'TransactionDetail' => TransactionDetail::set_state(array( 'name' => 'TransactionDetail', 'values' => array ( 'CustomerTransactionId' => 'Drop Ship PHP version 4', ), )), 'Version' => VersionId::__set_state(array( 'name' => 'VersionId', 'values' => array ( 'ServiceId' => 'aval', 'Major' => 4, 'Intermediate' => 0, 'Minor' => 0, ), )), 'ReplyTimestamp' => '2017-10-10T14:31:54-05:00', 'AddressResults' => array ( 0 => AddressValidationResult::__set_state(array( 'name' => 'AddressValidationResult', 'values' => NULL, )), ), ), ))

I need to get back Score, and corrected address values.

Hope this is the proper place to put this.

callerid commented 7 years ago

Figured it out.

 $result = $validateShipmentRequest->getAddressValidationReply($addressValidationRequest);

Needed to be:

 $result = $validateShipmentRequest->getAddressValidationReply($addressValidationRequest,true);