PayPal\Api\Webhook::setUrl PHP Method

setUrl() public method

The URL that is configured to listen on localhost for incoming POST notification messages that contain event information.
public setUrl ( string $url )
$url string
    public function setUrl($url)
    {
        UrlValidator::validate($url, "Url");
        $this->url = $url;
        return $this;
    }

Usage Example

 public function testCreate()
 {
     $request = $this->operation['request']['body'];
     $obj = new Webhook($request);
     // Adding a random url request to make it unique
     $obj->setUrl($obj->getUrl() . '?rand=' . uniqid());
     $result = null;
     try {
         $result = $obj->create($this->apiContext, $this->mockPayPalRestCall);
     } catch (PayPalConnectionException $ex) {
         $data = $ex->getData();
         if (strpos($data, 'WEBHOOK_NUMBER_LIMIT_EXCEEDED') !== false) {
             $this->deleteAll();
             $result = $obj->create($this->apiContext, $this->mockPayPalRestCall);
         } else {
             $this->fail($ex->getMessage());
         }
     }
     $this->assertNotNull($result);
     return $result;
 }
All Usage Examples Of PayPal\Api\Webhook::setUrl