@@ -3,36 +3,36 @@ |
||
3 | 3 | namespace Nickcheek\Atdconnect\Services; |
4 | 4 | |
5 | 5 | class Product { |
6 | - use \Nickcheek\Atdconnect\Traits\ApiTrait; |
|
6 | + use \Nickcheek\Atdconnect\Traits\ApiTrait; |
|
7 | 7 | |
8 | - private $location; |
|
9 | - private $wsdl; |
|
8 | + private $location; |
|
9 | + private $wsdl; |
|
10 | 10 | |
11 | - public function __construct() |
|
12 | - { |
|
13 | - $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
14 | - $this->location = $config->location; |
|
15 | - $this->wsdl = 'https://testws.atdconnect.com/ws/3_4/products.wsdl'; |
|
16 | - } |
|
11 | + public function __construct() |
|
12 | + { |
|
13 | + $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
14 | + $this->location = $config->location; |
|
15 | + $this->wsdl = 'https://testws.atdconnect.com/ws/3_4/products.wsdl'; |
|
16 | + } |
|
17 | 17 | |
18 | - //************************************************ |
|
19 | - // Products Service |
|
20 | - //************************************************ |
|
18 | + //************************************************ |
|
19 | + // Products Service |
|
20 | + //************************************************ |
|
21 | 21 | |
22 | - public function getProdBrand($product = null) |
|
23 | - { |
|
24 | - return $this->apiCall('getProdBrand',array('locationNumber' => $this->location,'productGroup' => $product),$this->wsdl); |
|
25 | - } |
|
22 | + public function getProdBrand($product = null) |
|
23 | + { |
|
24 | + return $this->apiCall('getProdBrand',array('locationNumber' => $this->location,'productGroup' => $product),$this->wsdl); |
|
25 | + } |
|
26 | 26 | |
27 | - public function getProductByCriteria($search) |
|
28 | - { |
|
27 | + public function getProductByCriteria($search) |
|
28 | + { |
|
29 | 29 | return $this->apiCall('getProductByCriteria',$search,$this->wsdl); |
30 | - } |
|
30 | + } |
|
31 | 31 | |
32 | - public function getProductByKeyword($search) |
|
33 | - { |
|
32 | + public function getProductByKeyword($search) |
|
33 | + { |
|
34 | 34 | return $this->apiCall('getProductByKeyword',$search,$this->wsdl); |
35 | - } |
|
35 | + } |
|
36 | 36 | |
37 | 37 | |
38 | 38 | } |
39 | 39 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | public function __construct() |
12 | 12 | { |
13 | - $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
13 | + $config = include(realpath(dirname(__FILE__).'/../config/config.php')); |
|
14 | 14 | $this->location = $config->location; |
15 | 15 | $this->wsdl = 'https://testws.atdconnect.com/ws/3_4/products.wsdl'; |
16 | 16 | } |
@@ -21,17 +21,17 @@ discard block |
||
21 | 21 | |
22 | 22 | public function getProdBrand($product = null) |
23 | 23 | { |
24 | - return $this->apiCall('getProdBrand',array('locationNumber' => $this->location,'productGroup' => $product),$this->wsdl); |
|
24 | + return $this->apiCall('getProdBrand', array('locationNumber' => $this->location, 'productGroup' => $product), $this->wsdl); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | public function getProductByCriteria($search) |
28 | 28 | { |
29 | - return $this->apiCall('getProductByCriteria',$search,$this->wsdl); |
|
29 | + return $this->apiCall('getProductByCriteria', $search, $this->wsdl); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | public function getProductByKeyword($search) |
33 | 33 | { |
34 | - return $this->apiCall('getProductByKeyword',$search,$this->wsdl); |
|
34 | + return $this->apiCall('getProductByKeyword', $search, $this->wsdl); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 |
@@ -3,28 +3,28 @@ |
||
3 | 3 | namespace Nickcheek\Atdconnect\Services; |
4 | 4 | |
5 | 5 | class Status { |
6 | - use \Nickcheek\Atdconnect\Traits\ApiTrait; |
|
6 | + use \Nickcheek\Atdconnect\Traits\ApiTrait; |
|
7 | 7 | |
8 | - private $wsdl; |
|
8 | + private $wsdl; |
|
9 | 9 | |
10 | - public function __construct() |
|
11 | - { |
|
12 | - $this->wsdl = 'https://testws.atdconnect.com/ws/3_4/orderStatus.wsdl'; |
|
13 | - } |
|
10 | + public function __construct() |
|
11 | + { |
|
12 | + $this->wsdl = 'https://testws.atdconnect.com/ws/3_4/orderStatus.wsdl'; |
|
13 | + } |
|
14 | 14 | |
15 | - //************************************************ |
|
16 | - // Order Status Service |
|
17 | - //************************************************ |
|
15 | + //************************************************ |
|
16 | + // Order Status Service |
|
17 | + //************************************************ |
|
18 | 18 | |
19 | - public function getOrderDetail($status) |
|
20 | - { |
|
19 | + public function getOrderDetail($status) |
|
20 | + { |
|
21 | 21 | return $this->apiCall('getOrderDetail',$status,$this->wsdl); |
22 | - } |
|
22 | + } |
|
23 | 23 | |
24 | - public function getOrderStatusByCriteria($criteria) |
|
25 | - { |
|
24 | + public function getOrderStatusByCriteria($criteria) |
|
25 | + { |
|
26 | 26 | return $this->apiCall('getOrderStatusByCriteria',$criteria,$this->wsdl); |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | 29 | |
30 | 30 | } |
31 | 31 | \ No newline at end of file |
@@ -18,12 +18,12 @@ |
||
18 | 18 | |
19 | 19 | public function getOrderDetail($status) |
20 | 20 | { |
21 | - return $this->apiCall('getOrderDetail',$status,$this->wsdl); |
|
21 | + return $this->apiCall('getOrderDetail', $status, $this->wsdl); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | public function getOrderStatusByCriteria($criteria) |
25 | 25 | { |
26 | - return $this->apiCall('getOrderStatusByCriteria',$criteria,$this->wsdl); |
|
26 | + return $this->apiCall('getOrderStatusByCriteria', $criteria, $this->wsdl); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 |
@@ -3,37 +3,37 @@ |
||
3 | 3 | namespace Nickcheek\Atdconnect\Services; |
4 | 4 | |
5 | 5 | class Location { |
6 | - use \Nickcheek\Atdconnect\Traits\ApiTrait; |
|
6 | + use \Nickcheek\Atdconnect\Traits\ApiTrait; |
|
7 | 7 | |
8 | - private $location; |
|
9 | - private $wsdl; |
|
8 | + private $location; |
|
9 | + private $wsdl; |
|
10 | 10 | |
11 | - public function __construct() |
|
12 | - { |
|
13 | - $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
14 | - $this->location = $config->location; |
|
15 | - $this->wsdl = 'https://testws.atdconnect.com/ws/3_4/locations.wsdl'; |
|
11 | + public function __construct() |
|
12 | + { |
|
13 | + $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
14 | + $this->location = $config->location; |
|
15 | + $this->wsdl = 'https://testws.atdconnect.com/ws/3_4/locations.wsdl'; |
|
16 | 16 | |
17 | - } |
|
17 | + } |
|
18 | 18 | |
19 | - //************************************************ |
|
20 | - // Location Service |
|
21 | - //************************************************ |
|
19 | + //************************************************ |
|
20 | + // Location Service |
|
21 | + //************************************************ |
|
22 | 22 | |
23 | - public function getLocationByCriteria() |
|
24 | - { |
|
23 | + public function getLocationByCriteria() |
|
24 | + { |
|
25 | 25 | return $this->apiCall('getLocationByCriteria','',$this->wsdl); |
26 | - } |
|
26 | + } |
|
27 | 27 | |
28 | - public function getLocationCutoffTimes() |
|
29 | - { |
|
28 | + public function getLocationCutoffTimes() |
|
29 | + { |
|
30 | 30 | return $this->apiCall('getLocationCutoffTimes',['location' => $this->location],$this->wsdl); |
31 | - } |
|
31 | + } |
|
32 | 32 | |
33 | - public function getDistributionCenter($dc = '059') |
|
34 | - { |
|
33 | + public function getDistributionCenter($dc = '059') |
|
34 | + { |
|
35 | 35 | return $this->apiCall('getDistributionCenter',array('servicingDC' => $dc),$this->wsdl); |
36 | - } |
|
36 | + } |
|
37 | 37 | |
38 | 38 | |
39 | 39 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | public function __construct() |
12 | 12 | { |
13 | - $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
13 | + $config = include(realpath(dirname(__FILE__).'/../config/config.php')); |
|
14 | 14 | $this->location = $config->location; |
15 | 15 | $this->wsdl = 'https://testws.atdconnect.com/ws/3_4/locations.wsdl'; |
16 | 16 | |
@@ -22,17 +22,17 @@ discard block |
||
22 | 22 | |
23 | 23 | public function getLocationByCriteria() |
24 | 24 | { |
25 | - return $this->apiCall('getLocationByCriteria','',$this->wsdl); |
|
25 | + return $this->apiCall('getLocationByCriteria', '', $this->wsdl); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | public function getLocationCutoffTimes() |
29 | 29 | { |
30 | - return $this->apiCall('getLocationCutoffTimes',['location' => $this->location],$this->wsdl); |
|
30 | + return $this->apiCall('getLocationCutoffTimes', ['location' => $this->location], $this->wsdl); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | public function getDistributionCenter($dc = '059') |
34 | 34 | { |
35 | - return $this->apiCall('getDistributionCenter',array('servicingDC' => $dc),$this->wsdl); |
|
35 | + return $this->apiCall('getDistributionCenter', array('servicingDC' => $dc), $this->wsdl); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 |
@@ -3,32 +3,32 @@ |
||
3 | 3 | namespace Nickcheek\Atdconnect\Services; |
4 | 4 | |
5 | 5 | class Brand { |
6 | - use \Nickcheek\Atdconnect\Traits\ApiTrait; |
|
6 | + use \Nickcheek\Atdconnect\Traits\ApiTrait; |
|
7 | 7 | |
8 | - private $location; |
|
9 | - private $wsdl; |
|
8 | + private $location; |
|
9 | + private $wsdl; |
|
10 | 10 | |
11 | - public function __construct() |
|
12 | - { |
|
13 | - $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
14 | - $this->location = $config->location; |
|
15 | - $this->wsdl = 'https://testws.atdconnect.com/ws/3_4/brandstyles.wsdl'; |
|
16 | - } |
|
11 | + public function __construct() |
|
12 | + { |
|
13 | + $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
14 | + $this->location = $config->location; |
|
15 | + $this->wsdl = 'https://testws.atdconnect.com/ws/3_4/brandstyles.wsdl'; |
|
16 | + } |
|
17 | 17 | |
18 | - //************************************************ |
|
19 | - // Brand Styles Service |
|
20 | - //************************************************ |
|
18 | + //************************************************ |
|
19 | + // Brand Styles Service |
|
20 | + //************************************************ |
|
21 | 21 | |
22 | 22 | |
23 | - public function getBrand($product = null) |
|
24 | - { |
|
25 | - return $this->apiCall('getBrand',array('locationNumber' => $this->location,'productGroup' => $product),$this->wsdl); |
|
26 | - } |
|
23 | + public function getBrand($product = null) |
|
24 | + { |
|
25 | + return $this->apiCall('getBrand',array('locationNumber' => $this->location,'productGroup' => $product),$this->wsdl); |
|
26 | + } |
|
27 | 27 | |
28 | - public function getStyle($brand = null) |
|
29 | - { |
|
30 | - return $this->apiCall('getStyle',array('locationNumber' => $this->location,'brand' => $brand),$this->wsdl); |
|
31 | - } |
|
28 | + public function getStyle($brand = null) |
|
29 | + { |
|
30 | + return $this->apiCall('getStyle',array('locationNumber' => $this->location,'brand' => $brand),$this->wsdl); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | |
34 | 34 | } |
35 | 35 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | public function __construct() |
12 | 12 | { |
13 | - $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
13 | + $config = include(realpath(dirname(__FILE__).'/../config/config.php')); |
|
14 | 14 | $this->location = $config->location; |
15 | 15 | $this->wsdl = 'https://testws.atdconnect.com/ws/3_4/brandstyles.wsdl'; |
16 | 16 | } |
@@ -22,12 +22,12 @@ discard block |
||
22 | 22 | |
23 | 23 | public function getBrand($product = null) |
24 | 24 | { |
25 | - return $this->apiCall('getBrand',array('locationNumber' => $this->location,'productGroup' => $product),$this->wsdl); |
|
25 | + return $this->apiCall('getBrand', array('locationNumber' => $this->location, 'productGroup' => $product), $this->wsdl); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | public function getStyle($brand = null) |
29 | 29 | { |
30 | - return $this->apiCall('getStyle',array('locationNumber' => $this->location,'brand' => $brand),$this->wsdl); |
|
30 | + return $this->apiCall('getStyle', array('locationNumber' => $this->location, 'brand' => $brand), $this->wsdl); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 |
@@ -3,28 +3,28 @@ |
||
3 | 3 | namespace Nickcheek\Atdconnect\Services; |
4 | 4 | |
5 | 5 | class Order { |
6 | - use \Nickcheek\Atdconnect\Traits\ApiTrait; |
|
6 | + use \Nickcheek\Atdconnect\Traits\ApiTrait; |
|
7 | 7 | |
8 | - private $wsdl; |
|
8 | + private $wsdl; |
|
9 | 9 | |
10 | - public function __construct() |
|
11 | - { |
|
12 | - $this->wsdl = 'https://testws.atdconnect.com/ws/3_4/orders.wsdl'; |
|
13 | - } |
|
10 | + public function __construct() |
|
11 | + { |
|
12 | + $this->wsdl = 'https://testws.atdconnect.com/ws/3_4/orders.wsdl'; |
|
13 | + } |
|
14 | 14 | |
15 | - //************************************************ |
|
16 | - // Order Service |
|
17 | - //************************************************ |
|
15 | + //************************************************ |
|
16 | + // Order Service |
|
17 | + //************************************************ |
|
18 | 18 | |
19 | - public function placeOrder($order) |
|
20 | - { |
|
19 | + public function placeOrder($order) |
|
20 | + { |
|
21 | 21 | return $this->apiCall('placeOrder',$order,$this->wsdl); |
22 | - } |
|
22 | + } |
|
23 | 23 | |
24 | - public function previewOrder($order) |
|
25 | - { |
|
24 | + public function previewOrder($order) |
|
25 | + { |
|
26 | 26 | return $this->apiCall('previewOrder',$order,$this->wsdl); |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | 29 | |
30 | 30 |
@@ -18,12 +18,12 @@ |
||
18 | 18 | |
19 | 19 | public function placeOrder($order) |
20 | 20 | { |
21 | - return $this->apiCall('placeOrder',$order,$this->wsdl); |
|
21 | + return $this->apiCall('placeOrder', $order, $this->wsdl); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | public function previewOrder($order) |
25 | 25 | { |
26 | - return $this->apiCall('previewOrder',$order,$this->wsdl); |
|
26 | + return $this->apiCall('previewOrder', $order, $this->wsdl); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 |
@@ -6,22 +6,22 @@ discard block |
||
6 | 6 | |
7 | 7 | trait ApiTrait { |
8 | 8 | |
9 | - private $config; |
|
10 | - private $wsshead; |
|
9 | + private $config; |
|
10 | + private $wsshead; |
|
11 | 11 | |
12 | 12 | |
13 | - public function apiCall($call,$query,$service) |
|
14 | - { |
|
15 | - $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
16 | - $this->wsshead = $this->getWSSHeader($config->user, $config->pass, $config->client); |
|
13 | + public function apiCall($call,$query,$service) |
|
14 | + { |
|
15 | + $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
16 | + $this->wsshead = $this->getWSSHeader($config->user, $config->pass, $config->client); |
|
17 | 17 | $client = new \SoapClient($service); |
18 | 18 | $client->__setSoapHeaders($this->wsshead); |
19 | 19 | $response = $client->$call($query); |
20 | 20 | return $response; |
21 | - } |
|
21 | + } |
|
22 | 22 | |
23 | - public function getWSSHeader($user, $pass, $client) |
|
24 | - { |
|
23 | + public function getWSSHeader($user, $pass, $client) |
|
24 | + { |
|
25 | 25 | $xml = ' |
26 | 26 | <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> |
27 | 27 | <wsse:UsernameToken atd:clientId="' . $client . '" xmlns:atd="http://api.atdconnect.com/atd"> |
@@ -32,6 +32,6 @@ discard block |
||
32 | 32 | '; |
33 | 33 | |
34 | 34 | return new \SoapHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Security', new \SoapVar($xml, XSD_ANYXML), true); |
35 | - } |
|
35 | + } |
|
36 | 36 | |
37 | 37 | } |
@@ -10,13 +10,13 @@ discard block |
||
10 | 10 | private $wsshead; |
11 | 11 | |
12 | 12 | |
13 | - public function apiCall($call,$query,$service) |
|
13 | + public function apiCall($call, $query, $service) |
|
14 | 14 | { |
15 | - $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
15 | + $config = include(realpath(dirname(__FILE__).'/../config/config.php')); |
|
16 | 16 | $this->wsshead = $this->getWSSHeader($config->user, $config->pass, $config->client); |
17 | 17 | $client = new \SoapClient($service); |
18 | 18 | $client->__setSoapHeaders($this->wsshead); |
19 | - $response = $client->$call($query); |
|
19 | + $response = $client->$call($query); |
|
20 | 20 | return $response; |
21 | 21 | } |
22 | 22 | |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | { |
25 | 25 | $xml = ' |
26 | 26 | <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> |
27 | - <wsse:UsernameToken atd:clientId="' . $client . '" xmlns:atd="http://api.atdconnect.com/atd"> |
|
28 | - <wsse:Username>' . $user . '</wsse:Username> |
|
29 | - <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $pass . '</wsse:Password> |
|
27 | + <wsse:UsernameToken atd:clientId="' . $client.'" xmlns:atd="http://api.atdconnect.com/atd"> |
|
28 | + <wsse:Username>' . $user.'</wsse:Username> |
|
29 | + <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $pass.'</wsse:Password> |
|
30 | 30 | </wsse:UsernameToken> |
31 | 31 | </wsse:Security> |
32 | 32 | '; |
@@ -8,47 +8,47 @@ |
||
8 | 8 | class Atdconnect |
9 | 9 | { |
10 | 10 | |
11 | - protected $location; |
|
11 | + protected $location; |
|
12 | 12 | |
13 | 13 | |
14 | - public function __construct() |
|
15 | - { |
|
14 | + public function __construct() |
|
15 | + { |
|
16 | 16 | $config = include('config/config.php'); |
17 | 17 | $this->location = $config->location; |
18 | - } |
|
18 | + } |
|
19 | 19 | |
20 | - public function setLocation($location) |
|
21 | - { |
|
22 | - $this->location = $location; |
|
20 | + public function setLocation($location) |
|
21 | + { |
|
22 | + $this->location = $location; |
|
23 | 23 | return $this->location; |
24 | - } |
|
25 | - |
|
26 | - public function getLocation() |
|
27 | - { |
|
28 | - return $this->location; |
|
29 | - } |
|
30 | - |
|
31 | - public function setKeywordSearch($word) |
|
32 | - { |
|
33 | - $search = new Arraybuilder(); |
|
34 | - return $search->setKeywordSearch($word); |
|
35 | - } |
|
36 | - |
|
37 | - public function setATDProductNumber($number) |
|
38 | - { |
|
39 | - $search = new Arraybuilder(); |
|
40 | - return $search->setATDProductNumber($number); |
|
41 | - } |
|
42 | - |
|
43 | - public function setSizeSearch($size) |
|
44 | - { |
|
45 | - $search = new Arraybuilder(); |
|
46 | - return $search->setSizeSearch($size); |
|
47 | - } |
|
24 | + } |
|
25 | + |
|
26 | + public function getLocation() |
|
27 | + { |
|
28 | + return $this->location; |
|
29 | + } |
|
30 | + |
|
31 | + public function setKeywordSearch($word) |
|
32 | + { |
|
33 | + $search = new Arraybuilder(); |
|
34 | + return $search->setKeywordSearch($word); |
|
35 | + } |
|
36 | + |
|
37 | + public function setATDProductNumber($number) |
|
38 | + { |
|
39 | + $search = new Arraybuilder(); |
|
40 | + return $search->setATDProductNumber($number); |
|
41 | + } |
|
42 | + |
|
43 | + public function setSizeSearch($size) |
|
44 | + { |
|
45 | + $search = new Arraybuilder(); |
|
46 | + return $search->setSizeSearch($size); |
|
47 | + } |
|
48 | 48 | |
49 | - public function LocationService() { |
|
50 | - return new Location; |
|
51 | - } |
|
49 | + public function LocationService() { |
|
50 | + return new Location; |
|
51 | + } |
|
52 | 52 | |
53 | 53 | |
54 | 54 |