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