| @@ 106-123 (lines=18) @@ | ||
| 103 | return (new PacUser())->map($data); |
|
| 104 | } |
|
| 105 | ||
| 106 | public function editUser($rfc, $params = []) |
|
| 107 | { |
|
| 108 | $response = $this->request( |
|
| 109 | $this->url('registration'), |
|
| 110 | 'edit', |
|
| 111 | $this->prepareGenericParams(array_merge(['taxpayer_id' => $rfc], $params)) |
|
| 112 | ); |
|
| 113 | ||
| 114 | if (is_a($response, 'SoapFault')) { |
|
| 115 | throw new PacErrorException($response->faultstring); |
|
| 116 | } |
|
| 117 | ||
| 118 | if (!$response->editResult->success) { |
|
| 119 | throw new PacErrorException($response->editResult->message); |
|
| 120 | } |
|
| 121 | ||
| 122 | return $response->editResult->message; |
|
| 123 | } |
|
| 124 | ||
| 125 | public function getUsers(): ArrayAccess |
|
| 126 | { |
|
| @@ 158-175 (lines=18) @@ | ||
| 155 | ); |
|
| 156 | } |
|
| 157 | ||
| 158 | public function assignStamps($rfc = null, $credit = 0) |
|
| 159 | { |
|
| 160 | $response = $this->request( |
|
| 161 | $this->url('registration'), |
|
| 162 | 'assign', |
|
| 163 | $this->prepareStampParams(['taxpayer_id' => $rfc, 'credit' => $credit]) |
|
| 164 | ); |
|
| 165 | ||
| 166 | if (is_a($response, 'SoapFault')) { |
|
| 167 | throw new PacErrorException($response->faultstring); |
|
| 168 | } |
|
| 169 | ||
| 170 | if (!$response->assignResult->success) { |
|
| 171 | throw new PacErrorException($response->assignResult->message); |
|
| 172 | } |
|
| 173 | ||
| 174 | return $response->assignResult->message; |
|
| 175 | } |
|
| 176 | ||
| 177 | protected function url($wsdl = null) |
|
| 178 | { |
|