TestClockService.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\TestHelpers;
  4. class TestClockService extends \Stripe\Service\AbstractService
  5. {
  6. /**
  7. * Starts advancing a test clock to a specified time in the future. Advancement is
  8. * done when status changes to <code>Ready</code>.
  9. *
  10. * @param string $id
  11. * @param null|array $params
  12. * @param null|array|\Stripe\Util\RequestOptions $opts
  13. *
  14. * @throws \Stripe\Exception\ApiErrorException if the request fails
  15. *
  16. * @return \Stripe\TestHelpers\TestClock
  17. */
  18. public function advance($id, $params = null, $opts = null)
  19. {
  20. return $this->request('post', $this->buildPath('/v1/test_helpers/test_clocks/%s/advance', $id), $params, $opts);
  21. }
  22. /**
  23. * Returns a list of your test clocks.
  24. *
  25. * @param null|array $params
  26. * @param null|array|\Stripe\Util\RequestOptions $opts
  27. *
  28. * @throws \Stripe\Exception\ApiErrorException if the request fails
  29. *
  30. * @return \Stripe\Collection<\Stripe\TestHelpers\TestClock>
  31. */
  32. public function all($params = null, $opts = null)
  33. {
  34. return $this->requestCollection('get', '/v1/test_helpers/test_clocks', $params, $opts);
  35. }
  36. /**
  37. * Creates a new test clock that can be attached to new customers and quotes.
  38. *
  39. * @param null|array $params
  40. * @param null|array|\Stripe\Util\RequestOptions $opts
  41. *
  42. * @throws \Stripe\Exception\ApiErrorException if the request fails
  43. *
  44. * @return \Stripe\TestHelpers\TestClock
  45. */
  46. public function create($params = null, $opts = null)
  47. {
  48. return $this->request('post', '/v1/test_helpers/test_clocks', $params, $opts);
  49. }
  50. /**
  51. * Deletes a test clock.
  52. *
  53. * @param string $id
  54. * @param null|array $params
  55. * @param null|array|\Stripe\Util\RequestOptions $opts
  56. *
  57. * @throws \Stripe\Exception\ApiErrorException if the request fails
  58. *
  59. * @return \Stripe\TestHelpers\TestClock
  60. */
  61. public function delete($id, $params = null, $opts = null)
  62. {
  63. return $this->request('delete', $this->buildPath('/v1/test_helpers/test_clocks/%s', $id), $params, $opts);
  64. }
  65. /**
  66. * Retrieves a test clock.
  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\TestHelpers\TestClock
  75. */
  76. public function retrieve($id, $params = null, $opts = null)
  77. {
  78. return $this->request('get', $this->buildPath('/v1/test_helpers/test_clocks/%s', $id), $params, $opts);
  79. }
  80. }