PayPal\Api\Capture::get PHP Method

get() public static method

Shows details for a captured payment, by ID.
public static get ( string $captureId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Capture
$captureId string
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
return Capture
    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;
    }

Usage Example

 /**
  * @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);
 }
All Usage Examples Of PayPal\Api\Capture::get