Captures and processes an authorization, by ID. To use this call, the original payment call must specify an intent of authorize.
public capture ( |
||
$capture | ||
$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 |
Результат |
/** * @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); }
public function captureAuthorizedTransactionRequest(Authorization $authorization, Capture $capture) { $apiContext = $this->contextFactory->createContext(); return $authorization->capture($capture, $apiContext); }