Omnipay\PayPal\RestGateway::capture PHP Method

capture() public method

Use this resource to capture and process a previously created authorization. To use this resource, the original payment call must have the intent set to authorize.
public capture ( array $parameters = [] ) : Omnipay\PayPal\Message\RestCaptureRequest
$parameters array
return Omnipay\PayPal\Message\RestCaptureRequest
    public function capture(array $parameters = array())
    {
        return $this->createRequest('\\Omnipay\\PayPal\\Message\\RestCaptureRequest', $parameters);
    }

Usage Example

コード例 #1
0
ファイル: RestGatewayTest.php プロジェクト: omnipay/paypal
 public function testCapture()
 {
     $request = $this->gateway->capture(array('transactionReference' => 'abc123', 'amount' => 10.0, 'currency' => 'AUD'));
     $this->assertInstanceOf('\\Omnipay\\PayPal\\Message\\RestCaptureRequest', $request);
     $this->assertSame('abc123', $request->getTransactionReference());
     $endPoint = $request->getEndpoint();
     $this->assertSame('https://api.paypal.com/v1/payments/authorization/abc123/capture', $endPoint);
     $data = $request->getData();
     $this->assertNotEmpty($data);
 }