PayPal\Api\WebhookEvent::all PHP Method

all() public static method

Lists webhook event notifications. Use query parameters to filter the response.
public static all ( array $params, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookEventList
$params array
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
return WebhookEventList
    public static function all($params, $apiContext = null, $restCall = null)
    {
        ArgumentValidator::validate($params, 'params');
        $payLoad = "";
        $allowedParams = array('page_size' => 1, 'start_time' => 1, 'end_time' => 1, 'transaction_id' => 1, 'event_type' => 1);
        $json = self::executeCall("/v1/notifications/webhooks-events" . "?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad, null, $apiContext, $restCall);
        $ret = new WebhookEventList();
        $ret->fromJson($json);
        return $ret;
    }

Usage Example

 /**
  * @dataProvider mockProvider
  * @param WebhookEvent $obj
  */
 public function testList($obj, $mockApiContext)
 {
     $mockPayPalRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock();
     $mockPayPalRestCall->expects($this->any())->method('execute')->will($this->returnValue(WebhookEventListTest::getJson()));
     $params = array();
     $result = $obj->all($params, $mockApiContext, $mockPayPalRestCall);
     $this->assertNotNull($result);
 }
All Usage Examples Of PayPal\Api\WebhookEvent::all