TransactionService.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 TransactionService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Returns a list of Issuing <code>Transaction</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\Transaction>
  21. */
  22. public function all($params = null, $opts = null)
  23. {
  24. return $this->requestCollection('get', '/v1/issuing/transactions', $params, $opts);
  25. }
  26. /**
  27. * Retrieves an Issuing <code>Transaction</code> object.
  28. *
  29. * @param string $id
  30. * @param null|array $params
  31. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  32. *
  33. * @throws \Stripe\Exception\ApiErrorException if the request fails
  34. *
  35. * @return \Stripe\Issuing\Transaction
  36. */
  37. public function retrieve($id, $params = null, $opts = null)
  38. {
  39. return $this->request('get', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts);
  40. }
  41. /**
  42. * Updates the specified Issuing <code>Transaction</code> object by setting the
  43. * values of the parameters passed. Any parameters not provided will be left
  44. * unchanged.
  45. *
  46. * @param string $id
  47. * @param null|array $params
  48. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  49. *
  50. * @throws \Stripe\Exception\ApiErrorException if the request fails
  51. *
  52. * @return \Stripe\Issuing\Transaction
  53. */
  54. public function update($id, $params = null, $opts = null)
  55. {
  56. return $this->request('post', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts);
  57. }
  58. }