PayPal\Api\Order::get PHP Method

get() public static method

Shows details for an order, by ID.
public static get ( string $orderId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Order
$orderId string
$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 Order
    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;
    }

Usage Example

Example #1
0
 /**
  * @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);
 }
All Usage Examples Of PayPal\Api\Order::get