| @@ 154-165 (lines=12) @@ | ||
| 151 | * @return array |
|
| 152 | * @throws MercadoPagoException If request failed. |
|
| 153 | */ |
|
| 154 | public function refundPayment($id) |
|
| 155 | { |
|
| 156 | $response = $this->client->put( |
|
| 157 | '/collections/' . $id, |
|
| 158 | [ |
|
| 159 | 'status' => 'refunded', |
|
| 160 | ], |
|
| 161 | ['access_token' => $this->getAccessToken()] |
|
| 162 | ); |
|
| 163 | ||
| 164 | return $this->handleResponse($response); |
|
| 165 | } |
|
| 166 | ||
| 167 | /** |
|
| 168 | * Cancel pending payment |
|
| @@ 173-184 (lines=12) @@ | ||
| 170 | * @return array |
|
| 171 | * @throws MercadoPagoException If request failed. |
|
| 172 | */ |
|
| 173 | public function cancelPayment($id) |
|
| 174 | { |
|
| 175 | $response = $this->client->put( |
|
| 176 | '/collections/' . $id, |
|
| 177 | [ |
|
| 178 | 'status' => 'cancelled', |
|
| 179 | ], |
|
| 180 | ['access_token' => $this->getAccessToken()] |
|
| 181 | ); |
|
| 182 | ||
| 183 | return $this->handleResponse($response); |
|
| 184 | } |
|
| 185 | ||
| 186 | /** |
|
| 187 | * Cancel preapproval payment. |
|
| @@ 192-203 (lines=12) @@ | ||
| 189 | * @return array |
|
| 190 | * @throws MercadoPagoException If request failed. |
|
| 191 | */ |
|
| 192 | public function cancelPreapprovalPayment($id) |
|
| 193 | { |
|
| 194 | $response = $this->client->put( |
|
| 195 | '/preapproval/' . $id, |
|
| 196 | [ |
|
| 197 | 'status' => 'cancelled', |
|
| 198 | ], |
|
| 199 | ['access_token' => $this->getAccessToken()] |
|
| 200 | ); |
|
| 201 | ||
| 202 | return $this->handleResponse($response); |
|
| 203 | } |
|
| 204 | ||
| 205 | /** |
|
| 206 | * Search payments according to filters, with pagination. |
|