public static get ( string $orderId, |
||
$orderId | string | |
$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 |
public static function get($orderId, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($orderId, 'orderId');
$payLoad = "";
$json = self::executeCall("/v1/payments/orders/{$orderId}", "GET", $payLoad, null, $apiContext, $restCall);
$ret = new Order();
$ret->fromJson($json);
return $ret;
}
/** * @dataProvider mockProvider * @param Order $obj */ public function testGet($obj, $mockApiContext) { $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock(); $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(OrderTest::getJson())); $result = $obj->get("orderId", $mockApiContext, $mockPPRestCall); $this->assertNotNull($result); }