CardholderService.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Issuing;
  4. /**
  5. * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  6. * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  7. */
  8. class CardholderService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Returns a list of Issuing <code>Cardholder</code> objects. The objects are
  12. * sorted in descending order by creation date, with the most recently created
  13. * object appearing first.
  14. *
  15. * @param null|array $params
  16. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  17. *
  18. * @throws \Stripe\Exception\ApiErrorException if the request fails
  19. *
  20. * @return \Stripe\Collection<\Stripe\Issuing\Cardholder>
  21. */
  22. public function all($params = null, $opts = null)
  23. {
  24. return $this->requestCollection('get', '/v1/issuing/cardholders', $params, $opts);
  25. }
  26. /**
  27. * Creates a new Issuing <code>Cardholder</code> object that can be issued cards.
  28. *
  29. * @param null|array $params
  30. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  31. *
  32. * @throws \Stripe\Exception\ApiErrorException if the request fails
  33. *
  34. * @return \Stripe\Issuing\Cardholder
  35. */
  36. public function create($params = null, $opts = null)
  37. {
  38. return $this->request('post', '/v1/issuing/cardholders', $params, $opts);
  39. }
  40. /**
  41. * Retrieves an Issuing <code>Cardholder</code> object.
  42. *
  43. * @param string $id
  44. * @param null|array $params
  45. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  46. *
  47. * @throws \Stripe\Exception\ApiErrorException if the request fails
  48. *
  49. * @return \Stripe\Issuing\Cardholder
  50. */
  51. public function retrieve($id, $params = null, $opts = null)
  52. {
  53. return $this->request('get', $this->buildPath('/v1/issuing/cardholders/%s', $id), $params, $opts);
  54. }
  55. /**
  56. * Updates the specified Issuing <code>Cardholder</code> object by setting the
  57. * values of the parameters passed. Any parameters not provided will be left
  58. * unchanged.
  59. *
  60. * @param string $id
  61. * @param null|array $params
  62. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  63. *
  64. * @throws \Stripe\Exception\ApiErrorException if the request fails
  65. *
  66. * @return \Stripe\Issuing\Cardholder
  67. */
  68. public function update($id, $params = null, $opts = null)
  69. {
  70. return $this->request('post', $this->buildPath('/v1/issuing/cardholders/%s', $id), $params, $opts);
  71. }
  72. }