authorize() public method

Authorizes an order, by ID. Include an amount object in the JSON request body.
public authorize ( Authorization $authorization, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Authorization
$authorization Authorization Authorization Object with Amount value to be authorized
$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 Authorization
 /**
  * @dataProvider mockProvider
  * @param Order $obj
  */
 public function testAuthorize($obj, $mockApiContext)
 {
     $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock();
     $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(AuthorizationTest::getJson()));
     $authorization = new Authorization();
     $result = $obj->authorize($authorization, $mockApiContext, $mockPPRestCall);
     $this->assertNotNull($result);
 }