CardService.php 2.2 KB

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