| @@ 454-465 (lines=12) @@ | ||
| 451 | * |
|
| 452 | * @return Payment |
|
| 453 | */ |
|
| 454 | public function capture() |
|
| 455 | { |
|
| 456 | if ($this->order !== null) { |
|
| 457 | $path = sprintf('/%s/%s/%s/%s', MoipResource::VERSION, self::PATH, $this->getId(), 'capture'); |
|
| 458 | } else { |
|
| 459 | throw new \Exception('Sorry, multipayment capture is not available on this version'); |
|
| 460 | } |
|
| 461 | ||
| 462 | $response = $this->httpRequest($path, Requests::POST, $this); |
|
| 463 | ||
| 464 | return $this->populate($response); |
|
| 465 | } |
|
| 466 | ||
| 467 | /** |
|
| 468 | * Avoid a pre-authorized amount on a credit card payment. |
|
| @@ 474-485 (lines=12) @@ | ||
| 471 | * |
|
| 472 | * @return Payment |
|
| 473 | */ |
|
| 474 | public function avoid() |
|
| 475 | { |
|
| 476 | if ($this->order !== null) { |
|
| 477 | $path = sprintf('/%s/%s/%s/%s', MoipResource::VERSION, self::PATH, $this->getId(), 'void'); |
|
| 478 | } else { |
|
| 479 | throw new \Exception('Sorry, multipayment capture is not available on this version'); |
|
| 480 | } |
|
| 481 | ||
| 482 | $response = $this->httpRequest($path, Requests::POST, $this); |
|
| 483 | ||
| 484 | return $this->populate($response); |
|
| 485 | } |
|
| 486 | ||
| 487 | /** |
|
| 488 | * Get the payment status. |
|