RegistrationService.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Tax;
  4. /**
  5. * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  6. * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  7. */
  8. class RegistrationService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Returns a list of Tax <code>Registration</code> objects.
  12. *
  13. * @param null|array $params
  14. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  15. *
  16. * @throws \Stripe\Exception\ApiErrorException if the request fails
  17. *
  18. * @return \Stripe\Collection<\Stripe\Tax\Registration>
  19. */
  20. public function all($params = null, $opts = null)
  21. {
  22. return $this->requestCollection('get', '/v1/tax/registrations', $params, $opts);
  23. }
  24. /**
  25. * Creates a new Tax <code>Registration</code> object.
  26. *
  27. * @param null|array $params
  28. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  29. *
  30. * @throws \Stripe\Exception\ApiErrorException if the request fails
  31. *
  32. * @return \Stripe\Tax\Registration
  33. */
  34. public function create($params = null, $opts = null)
  35. {
  36. return $this->request('post', '/v1/tax/registrations', $params, $opts);
  37. }
  38. /**
  39. * Returns a Tax <code>Registration</code> object.
  40. *
  41. * @param string $id
  42. * @param null|array $params
  43. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  44. *
  45. * @throws \Stripe\Exception\ApiErrorException if the request fails
  46. *
  47. * @return \Stripe\Tax\Registration
  48. */
  49. public function retrieve($id, $params = null, $opts = null)
  50. {
  51. return $this->request('get', $this->buildPath('/v1/tax/registrations/%s', $id), $params, $opts);
  52. }
  53. /**
  54. * Updates an existing Tax <code>Registration</code> object.
  55. *
  56. * A registration cannot be deleted after it has been created. If you wish to end a
  57. * registration you may do so by setting <code>expires_at</code>.
  58. *
  59. * @param string $id
  60. * @param null|array $params
  61. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  62. *
  63. * @throws \Stripe\Exception\ApiErrorException if the request fails
  64. *
  65. * @return \Stripe\Tax\Registration
  66. */
  67. public function update($id, $params = null, $opts = null)
  68. {
  69. return $this->request('post', $this->buildPath('/v1/tax/registrations/%s', $id), $params, $opts);
  70. }
  71. }