Zend_Service_StrikeIron

Zend_Service_StrikeIron: Bundled Services

Zend_Service_StrikeIron comes with wrapper classes for three popular StrikeIron services.

ZIP Code Information

Zend_Service_StrikeIron_ZipCodeInfo provides a client for StrikeIron's Zip Code Information Service. For more information on this service, visit these StrikeIron resources:

The service contains a getZipCode() method that will retrieve information about a United States ZIP code or Canadian postal code:

  1. span style="color: #ff0000;">'username' => 'your-username',
  2.                                                 'password' => 'your-password'));
  3.  
  4. // Get a client for the Zip Code Information service
  5. 'class' => 'ZipCodeInfo'));
  6.  
  7. // Get the Zip information for 95014
  8. 'ZipCode' => 95014));
  9. $zips = $response->serviceResult;
  10.  
  11. // Display the results
  12. 'No results found'// a result with one single zip code is returned as an object,
  13.     // not an array with one element as one might expect.
  14. // print all of the possible results
  15. // show all properties
  16. // or just the city name
  17. // Detailed status information
  18. // http://www.strikeiron.com/exampledata/StrikeIronZipCodeInformation_v3.pdf

U.S. Address Verification

Zend_Service_StrikeIron_USAddressVerification provides a client for StrikeIron's U.S. Address Verification Service. For more information on this service, visit these StrikeIron resources:

The service contains a verifyAddressUSA() method that will verify an address in the United States:

  1. span style="color: #ff0000;">'username' => 'your-username',
  2.                                                 'password' => 'your-password'));
  3.  
  4. // Get a client for the Zip Code Information service
  5. 'class' => 'USAddressVerification'));
  6.  
  7. // Address to verify. Not all fields are required but
  8. // supply as many as possible for the best results.
  9. 'firm'           => 'Zend Technologies',
  10.                  'addressLine1'   => '19200 Stevens Creek Blvd',
  11.                  'addressLine2'   => '',
  12.                  'city_state_zip' => 'Cupertino CA 95014');
  13.  
  14. // Verify the address
  15. // Display the results
  16. // show all properties
  17. // or just the firm name
  18. // valid address?
  19.     $valid = ($result->valid == 'VALID');
  20. }

Sales & Use Tax Basic

Zend_Service_StrikeIron_SalesUseTaxBasic provides a client for StrikeIron's Sales & Use Tax Basic service. For more information on this service, visit these StrikeIron resources:

The service contains two methods, getTaxRateUSA() and getTaxRateCanada(), that will retrieve sales and use tax data for the United States and Canada, respectively.

  1. span style="color: #ff0000;">'username' => 'your-username',
  2.                                                 'password' => 'your-password'));
  3.  
  4. // Get a client for the Sales & Use Tax Basic service
  5. 'class' => 'SalesUseTaxBasic'));
  6.  
  7. // Query tax rate for Ontario, Canada
  8. 'province' => 'foo'// show all properties
  9. // or just the GST (Goods & Services Tax)
  10.  
  11. // Query tax rate for Cupertino, CA USA
  12. 'zip_code'// show all properties
  13. // or just the state sales tax

Zend_Service_StrikeIron