forked from JeremyDunn/php-fedex-api-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRequest.php
More file actions
95 lines (84 loc) · 3.96 KB
/
Request.php
File metadata and controls
95 lines (84 loc) · 3.96 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?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_v5.wsdl';
/**
* Sends the TrackNotificationRequest and returns the response
*
* @param ComplexType\TrackNotificationRequest $trackNotificationRequest
* @param bool $returnStdClass Return the $stdClass response directly from \SoapClient
* @return ComplexType\TrackNotificationReply|stdClass
*/
public function getGetTrackNotificationReply(ComplexType\TrackNotificationRequest $trackNotificationRequest, $returnStdClass = false)
{
$response = $this->getSoapClient()->getTrackNotification($trackNotificationRequest->toArray());
if ($returnStdClass) {
return $response;
}
$trackNotificationReply = new ComplexType\TrackNotificationReply;
$trackNotificationReply->populateFromStdClass($response);
return $trackNotificationReply;
}
/**
* Sends the SignatureProofOfDeliveryLetterRequest and returns the response
*
* @param ComplexType\SignatureProofOfDeliveryLetterRequest $signatureProofOfDeliveryLetterRequest
* @param bool $returnStdClass Return the $stdClass response directly from \SoapClient
* @return ComplexType\SignatureProofOfDeliveryLetterReply|stdClass
*/
public function getRetrieveSignatureProofOfDeliveryLetterReply(ComplexType\SignatureProofOfDeliveryLetterRequest $signatureProofOfDeliveryLetterRequest, $returnStdClass = false)
{
$response = $this->getSoapClient()->retrieveSignatureProofOfDeliveryLetter($signatureProofOfDeliveryLetterRequest->toArray());
if ($returnStdClass) {
return $response;
}
$signatureProofOfDeliveryLetterReply = new ComplexType\SignatureProofOfDeliveryLetterReply;
$signatureProofOfDeliveryLetterReply->populateFromStdClass($response);
return $signatureProofOfDeliveryLetterReply;
}
/**
* 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 SignatureProofOfDeliveryFaxRequest and returns the response
*
* @param ComplexType\SignatureProofOfDeliveryFaxRequest $signatureProofOfDeliveryFaxRequest
* @param bool $returnStdClass Return the $stdClass response directly from \SoapClient
* @return ComplexType\SignatureProofOfDeliveryFaxReply|stdClass
*/
public function getSendSignatureProofOfDeliveryFaxReply(ComplexType\SignatureProofOfDeliveryFaxRequest $signatureProofOfDeliveryFaxRequest, $returnStdClass = false)
{
$response = $this->getSoapClient()->sendSignatureProofOfDeliveryFax($signatureProofOfDeliveryFaxRequest->toArray());
if ($returnStdClass) {
return $response;
}
$signatureProofOfDeliveryFaxReply = new ComplexType\SignatureProofOfDeliveryFaxReply;
$signatureProofOfDeliveryFaxReply->populateFromStdClass($response);
return $signatureProofOfDeliveryFaxReply;
}
}