public static get ( string $captureId, |
||
$captureId | string | |
$apiContext | is the APIContext for this call. It can be used to pass dynamic configuration and credentials. | |
$restCall | is the Rest Call Service that is used to make rest calls | |
return |
public static function get($captureId, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($captureId, 'captureId');
$payLoad = "";
$json = self::executeCall("/v1/payments/capture/{$captureId}", "GET", $payLoad, null, $apiContext, $restCall);
$ret = new Capture();
$ret->fromJson($json);
return $ret;
}
/** * @dataProvider mockProvider * @param Capture $obj */ public function testGet($obj, $mockApiContext) { $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock(); $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(CaptureTest::getJson())); $result = $obj->get("captureId", $mockApiContext, $mockPPRestCall); $this->assertNotNull($result); }