Code Duplication    Length = 12-12 lines in 2 locations

src/Resource/Payment.php 2 locations

@@ 493-504 (lines=12) @@
490
     *
491
     * @return Payment
492
     */
493
    public function capture()
494
    {
495
        if ($this->order !== null) {
496
            $path = sprintf('/%s/%s/%s/%s', MoipResource::VERSION, self::PATH, $this->getId(), 'capture');
497
        } else {
498
            throw new \Exception('Sorry, multipayment capture is not available on this version');
499
        }
500
501
        $response = $this->httpRequest($path, Requests::POST, $this);
502
503
        return $this->populate($response);
504
    }
505
506
    /**
507
     * Avoid a pre-authorized amount on a credit card payment.
@@ 513-524 (lines=12) @@
510
     *
511
     * @return Payment
512
     */
513
    public function avoid()
514
    {
515
        if ($this->order !== null) {
516
            $path = sprintf('/%s/%s/%s/%s', MoipResource::VERSION, self::PATH, $this->getId(), 'void');
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