@@ 513-524 (lines=12) @@ | ||
510 | * |
|
511 | * @return Payment |
|
512 | */ |
|
513 | public function capture() |
|
514 | { |
|
515 | if ($this->order !== null) { |
|
516 | $path = sprintf('/%s/%s/%s/%s', MoipResource::VERSION, self::PATH, $this->getId(), 'capture'); |
|
517 | } else { |
|
518 | throw new \Exception('Sorry, multipayment capture is not available on this version'); |
|
519 | } |
|
520 | ||
521 | $response = $this->httpRequest($path, Requests::POST, $this); |
|
522 | ||
523 | return $this->populate($response); |
|
524 | } |
|
525 | ||
526 | /** |
|
527 | * Avoid a pre-authorized amount on a credit card payment. |
|
@@ 533-544 (lines=12) @@ | ||
530 | * |
|
531 | * @return Payment |
|
532 | */ |
|
533 | public function avoid() |
|
534 | { |
|
535 | if ($this->order !== null) { |
|
536 | $path = sprintf('/%s/%s/%s/%s', MoipResource::VERSION, self::PATH, $this->getId(), 'void'); |
|
537 | } else { |
|
538 | throw new \Exception('Sorry, multipayment capture is not available on this version'); |
|
539 | } |
|
540 | ||
541 | $response = $this->httpRequest($path, Requests::POST, $this); |
|
542 | ||
543 | return $this->populate($response); |
|
544 | } |
|
545 | ||
546 | /** |
|
547 | * Authorize a payment (Available only in sandbox to credit card payment with status IN_ANALYSIS and billet payment with status WAITING) |