CardService.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 CardService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Returns a list of Issuing <code>Card</code> objects. The objects are sorted in
  12. * descending order by creation date, with the most recently created object
  13. * 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\Card>
  21. */
  22. public function all($params = null, $opts = null)
  23. {
  24. return $this->requestCollection('get', '/v1/issuing/cards', $params, $opts);
  25. }
  26. /**
  27. * Creates an Issuing <code>Card</code> object.
  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\Card
  35. */
  36. public function create($params = null, $opts = null)
  37. {
  38. return $this->request('post', '/v1/issuing/cards', $params, $opts);
  39. }
  40. /**
  41. * Retrieves an Issuing <code>Card</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\Card
  50. */
  51. public function retrieve($id, $params = null, $opts = null)
  52. {
  53. return $this->request('get', $this->buildPath('/v1/issuing/cards/%s', $id), $params, $opts);
  54. }
  55. /**
  56. * Updates the specified Issuing <code>Card</code> object by setting the values of
  57. * the parameters passed. Any parameters not provided will be left unchanged.
  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\Issuing\Card
  66. */
  67. public function update($id, $params = null, $opts = null)
  68. {
  69. return $this->request('post', $this->buildPath('/v1/issuing/cards/%s', $id), $params, $opts);
  70. }
  71. }