1 | <?php |
||
7 | class XMLRequest extends Request |
||
8 | { |
||
9 | public static $allowedMethods = [ |
||
10 | 'cancel', |
||
11 | 'getBalance', |
||
12 | 'checkCoupon', |
||
13 | 'getReportBySms', |
||
14 | 'getReportBySource', |
||
15 | 'getReportByNumber', |
||
16 | ]; |
||
17 | |||
18 | /** |
||
19 | * @param string $smsId |
||
20 | * @return array|null |
||
21 | */ |
||
22 | public function cancel($smsId) |
||
26 | |||
27 | /** |
||
28 | * @param string $coupon |
||
29 | * @param bool $markAsUsed |
||
30 | * @param null|string $phone |
||
31 | * @return array|null |
||
32 | */ |
||
33 | public function checkCoupon($coupon, $markAsUsed = true, $phone = null) |
||
44 | |||
45 | /** |
||
46 | * @param string $dateFrom |
||
47 | * @param string $dateTo |
||
48 | * @param null|string $source |
||
49 | * @return array|null |
||
50 | */ |
||
51 | public function getReportBySource($dateFrom, $dateTo, $source = null) |
||
62 | |||
63 | /** |
||
64 | * @param string $smsId |
||
65 | * @return array|null |
||
66 | */ |
||
67 | public function getReportBySms($smsId) |
||
71 | |||
72 | /** |
||
73 | * @param string $dateFrom |
||
74 | * @param string $dateTo |
||
75 | * @param null|string $number |
||
76 | * @return array|null |
||
77 | */ |
||
78 | public function getReportByNumber($dateFrom, $dateTo, $number = null) |
||
87 | |||
88 | /** |
||
89 | * @return array|null |
||
90 | */ |
||
91 | public function getBalance() |
||
95 | |||
96 | /** |
||
97 | * @param string $action |
||
98 | * @return string |
||
99 | */ |
||
100 | public function makeEndPoint($action) |
||
104 | |||
105 | /** |
||
106 | * @param array $requestBody |
||
107 | * @return mixed |
||
108 | */ |
||
109 | protected function formatRequestBody(array $requestBody) |
||
113 | |||
114 | /** |
||
115 | * Parses XML from response and returns it as an array |
||
116 | * |
||
117 | * @param string $response |
||
118 | * @return array |
||
119 | */ |
||
120 | protected function parseResponse($response) |
||
125 | } |