-
Notifications
You must be signed in to change notification settings - Fork 182
/
Copy pathRequest.php
76 lines (67 loc) · 3.05 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\CourierDispatchService;
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 Courier Dispatch Service
*/
class Request extends AbstractRequest
{
const PRODUCTION_URL = 'https://gateway.fedex.com:443/web-services';
const TESTING_URL = 'https://gatewaybeta.fedex.com:443/web-services';
protected static $wsdlFileName = 'CourierDispatchService_v3.wsdl';
/**
* Sends the CourierDispatchRequest and returns the response
*
* @param ComplexType\CourierDispatchRequest $courierDispatchRequest
* @param bool $returnStdClass Return the $stdClass response directly from \SoapClient
* @return ComplexType\CourierDispatchReply|stdClass
*/
public function getCreateCourierDispatchReply(ComplexType\CourierDispatchRequest $courierDispatchRequest, $returnStdClass = false)
{
$response = $this->getSoapClient()->createCourierDispatch($courierDispatchRequest->toArray());
if ($returnStdClass) {
return $response;
}
$courierDispatchReply = new ComplexType\CourierDispatchReply;
$courierDispatchReply->populateFromStdClass($response);
return $courierDispatchReply;
}
/**
* Sends the CancelCourierDispatchRequest and returns the response
*
* @param ComplexType\CancelCourierDispatchRequest $cancelCourierDispatchRequest
* @param bool $returnStdClass Return the $stdClass response directly from \SoapClient
* @return ComplexType\CancelCourierDispatchReply|stdClass
*/
public function getCancelCourierDispatchReply(ComplexType\CancelCourierDispatchRequest $cancelCourierDispatchRequest, $returnStdClass = false)
{
$response = $this->getSoapClient()->cancelCourierDispatch($cancelCourierDispatchRequest->toArray());
if ($returnStdClass) {
return $response;
}
$cancelCourierDispatchReply = new ComplexType\CancelCourierDispatchReply;
$cancelCourierDispatchReply->populateFromStdClass($response);
return $cancelCourierDispatchReply;
}
/**
* Sends the PickupAvailabilityRequest and returns the response
*
* @param ComplexType\PickupAvailabilityRequest $pickupAvailabilityRequest
* @param bool $returnStdClass Return the $stdClass response directly from \SoapClient
* @return ComplexType\PickupAvailabilityReply|stdClass
*/
public function getGetPickupAvailabilityReply(ComplexType\PickupAvailabilityRequest $pickupAvailabilityRequest, $returnStdClass = false)
{
$response = $this->getSoapClient()->getPickupAvailability($pickupAvailabilityRequest->toArray());
if ($returnStdClass) {
return $response;
}
$pickupAvailabilityReply = new ComplexType\PickupAvailabilityReply;
$pickupAvailabilityReply->populateFromStdClass($response);
return $pickupAvailabilityReply;
}
}