@@ 605-615 (lines=11) @@ | ||
602 | * |
|
603 | * @return Payment |
|
604 | */ |
|
605 | public function capture() |
|
606 | { |
|
607 | $path = sprintf('/%s/%s/%s/%s', MoipResource::VERSION, self::PATH, $this->getId(), 'capture'); |
|
608 | if ($this->isMultipayment($this->getId())) { |
|
609 | $path = sprintf('/%s/%s/%s/%s', MoipResource::VERSION, self::MULTI_PAYMENTS_PATH, $this->getId(), 'capture'); |
|
610 | } |
|
611 | ||
612 | $response = $this->httpRequest($path, Requests::POST, $this); |
|
613 | ||
614 | return $this->populate($response); |
|
615 | } |
|
616 | ||
617 | /** |
|
618 | * Cancel a pre-authorized amount on a credit card payment. |
|
@@ 624-634 (lines=11) @@ | ||
621 | * |
|
622 | * @return Payment |
|
623 | */ |
|
624 | public function cancel() |
|
625 | { |
|
626 | $path = sprintf('/%s/%s/%s/%s', MoipResource::VERSION, self::PATH, $this->getId(), 'void'); |
|
627 | if ($this->isMultipayment($this->getId())) { |
|
628 | $path = sprintf('/%s/%s/%s/%s', MoipResource::VERSION, self::MULTI_PAYMENTS_PATH, $this->getId(), 'void'); |
|
629 | } |
|
630 | ||
631 | $response = $this->httpRequest($path, Requests::POST, $this); |
|
632 | ||
633 | return $this->populate($response); |
|
634 | } |
|
635 | ||
636 | /** |
|
637 | * Cancel a pre-authorized amount on a credit card payment. |