PayPal\Api\WebhookEventType::subscribedEventTypes PHP Method

subscribedEventTypes() public static method

Lists event subscriptions for a webhook, by ID.
public static subscribedEventTypes ( string $webhookId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookEventTypeList
$webhookId string
$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 WebhookEventTypeList
    public static function subscribedEventTypes($webhookId, $apiContext = null, $restCall = null)
    {
        ArgumentValidator::validate($webhookId, 'webhookId');
        $payLoad = "";
        $json = self::executeCall("/v1/notifications/webhooks/{$webhookId}/event-types", "GET", $payLoad, null, $apiContext, $restCall);
        $ret = new WebhookEventTypeList();
        $ret->fromJson($json);
        return $ret;
    }

Usage Example

 /**
  * @dataProvider mockProvider
  * @param WebhookEventType $obj
  */
 public function testSubscribedEventTypes($obj, $mockApiContext)
 {
     $mockPayPalRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock();
     $mockPayPalRestCall->expects($this->any())->method('execute')->will($this->returnValue(WebhookEventTypeListTest::getJson()));
     $result = $obj->subscribedEventTypes("webhookId", $mockApiContext, $mockPayPalRestCall);
     $this->assertNotNull($result);
 }
All Usage Examples Of PayPal\Api\WebhookEventType::subscribedEventTypes