| 1 |
<?php |
| 2 |
|
| 3 |
// File generated from our OpenAPI spec |
| 4 |
|
| 5 |
namespace Stripe\Service; |
| 6 |
|
| 7 |
class WebhookEndpointService extends \Stripe\Service\AbstractService |
| 8 |
{ |
| 9 |
/** |
| 10 |
* Returns a list of your webhook endpoints. |
| 11 |
* |
| 12 |
* @param null|array $params |
| 13 |
* @param null|array|\Stripe\Util\RequestOptions $opts |
| 14 |
* |
| 15 |
* @throws \Stripe\Exception\ApiErrorException if the request fails |
| 16 |
* |
| 17 |
* @return \Stripe\Collection<\Stripe\WebhookEndpoint> |
| 18 |
*/ |
| 19 |
public function all($params = null, $opts = null) |
| 20 |
{ |
| 21 |
return $this->requestCollection('get', '/v1/webhook_endpoints', $params, $opts); |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* A webhook endpoint must have a <code>url</code> and a list of |
| 26 |
* <code>enabled_events</code>. You may optionally specify the Boolean |
| 27 |
* <code>connect</code> parameter. If set to true, then a Connect webhook endpoint |
| 28 |
* that notifies the specified <code>url</code> about events from all connected |
| 29 |
* accounts is created; otherwise an account webhook endpoint that notifies the |
| 30 |
* specified <code>url</code> only about events from your account is created. You |
| 31 |
* can also create webhook endpoints in the <a |
| 32 |
* href="https://dashboard.stripe.com/account/webhooks">webhooks settings</a> |
| 33 |
* section of the Dashboard. |
| 34 |
* |
| 35 |
* @param null|array $params |
| 36 |
* @param null|array|\Stripe\Util\RequestOptions $opts |
| 37 |
* |
| 38 |
* @throws \Stripe\Exception\ApiErrorException if the request fails |
| 39 |
* |
| 40 |
* @return \Stripe\WebhookEndpoint |
| 41 |
*/ |
| 42 |
public function create($params = null, $opts = null) |
| 43 |
{ |
| 44 |
return $this->request('post', '/v1/webhook_endpoints', $params, $opts); |
| 45 |
} |
| 46 |
|
| 47 |
/** |
| 48 |
* You can also delete webhook endpoints via the <a |
| 49 |
* href="https://dashboard.stripe.com/account/webhooks">webhook endpoint |
| 50 |
* management</a> page of the Stripe dashboard. |
| 51 |
* |
| 52 |
* @param string $id |
| 53 |
* @param null|array $params |
| 54 |
* @param null|array|\Stripe\Util\RequestOptions $opts |
| 55 |
* |
| 56 |
* @throws \Stripe\Exception\ApiErrorException if the request fails |
| 57 |
* |
| 58 |
* @return \Stripe\WebhookEndpoint |
| 59 |
*/ |
| 60 |
public function delete($id, $params = null, $opts = null) |
| 61 |
{ |
| 62 |
return $this->request('delete', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); |
| 63 |
} |
| 64 |
|
| 65 |
/** |
| 66 |
* Retrieves the webhook endpoint with the given ID. |
| 67 |
* |
| 68 |
* @param string $id |
| 69 |
* @param null|array $params |
| 70 |
* @param null|array|\Stripe\Util\RequestOptions $opts |
| 71 |
* |
| 72 |
* @throws \Stripe\Exception\ApiErrorException if the request fails |
| 73 |
* |
| 74 |
* @return \Stripe\WebhookEndpoint |
| 75 |
*/ |
| 76 |
public function retrieve($id, $params = null, $opts = null) |
| 77 |
{ |
| 78 |
return $this->request('get', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); |
| 79 |
} |
| 80 |
|
| 81 |
/** |
| 82 |
* Updates the webhook endpoint. You may edit the <code>url</code>, the list of |
| 83 |
* <code>enabled_events</code>, and the status of your endpoint. |
| 84 |
* |
| 85 |
* @param string $id |
| 86 |
* @param null|array $params |
| 87 |
* @param null|array|\Stripe\Util\RequestOptions $opts |
| 88 |
* |
| 89 |
* @throws \Stripe\Exception\ApiErrorException if the request fails |
| 90 |
* |
| 91 |
* @return \Stripe\WebhookEndpoint |
| 92 |
*/ |
| 93 |
public function update($id, $params = null, $opts = null) |
| 94 |
{ |
| 95 |
return $this->request('post', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); |
| 96 |
} |
| 97 |
} |
| 98 |
|