VirtueMart
3.2.14.9808
|
Address.class.php Contains address data; Can be passed to AddressServiceSoap#validate; Also part of the GetTaxRequest result returned from the TaxServiceSoap#getTax tax calculation service; No behavior - basically a glorified struct.
Example:
$port = new AddressServiceSoap();
$address = new Address(); $address->setLine1("900 Winslow Way"); $address->setLine2("Suite 130"); $address->setCity("Bainbridge Is"); $address->setRegion("WA"); $address->setPostalCode("98110-2450"); $address->setLongitude("-122.510359"); $address->setLatitude("47.624972"); $result = $port->validate($address,TextCase::$Upper); $addresses = $result->ValidAddresses; print("Number of addresses returned is ". sizseof($addresses));
AddressServiceSoap.class.php Proxy interface for the Avalara Address Web Service.
AddressServiceSoap reads its configuration values from static variables defined in ATConfig.class.php. This file must be properly configured with your security credentials.
Example:
$addressService = new AddressServiceSoap();
AddressType.class.php The type of the address(es) returned in the validation result.
IsAuthorizedResult.class.php Result information returned from the AddressSvc's AddressServiceSoap#isAuthorized method and the TaxSvc's TaxServiceSoap#isAuthorized method.
Example:
$port = new AddressServiceSoap();
$result = port->ping(""); $numMessages = sizeof($result->Messages); print('Ping Result # of messages is '.$numMessages);
Message.class.php Message class used in results and exceptions. Contains status detail about call results.
SeverityLevel.class.php Severity of the result Message.
Defines the constants used to specify SeverityLevel in Message
TextCase.class.php The casing to apply to the valid address(es) returned in the validation result.
ValidAddress.class.php A fully validated address based on initial Address data passed to AddressServiceSoap#validate.
Example: $address = new Address(); $address->setLine1("900 Winslow Way"); $address->setLine2("Suite 130"); $address->setCity("Bainbridge Is"); $address->setRegion("WA"); $address->setPostalCode("98110-2450");
$result = svc->validate($address,TextCase::$Upper);
if ($result->getResultCode() == SeverityLevel::$Success) { $addresses = result->validAddresses(); if (sizeof($addresses) > 0) { $validAddress = $addresses[0]; print($validAddress->getLine1()); // "900 WINSLOW WAY E STE 130", print($validAddress->getLine4()); // "BAINBRIDGE IS WA 98110-2450" print($validAddress->getFipsCode()); // "5303500000" print($validAddress->getCounty()); // "KITSAP" } }
ValidateRequest.class.php Data wrapper used internally to pass arguments within AddressServiceSoap#validate. End users should not need to use this class.
Example: $svc = new AddressServiceSoap();
$address = new Address(); $address->setLine1("900 Winslow Way"); $address->setCity("Bainbridge Island"); $address->setRegion("WA"); $address->setPostalCode("98110");
ValidateRequest validateRequest = new ValidateRequest(); validateRequest.setAddress(address); validateRequest.setTextCase(TextCase.Upper);
ValidateResult result = svc.validate(validateRequest); ArrayOfValidAddress arrValids = result.getValidAddresses(); int numAddresses = (arrValids == null || arrValids.getValidAddress() == null ? 0 : arrValids.getValidAddress().length); System.out.println("Number of Addresses is " + numAddresses);
ValidateResult.class.php Contains an array of ValidAddress objects returned by AddressServiceSoap#validate
$port = new AddressServiceSoap();
$address = new Address(); $address->setLine1("900 Winslow Way"); $address->setLine2("Suite 130"); $address->setCity("Bainbridge Is"); $address->setRegion("WA"); $address->setPostalCode("98110-2450");
$result = $port->validate($address,TextCase::$Upper); $addresses = $result->ValidAddresses; print("Number of addresses returned is ". sizeoof($addresses));