Code Duplication    Length = 12-12 lines in 2 locations

src/Resource/Payment.php 2 locations

@@ 479-490 (lines=12) @@
476
     *
477
     * @return Payment
478
     */
479
    public function capture()
480
    {
481
        if ($this->order !== null) {
482
            $path = sprintf('/%s/%s/%s/%s', MoipResource::VERSION, self::PATH, $this->getId(), 'capture');
483
        } else {
484
            throw new \Exception('Sorry, multipayment capture is not available on this version');
485
        }
486
487
        $response = $this->httpRequest($path, Requests::POST, $this);
488
489
        return $this->populate($response);
490
    }
491
492
    /**
493
     * Avoid a pre-authorized amount on a credit card payment.
@@ 499-510 (lines=12) @@
496
     *
497
     * @return Payment
498
     */
499
    public function avoid()
500
    {
501
        if ($this->order !== null) {
502
            $path = sprintf('/%s/%s/%s/%s', MoipResource::VERSION, self::PATH, $this->getId(), 'void');
503
        } else {
504
            throw new \Exception('Sorry, multipayment capture is not available on this version');
505
        }
506
507
        $response = $this->httpRequest($path, Requests::POST, $this);
508
509
        return $this->populate($response);
510
    }
511
}
512