1
|
|
|
<?php |
2
|
|
|
namespace Loevgaard\Dandomain\Api\Endpoint; |
3
|
|
|
|
4
|
|
|
use Assert\Assert; |
5
|
|
|
|
6
|
|
|
/** |
7
|
|
|
* @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help |
8
|
|
|
*/ |
9
|
|
|
class Settings extends Endpoint |
10
|
|
|
{ |
11
|
|
|
/** |
12
|
|
|
* @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help/operations/GetSites |
13
|
|
|
* |
14
|
|
|
* @return array |
15
|
|
|
*/ |
16
|
|
|
public function getSites() : array |
17
|
|
|
{ |
18
|
|
|
return (array)$this->master->doRequest( |
19
|
|
|
'GET', |
20
|
|
|
'/admin/WEBAPI/Endpoints/v1_0/SettingService/{KEY}/Sites' |
21
|
|
|
); |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help/operations/GetCountries |
26
|
|
|
* |
27
|
|
|
* @return array |
28
|
|
|
*/ |
29
|
|
|
public function getCountries() : array |
30
|
|
|
{ |
31
|
|
|
return (array)$this->master->doRequest( |
32
|
|
|
'GET', |
33
|
|
|
'/admin/WEBAPI/Endpoints/v1_0/SettingService/{KEY}/Countries' |
34
|
|
|
); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help/operations/GetCurrencies |
39
|
|
|
* |
40
|
|
|
* @return array |
41
|
|
|
*/ |
42
|
|
|
public function getCurrencies() : array |
43
|
|
|
{ |
44
|
|
|
return (array)$this->master->doRequest( |
45
|
|
|
'GET', |
46
|
|
|
'/admin/WEBAPI/Endpoints/v1_0/SettingService/{KEY}/Currencies' |
47
|
|
|
); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help/operations/GetPaymentMethods |
52
|
|
|
* |
53
|
|
|
* @param int $siteId |
54
|
|
|
* @return array |
55
|
|
|
*/ |
56
|
|
|
public function getPaymentMethods(int $siteId) : array |
57
|
|
|
{ |
58
|
|
|
Assert::that($siteId)->greaterThan(0, 'The $siteId has to be positive'); |
59
|
|
|
|
60
|
|
|
return (array)$this->master->doRequest( |
61
|
|
|
'GET', |
62
|
|
|
sprintf('/admin/WEBAPI/Endpoints/v1_0/SettingService/{KEY}/PaymentMethods/%d', $siteId) |
63
|
|
|
); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help/operations/GetShippingMethods |
68
|
|
|
* |
69
|
|
|
* @param int $siteId |
70
|
|
|
* @return array |
71
|
|
|
*/ |
72
|
|
|
public function getShippingMethods(int $siteId) : array |
73
|
|
|
{ |
74
|
|
|
Assert::that($siteId)->greaterThan(0, 'The $siteId has to be positive'); |
75
|
|
|
|
76
|
|
|
return (array)$this->master->doRequest( |
77
|
|
|
'GET', |
78
|
|
|
sprintf('/admin/WEBAPI/Endpoints/v1_0/SettingService/{KEY}/ShippingMethods/%d', $siteId) |
79
|
|
|
); |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help/operations/GetCompanyInfo |
84
|
|
|
* |
85
|
|
|
* @param int $siteId |
86
|
|
|
* @return array |
87
|
|
|
*/ |
88
|
|
|
public function getCompanyInfo(int $siteId) : array |
89
|
|
|
{ |
90
|
|
|
Assert::that($siteId)->greaterThan(0, 'The $siteId has to be positive'); |
91
|
|
|
|
92
|
|
|
return (array)$this->master->doRequest( |
93
|
|
|
'GET', |
94
|
|
|
sprintf('/admin/WEBAPI/Endpoints/v1_0/SettingService/{KEY}/CompanyInfo/%d', $siteId) |
95
|
|
|
); |
96
|
|
|
} |
97
|
|
|
} |
98
|
|
|
|