Login   Register  
PHP Classes
elePHPant
Icontem

File: av_readme.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Sergey Shilko  >  Ultimate Free UPS Pack  >  av_readme.txt  >  Download  
File: av_readme.txt
Role: Documentation
Content type: text/plain
Description: av_readme.txt
Class: Ultimate Free UPS Pack
Retrieve UPS shipping information
Author: By
Last change:
Date: 2008-06-24 06:18
Size: 968 bytes
 

Contents

Class file image Download
UPS address validation class

SAMPLE USAGE :

        $av = new c_address_validator();
        $av->setUpsAccount($ups_xml_access_key,$ups_userid,$ups_password);

        $err_txt = '';
        $err = 0;
        
        # CHECK >>>
        $av->setVerifyTarget(addslashes($city),addslashes($state),addslashes($zip));
        $av->commit();
        $result = $av->getIsSucces();
        $q      = $av->getQuality();
        $min_quality = 0.81;

        if($result != 1){
            $err_txt = 'Invalid Address .'.$av->getErrorDescription();
            $err = 1;
        }
        elseif($result == 1 && $q > $min_quality){
            $err_txt = 'Address is valid';
            $err = 0;
        }
        elseif($result == 1 && $q < $min_quality){
            $err_txt = 'Address validation is poor, check your City,State,Zip '.$av->getErrorDescription();
            $err = 1;
        }
        #<<<

	#echo $err_txt;
	#echo $err