-
Notifications
You must be signed in to change notification settings - Fork 184
/
Request.php
76 lines (67 loc) · 2.86 KB
/
Request.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
namespace FedEx\TrackService;
use FedEx\AbstractRequest;
/**
* Request sends the SOAP call to the FedEx servers and returns the response
*
* @author Jeremy Dunn <[email protected]>
* @package PHP FedEx API wrapper
* @subpackage Track Service
*/
class Request extends AbstractRequest
{
const PRODUCTION_URL = 'https://ws.fedex.com:443/web-services/track';
const TESTING_URL = 'https://wsbeta.fedex.com:443/web-services/track';
protected static $wsdlFileName = 'TrackService_v20.wsdl';
/**
* Sends the TrackRequest and returns the response
*
* @param ComplexType\TrackRequest $trackRequest
* @param bool $returnStdClass Return the $stdClass response directly from \SoapClient
* @return ComplexType\TrackReply|stdClass
*/
public function getTrackReply(ComplexType\TrackRequest $trackRequest, $returnStdClass = false)
{
$response = $this->getSoapClient()->track($trackRequest->toArray());
if ($returnStdClass) {
return $response;
}
$trackReply = new ComplexType\TrackReply;
$trackReply->populateFromStdClass($response);
return $trackReply;
}
/**
* Sends the GetTrackingDocumentsRequest and returns the response
*
* @param ComplexType\GetTrackingDocumentsRequest $getTrackingDocumentsRequest
* @param bool $returnStdClass Return the $stdClass response directly from \SoapClient
* @return ComplexType\GetTrackingDocumentsReply|stdClass
*/
public function getGetTrackingDocumentsReply(ComplexType\GetTrackingDocumentsRequest $getTrackingDocumentsRequest, $returnStdClass = false)
{
$response = $this->getSoapClient()->getTrackingDocuments($getTrackingDocumentsRequest->toArray());
if ($returnStdClass) {
return $response;
}
$getTrackingDocumentsReply = new ComplexType\GetTrackingDocumentsReply;
$getTrackingDocumentsReply->populateFromStdClass($response);
return $getTrackingDocumentsReply;
}
/**
* Sends the SendNotificationsRequest and returns the response
*
* @param ComplexType\SendNotificationsRequest $sendNotificationsRequest
* @param bool $returnStdClass Return the $stdClass response directly from \SoapClient
* @return ComplexType\SendNotificationsReply|stdClass
*/
public function getSendNotificationsReply(ComplexType\SendNotificationsRequest $sendNotificationsRequest, $returnStdClass = false)
{
$response = $this->getSoapClient()->sendNotifications($sendNotificationsRequest->toArray());
if ($returnStdClass) {
return $response;
}
$sendNotificationsReply = new ComplexType\SendNotificationsReply;
$sendNotificationsReply->populateFromStdClass($response);
return $sendNotificationsReply;
}
}