original_string: 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']);
      }
code: 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']);
      }
code_tokens: 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' ] ) ; }
docstring: Captures a Payment.
  
  @param   Payplug\Payplug    $payplug    the client configuration
  
  @return  null|Payment the captured payment or null on error
  
  @throws  Payplug\Exception\ConfigurationNotSetException
docstring_tokens: Captures a Payment .