@@ -8,24 +8,24 @@ discard block |
||
8 | 8 | class Atdconnect |
9 | 9 | { |
10 | 10 | |
11 | - public static $wsshead; |
|
12 | - private static $statuswsdl = 'https://testws.atdconnect.com/ws/3_4/orderStatus.wsdl'; |
|
13 | - private static $brandwsdl = 'https://testws.atdconnect.com/ws/3_4/brandstyles.wsdl'; |
|
14 | - private static $locationwsdl = 'https://testws.atdconnect.com/ws/3_4/locations.wsdl'; |
|
15 | - private static $productwsdl = 'https://testws.atdconnect.com/ws/3_4/products.wsdl'; |
|
16 | - private static $orderwsdl = 'https://testws.atdconnect.com/ws/3_4/orders.wsdl'; |
|
11 | + public static $wsshead; |
|
12 | + private static $statuswsdl = 'https://testws.atdconnect.com/ws/3_4/orderStatus.wsdl'; |
|
13 | + private static $brandwsdl = 'https://testws.atdconnect.com/ws/3_4/brandstyles.wsdl'; |
|
14 | + private static $locationwsdl = 'https://testws.atdconnect.com/ws/3_4/locations.wsdl'; |
|
15 | + private static $productwsdl = 'https://testws.atdconnect.com/ws/3_4/products.wsdl'; |
|
16 | + private static $orderwsdl = 'https://testws.atdconnect.com/ws/3_4/orders.wsdl'; |
|
17 | 17 | |
18 | - protected static $location; |
|
18 | + protected static $location; |
|
19 | 19 | |
20 | 20 | |
21 | - public function __construct() |
|
22 | - { |
|
21 | + public function __construct() |
|
22 | + { |
|
23 | 23 | $config = include('config/config.php'); |
24 | 24 | self::$wsshead = $this->getWSSHeader($config->user, $config->pass, $config->client); |
25 | - } |
|
25 | + } |
|
26 | 26 | |
27 | - public static function getWSSHeader($user, $pass, $client) |
|
28 | - { |
|
27 | + public static function getWSSHeader($user, $pass, $client) |
|
28 | + { |
|
29 | 29 | $xml = ' |
30 | 30 | <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> |
31 | 31 | <wsse:UsernameToken atd:clientId="' . $client . '" xmlns:atd="http://api.atdconnect.com/atd"> |
@@ -36,112 +36,112 @@ discard block |
||
36 | 36 | '; |
37 | 37 | |
38 | 38 | 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); |
39 | - } |
|
39 | + } |
|
40 | 40 | |
41 | - public static function apiCall($call,$query,$service) |
|
42 | - { |
|
41 | + public static function apiCall($call,$query,$service) |
|
42 | + { |
|
43 | 43 | $client = new \SoapClient($service); |
44 | 44 | $client->__setSoapHeaders(self::$wsshead); |
45 | 45 | $response = $client->$call($query); |
46 | 46 | return $response; |
47 | - } |
|
47 | + } |
|
48 | 48 | |
49 | - public function setLocation($location) |
|
50 | - { |
|
51 | - static::$location = $location; |
|
49 | + public function setLocation($location) |
|
50 | + { |
|
51 | + static::$location = $location; |
|
52 | 52 | return static::$location; |
53 | - } |
|
53 | + } |
|
54 | 54 | |
55 | - public function getLocation() |
|
56 | - { |
|
57 | - return static::$location; |
|
58 | - } |
|
55 | + public function getLocation() |
|
56 | + { |
|
57 | + return static::$location; |
|
58 | + } |
|
59 | 59 | |
60 | - //************************************************ |
|
61 | - // Location Service |
|
62 | - //************************************************ |
|
60 | + //************************************************ |
|
61 | + // Location Service |
|
62 | + //************************************************ |
|
63 | 63 | |
64 | - public static function getLocationByCriteria() |
|
65 | - { |
|
64 | + public static function getLocationByCriteria() |
|
65 | + { |
|
66 | 66 | return self::apiCall('getLocationByCriteria','',self::$locationwsdl); |
67 | - } |
|
67 | + } |
|
68 | 68 | |
69 | - public static function getLocationCutoffTimes() |
|
70 | - { |
|
69 | + public static function getLocationCutoffTimes() |
|
70 | + { |
|
71 | 71 | return self::apiCall('getLocationCutoffTimes',['location' => static::$location],self::$locationwsdl); |
72 | - } |
|
72 | + } |
|
73 | 73 | |
74 | - public static function getDistributionCenter($dc = '059') |
|
75 | - { |
|
74 | + public static function getDistributionCenter($dc = '059') |
|
75 | + { |
|
76 | 76 | return self::apiCall('getDistributionCenter',array('servicingDC' => $dc),self::$locationwsdl); |
77 | - } |
|
77 | + } |
|
78 | 78 | |
79 | 79 | |
80 | - //************************************************ |
|
81 | - // Brand Styles Service |
|
82 | - //************************************************ |
|
80 | + //************************************************ |
|
81 | + // Brand Styles Service |
|
82 | + //************************************************ |
|
83 | 83 | |
84 | 84 | |
85 | - public static function getBrand($product = null) |
|
86 | - { |
|
87 | - return self::apiCall('getBrand',array('locationNumber' => static::$location,'productGroup' => $product),self::$brandwsdl); |
|
88 | - } |
|
85 | + public static function getBrand($product = null) |
|
86 | + { |
|
87 | + return self::apiCall('getBrand',array('locationNumber' => static::$location,'productGroup' => $product),self::$brandwsdl); |
|
88 | + } |
|
89 | 89 | |
90 | - public static function getStyle($brand = null) |
|
91 | - { |
|
92 | - return self::apiCall('getStyle',array('locationNumber' => static::$location,'brand' => $brand),self::$brandwsdl); |
|
93 | - } |
|
90 | + public static function getStyle($brand = null) |
|
91 | + { |
|
92 | + return self::apiCall('getStyle',array('locationNumber' => static::$location,'brand' => $brand),self::$brandwsdl); |
|
93 | + } |
|
94 | 94 | |
95 | 95 | |
96 | - //************************************************ |
|
97 | - // Products Service |
|
98 | - //************************************************ |
|
96 | + //************************************************ |
|
97 | + // Products Service |
|
98 | + //************************************************ |
|
99 | 99 | |
100 | 100 | |
101 | 101 | |
102 | 102 | |
103 | - public static function getProdBrand($product = null) |
|
104 | - { |
|
105 | - return self::apiCall('getProdBrand',array('locationNumber' => static::$location,'productGroup' => $product),self::$productwsdl); |
|
106 | - } |
|
103 | + public static function getProdBrand($product = null) |
|
104 | + { |
|
105 | + return self::apiCall('getProdBrand',array('locationNumber' => static::$location,'productGroup' => $product),self::$productwsdl); |
|
106 | + } |
|
107 | 107 | |
108 | - public static function getProductByCriteria($search) |
|
109 | - { |
|
108 | + public static function getProductByCriteria($search) |
|
109 | + { |
|
110 | 110 | return self::apiCall('getProductByCriteria',$search,self::$productwsdl); |
111 | - } |
|
111 | + } |
|
112 | 112 | |
113 | - public static function getProductByKeyword($search) |
|
114 | - { |
|
113 | + public static function getProductByKeyword($search) |
|
114 | + { |
|
115 | 115 | return self::apiCall('getProductByKeyword',$search,self::$productwsdl); |
116 | - } |
|
116 | + } |
|
117 | 117 | |
118 | - //************************************************ |
|
119 | - // Order Service |
|
120 | - //************************************************ |
|
118 | + //************************************************ |
|
119 | + // Order Service |
|
120 | + //************************************************ |
|
121 | 121 | |
122 | - public static function placeOrder($order) |
|
123 | - { |
|
122 | + public static function placeOrder($order) |
|
123 | + { |
|
124 | 124 | return self::apiCall('placeOrder',$order,self::$orderwsdl); |
125 | - } |
|
125 | + } |
|
126 | 126 | |
127 | - public static function previewOrder($order) |
|
128 | - { |
|
127 | + public static function previewOrder($order) |
|
128 | + { |
|
129 | 129 | return self::apiCall('previewOrder',$order,self::$orderwsdl); |
130 | - } |
|
130 | + } |
|
131 | 131 | |
132 | - //************************************************ |
|
133 | - // Order Status Service |
|
134 | - //************************************************ |
|
132 | + //************************************************ |
|
133 | + // Order Status Service |
|
134 | + //************************************************ |
|
135 | 135 | |
136 | - public static function getOrderDetail($status) |
|
137 | - { |
|
136 | + public static function getOrderDetail($status) |
|
137 | + { |
|
138 | 138 | return self::apiCall('getOrderDetail',$status,self::$statuswsdl); |
139 | - } |
|
139 | + } |
|
140 | 140 | |
141 | - public static function getOrderStatusByCriteria($criteria) |
|
142 | - { |
|
141 | + public static function getOrderStatusByCriteria($criteria) |
|
142 | + { |
|
143 | 143 | return self::apiCall('getOrderStatusByCriteria',$status,self::$statuswsdl); |
144 | - } |
|
144 | + } |
|
145 | 145 | |
146 | 146 | |
147 | 147 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | private static $brandwsdl = 'https://testws.atdconnect.com/ws/3_4/brandstyles.wsdl'; |
14 | 14 | private static $locationwsdl = 'https://testws.atdconnect.com/ws/3_4/locations.wsdl'; |
15 | 15 | private static $productwsdl = 'https://testws.atdconnect.com/ws/3_4/products.wsdl'; |
16 | - private static $orderwsdl = 'https://testws.atdconnect.com/ws/3_4/orders.wsdl'; |
|
16 | + private static $orderwsdl = 'https://testws.atdconnect.com/ws/3_4/orders.wsdl'; |
|
17 | 17 | |
18 | 18 | protected static $location; |
19 | 19 | |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | { |
29 | 29 | $xml = ' |
30 | 30 | <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> |
31 | - <wsse:UsernameToken atd:clientId="' . $client . '" xmlns:atd="http://api.atdconnect.com/atd"> |
|
32 | - <wsse:Username>' . $user . '</wsse:Username> |
|
33 | - <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $pass . '</wsse:Password> |
|
31 | + <wsse:UsernameToken atd:clientId="' . $client.'" xmlns:atd="http://api.atdconnect.com/atd"> |
|
32 | + <wsse:Username>' . $user.'</wsse:Username> |
|
33 | + <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $pass.'</wsse:Password> |
|
34 | 34 | </wsse:UsernameToken> |
35 | 35 | </wsse:Security> |
36 | 36 | '; |
@@ -38,11 +38,11 @@ discard block |
||
38 | 38 | 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); |
39 | 39 | } |
40 | 40 | |
41 | - public static function apiCall($call,$query,$service) |
|
41 | + public static function apiCall($call, $query, $service) |
|
42 | 42 | { |
43 | - $client = new \SoapClient($service); |
|
43 | + $client = new \SoapClient($service); |
|
44 | 44 | $client->__setSoapHeaders(self::$wsshead); |
45 | - $response = $client->$call($query); |
|
45 | + $response = $client->$call($query); |
|
46 | 46 | return $response; |
47 | 47 | } |
48 | 48 | |
@@ -63,17 +63,17 @@ discard block |
||
63 | 63 | |
64 | 64 | public static function getLocationByCriteria() |
65 | 65 | { |
66 | - return self::apiCall('getLocationByCriteria','',self::$locationwsdl); |
|
66 | + return self::apiCall('getLocationByCriteria', '', self::$locationwsdl); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | public static function getLocationCutoffTimes() |
70 | 70 | { |
71 | - return self::apiCall('getLocationCutoffTimes',['location' => static::$location],self::$locationwsdl); |
|
71 | + return self::apiCall('getLocationCutoffTimes', ['location' => static::$location], self::$locationwsdl); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | public static function getDistributionCenter($dc = '059') |
75 | 75 | { |
76 | - return self::apiCall('getDistributionCenter',array('servicingDC' => $dc),self::$locationwsdl); |
|
76 | + return self::apiCall('getDistributionCenter', array('servicingDC' => $dc), self::$locationwsdl); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | |
@@ -84,12 +84,12 @@ discard block |
||
84 | 84 | |
85 | 85 | public static function getBrand($product = null) |
86 | 86 | { |
87 | - return self::apiCall('getBrand',array('locationNumber' => static::$location,'productGroup' => $product),self::$brandwsdl); |
|
87 | + return self::apiCall('getBrand', array('locationNumber' => static::$location, 'productGroup' => $product), self::$brandwsdl); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | public static function getStyle($brand = null) |
91 | 91 | { |
92 | - return self::apiCall('getStyle',array('locationNumber' => static::$location,'brand' => $brand),self::$brandwsdl); |
|
92 | + return self::apiCall('getStyle', array('locationNumber' => static::$location, 'brand' => $brand), self::$brandwsdl); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
@@ -102,17 +102,17 @@ discard block |
||
102 | 102 | |
103 | 103 | public static function getProdBrand($product = null) |
104 | 104 | { |
105 | - return self::apiCall('getProdBrand',array('locationNumber' => static::$location,'productGroup' => $product),self::$productwsdl); |
|
105 | + return self::apiCall('getProdBrand', array('locationNumber' => static::$location, 'productGroup' => $product), self::$productwsdl); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | public static function getProductByCriteria($search) |
109 | 109 | { |
110 | - return self::apiCall('getProductByCriteria',$search,self::$productwsdl); |
|
110 | + return self::apiCall('getProductByCriteria', $search, self::$productwsdl); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | public static function getProductByKeyword($search) |
114 | 114 | { |
115 | - return self::apiCall('getProductByKeyword',$search,self::$productwsdl); |
|
115 | + return self::apiCall('getProductByKeyword', $search, self::$productwsdl); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | //************************************************ |
@@ -121,12 +121,12 @@ discard block |
||
121 | 121 | |
122 | 122 | public static function placeOrder($order) |
123 | 123 | { |
124 | - return self::apiCall('placeOrder',$order,self::$orderwsdl); |
|
124 | + return self::apiCall('placeOrder', $order, self::$orderwsdl); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | public static function previewOrder($order) |
128 | 128 | { |
129 | - return self::apiCall('previewOrder',$order,self::$orderwsdl); |
|
129 | + return self::apiCall('previewOrder', $order, self::$orderwsdl); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | //************************************************ |
@@ -135,12 +135,12 @@ discard block |
||
135 | 135 | |
136 | 136 | public static function getOrderDetail($status) |
137 | 137 | { |
138 | - return self::apiCall('getOrderDetail',$status,self::$statuswsdl); |
|
138 | + return self::apiCall('getOrderDetail', $status, self::$statuswsdl); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | public static function getOrderStatusByCriteria($criteria) |
142 | 142 | { |
143 | - return self::apiCall('getOrderStatusByCriteria',$status,self::$statuswsdl); |
|
143 | + return self::apiCall('getOrderStatusByCriteria', $status, self::$statuswsdl); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | - return (object) [ |
|
4 | - 'client'=> '', |
|
5 | - 'user' => '', |
|
6 | - 'pass' => '' |
|
7 | - ]; |
|
8 | 3 | \ No newline at end of file |
4 | + return (object) [ |
|
5 | + 'client'=> '', |
|
6 | + 'user' => '', |
|
7 | + 'pass' => '' |
|
8 | + ]; |
|
9 | 9 | \ No newline at end of file |