capture() public method

Captures and processes an authorization, by ID. To use this call, the original payment call must specify an intent of authorize.
public capture ( Capture $capture, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Capture
$capture Capture
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPalRestCall is the Rest Call Service that is used to make rest calls
return Capture
Esempio n. 1
0
 /**
  * @dataProvider mockProvider
  * @param Authorization $obj
  */
 public function testCapture($obj, $mockApiContext)
 {
     $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock();
     $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(CaptureTest::getJson()));
     $capture = CaptureTest::getObject();
     $result = $obj->capture($capture, $mockApiContext, $mockPPRestCall);
     $this->assertNotNull($result);
 }
Esempio n. 2
0
 public function captureAuthorizedTransactionRequest(Authorization $authorization, Capture $capture)
 {
     $apiContext = $this->contextFactory->createContext();
     return $authorization->capture($capture, $apiContext);
 }