File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ require_once 'credentials.php ' ;
4
+ require_once 'bootstrap.php ' ;
5
+
6
+ use FedEx \TrackService ,
7
+ FedEx \TrackService \ComplexType ,
8
+ FedEx \TrackService \SimpleType ;
9
+
10
+ $ trackingId = 123456789012 ;
11
+
12
+ $ userCredential = new ComplexType \WebAuthenticationCredential ();
13
+ $ userCredential ->setKey (FEDEX_KEY )
14
+ ->setPassword (FEDEX_PASSWORD );
15
+
16
+ $ webAuthenticationDetail = new ComplexType \WebAuthenticationDetail ();
17
+ $ webAuthenticationDetail ->setUserCredential ($ userCredential );
18
+
19
+ $ clientDetail = new ComplexType \ClientDetail ();
20
+ $ clientDetail ->setAccountNumber (FEDEX_ACCOUNT_NUMBER )
21
+ ->setMeterNumber (FEDEX_METER_NUMBER );
22
+
23
+ $ version = new ComplexType \VersionId ();
24
+ $ version ->setMajor (5 )
25
+ ->setIntermediate (0 )
26
+ ->setMinor (0 )
27
+ ->setServiceId ('trck ' );
28
+
29
+ $ identifier = new ComplexType \TrackPackageIdentifier ();
30
+ $ identifier ->setType (SimpleType \TrackIdentifierType::_TRACKING_NUMBER_OR_DOORTAG )
31
+ ->setValue ($ trackingId );
32
+
33
+ $ request = new ComplexType \TrackRequest ();
34
+ $ request ->setWebAuthenticationDetail ($ webAuthenticationDetail )
35
+ ->setClientDetail ($ clientDetail )
36
+ ->setVersion ($ version )
37
+ ->setPackageIdentifier ($ identifier );
38
+
39
+ $ response = (new TrackService \Request ())->getTrackReply ($ request );
40
+
41
+ var_dump ($ response );
42
+
You can’t perform that action at this time.
0 commit comments