public function capture(Payplug\Payplug $payplug = null)
    {
        if ($payplug === null) {
            $payplug = Payplug\Payplug::getDefaultConfiguration();
        }

        $httpClient = new Payplug\Core\HttpClient($payplug);
        $response = $httpClient->patch(
            Payplug\Core\APIRoutes::getRoute(Payplug\Core\APIRoutes::PAYMENT_RESOURCE, $this->id),
            array('captured' => true)
        );

        return Payment::fromAttributes($response['httpResponse']);
    }
public function capture(Payplug\Payplug $payplug = null)
    {
        if ($payplug === null) {
            $payplug = Payplug\Payplug::getDefaultConfiguration();
        }

        $httpClient = new Payplug\Core\HttpClient($payplug);
        $response = $httpClient->patch(
            Payplug\Core\APIRoutes::getRoute(Payplug\Core\APIRoutes::PAYMENT_RESOURCE, $this->id),
            array('captured' => true)
        );

        return Payment::fromAttributes($response['httpResponse']);
    }
public function capture ( Payplug \ Payplug $ payplug = null ) { if ( $ payplug === null ) { $ payplug = Payplug \ Payplug :: getDefaultConfiguration ( ) ; } $ httpClient = new Payplug \ Core \ HttpClient ( $ payplug ) ; $ response = $ httpClient -> patch ( Payplug \ Core \ APIRoutes :: getRoute ( Payplug \ Core \ APIRoutes :: PAYMENT_RESOURCE , $ this -> id ) , array ( 'captured' => true ) ) ; return Payment :: fromAttributes ( $ response [ 'httpResponse' ] ) ; }
Captures a Payment.

@param   Payplug\Payplug    $payplug    the client configuration

@return  null|Payment the captured payment or null on error

@throws  Payplug\Exception\ConfigurationNotSetException
Captures a Payment .