PayPal\Api\Authorization::reauthorize PHP Method

reauthorize() public method

Reauthorizes a PayPal account payment, by authorization ID. To ensure that funds are still available, reauthorize a payment after the initial three-day honor period. Supports only the amount request parameter.
public reauthorize ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Authorization
$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
    public function reauthorize($apiContext = null, $restCall = null)
    {
        ArgumentValidator::validate($this->getId(), "Id");
        $payLoad = $this->toJSON();
        $json = self::executeCall("/v1/payments/authorization/{$this->getId()}/reauthorize", "POST", $payLoad, null, $apiContext, $restCall);
        $this->fromJson($json);
        return $this;
    }

Usage Example

Beispiel #1
0
 /**
  * @dataProvider mockProvider
  * @param Authorization $obj
  */
 public function testReauthorize($obj, $mockApiContext)
 {
     $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock();
     $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(self::getJson()));
     $result = $obj->reauthorize($mockApiContext, $mockPPRestCall);
     $this->assertNotNull($result);
 }