@@ 86-103 (lines=18) @@ | ||
83 | return (new PacUser())->map($data); |
|
84 | } |
|
85 | ||
86 | public function editUser($rfc, $params = []) |
|
87 | { |
|
88 | $response = $this->request( |
|
89 | $this->url('registration'), |
|
90 | 'edit', |
|
91 | $this->prepareGenericParams(array_merge(['taxpayer_id' => $rfc], $params)) |
|
92 | ); |
|
93 | ||
94 | if (is_a($response, 'SoapFault')) { |
|
95 | throw new PacErrorException($response->faultstring); |
|
96 | } |
|
97 | ||
98 | if (!$response->editResult->success) { |
|
99 | throw new PacErrorException($response->editResult->message); |
|
100 | } |
|
101 | ||
102 | return $response->editResult->message; |
|
103 | } |
|
104 | ||
105 | public function getUsers(): array |
|
106 | { |
|
@@ 136-153 (lines=18) @@ | ||
133 | ); |
|
134 | } |
|
135 | ||
136 | public function assignStamps($rfc = null, $credit = 0) |
|
137 | { |
|
138 | $response = $this->request( |
|
139 | $this->url('registration'), |
|
140 | 'assign', |
|
141 | $this->prepareStampParams(['taxpayer_id' => $rfc, 'credit' => $credit]) |
|
142 | ); |
|
143 | ||
144 | if (is_a($response, 'SoapFault')) { |
|
145 | throw new PacErrorException($response->faultstring); |
|
146 | } |
|
147 | ||
148 | if (!$response->assignResult->success) { |
|
149 | throw new PacErrorException($response->assignResult->message); |
|
150 | } |
|
151 | ||
152 | return $response->assignResult->message; |
|
153 | } |
|
154 | ||
155 | protected function url($wsdl = null) |
|
156 | { |