PayPal\Api\Webhook::getAllWithParams PHP Метод

getAllWithParams() публичный статический Метод

Lists all webhooks for an app.
public static getAllWithParams ( array $params = [], ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookList
$params array
$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
Результат WebhookList
    public static function getAllWithParams($params = array(), $apiContext = null, $restCall = null)
    {
        ArgumentValidator::validate($params, 'params');
        $payLoad = "";
        $allowedParams = array('anchor_type' => 1);
        $json = self::executeCall("/v1/notifications/webhooks?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad, null, $apiContext, $restCall);
        $ret = new WebhookList();
        $ret->fromJson($json);
        return $ret;
    }

Usage Example

Пример #1
0
 /**
  * @dataProvider mockProvider
  * @param Webhook $obj
  */
 public function testGetAll($obj, $mockApiContext)
 {
     $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock();
     $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(WebhookListTest::getJson()));
     $params = array();
     $result = $obj->getAllWithParams($params, $mockApiContext, $mockPPRestCall);
     $this->assertNotNull($result);
 }