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