@@ 117-134 (lines=18) @@ | ||
114 | return (new PacUser())->map($data); |
|
115 | } |
|
116 | ||
117 | public function editUser($rfc, $params = []) |
|
118 | { |
|
119 | $response = $this->request( |
|
120 | $this->url('registration'), |
|
121 | 'edit', |
|
122 | $this->prepareGenericParams(array_merge(['taxpayer_id' => $rfc], $params)) |
|
123 | ); |
|
124 | ||
125 | if (is_a($response, 'SoapFault')) { |
|
126 | throw new PacErrorException($response->faultstring); |
|
127 | } |
|
128 | ||
129 | if (!$response->editResult->success) { |
|
130 | throw new PacErrorException($response->editResult->message); |
|
131 | } |
|
132 | ||
133 | return $response->editResult->message; |
|
134 | } |
|
135 | ||
136 | public function getUsers(): ArrayAccess |
|
137 | { |
|
@@ 169-186 (lines=18) @@ | ||
166 | ); |
|
167 | } |
|
168 | ||
169 | public function assignStamps($rfc = null, $credit = 0) |
|
170 | { |
|
171 | $response = $this->request( |
|
172 | $this->url('registration'), |
|
173 | 'assign', |
|
174 | $this->prepareStampParams(['taxpayer_id' => $rfc, 'credit' => $credit]) |
|
175 | ); |
|
176 | ||
177 | if (is_a($response, 'SoapFault')) { |
|
178 | throw new PacErrorException($response->faultstring); |
|
179 | } |
|
180 | ||
181 | if (!$response->assignResult->success) { |
|
182 | throw new PacErrorException($response->assignResult->message); |
|
183 | } |
|
184 | ||
185 | return $response->assignResult->message; |
|
186 | } |
|
187 | ||
188 | protected function url($wsdl = null) |
|
189 | { |