* * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { return $this->requestCollection('get', '/v1/webhook_endpoints', $params, $opts); } /** * A webhook endpoint must have a url and a list of * enabled_events. You may optionally specify the Boolean * connect parameter. If set to true, then a Connect webhook endpoint * that notifies the specified url about events from all connected * accounts is created; otherwise an account webhook endpoint that notifies the * specified url only about events from your account is created. You * can also create webhook endpoints in the webhooks settings * section of the Dashboard. * * @param null|array{api_version?: string, connect?: bool, description?: null|string, enabled_events: string[], expand?: string[], metadata?: null|array, url: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\WebhookEndpoint * * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { return $this->request('post', '/v1/webhook_endpoints', $params, $opts); } /** * You can also delete webhook endpoints via the webhook endpoint * management page of the Stripe dashboard. * * @param string $id * @param null|array $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\WebhookEndpoint * * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function delete($id, $params = null, $opts = null) { return $this->request('delete', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); } /** * Retrieves the webhook endpoint with the given ID. * * @param string $id * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\WebhookEndpoint * * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { return $this->request('get', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); } /** * Updates the webhook endpoint. You may edit the url, the list of * enabled_events, and the status of your endpoint. * * @param string $id * @param null|array{description?: null|string, disabled?: bool, enabled_events?: string[], expand?: string[], metadata?: null|array, url?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\WebhookEndpoint * * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { return $this->request('post', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); } }