File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use RahulGodiyal \PhpUpsApiWrapper \AddressValidation ;
4+
5+ require_once ('./vendor/autoload.php ' );
6+
7+ $ client_id = "xxxxxxxxxxxxxxxx " ; // UPS Client ID
8+ $ client_secret = "xxxxxxxxxxxxxxx " ; // UPS Client Secret
9+
10+ // Address to be validated
11+ $ address = [
12+ "AddressLine " => [
13+ "785 GODDARD CT "
14+ ],
15+ "PoliticalDivision2 " => "ALPHARATTA " ,
16+ "PoliticalDivision1 " => "CA " ,
17+ "PostcodePrimaryLow " => "30005 " ,
18+ "CountryCode " => "US "
19+ ];
20+
21+ echo '<pre> ' ;
22+ print_r (AddressValidation::setAddress ($ address )->validate ($ client_id , $ client_secret )); // For Dev Api
23+ print_r (AddressValidation::setAddress ($ address )->setMode ('PROD ' )->validate ($ client_id , $ client_secret )); // For Prod Api
24+ echo '</pre> ' ;
25+ die ();
You can’t perform that action at this time.
0 commit comments