EventService.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service;
  4. class EventService extends \Stripe\Service\AbstractService
  5. {
  6. /**
  7. * List events, going back up to 30 days. Each event data is rendered according to
  8. * Stripe API version at its creation time, specified in <a
  9. * href="/docs/api/events/object">event object</a> <code>api_version</code>
  10. * attribute (not according to your current Stripe API version or
  11. * <code>Stripe-Version</code> header).
  12. *
  13. * @param null|array $params
  14. * @param null|array|\Stripe\Util\RequestOptions $opts
  15. *
  16. * @throws \Stripe\Exception\ApiErrorException if the request fails
  17. *
  18. * @return \Stripe\Collection
  19. */
  20. public function all($params = null, $opts = null)
  21. {
  22. return $this->requestCollection('get', '/v1/events', $params, $opts);
  23. }
  24. /**
  25. * Retrieves the details of an event. Supply the unique identifier of the event,
  26. * which you might have received in a webhook.
  27. *
  28. * @param string $id
  29. * @param null|array $params
  30. * @param null|array|\Stripe\Util\RequestOptions $opts
  31. *
  32. * @throws \Stripe\Exception\ApiErrorException if the request fails
  33. *
  34. * @return \Stripe\Event
  35. */
  36. public function retrieve($id, $params = null, $opts = null)
  37. {
  38. return $this->request('get', $this->buildPath('/v1/events/%s', $id), $params, $opts);
  39. }
  40. }