ReceivedCreditService.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Treasury;
  4. /**
  5. * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  6. * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  7. */
  8. class ReceivedCreditService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Returns a list of ReceivedCredits.
  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\Treasury\ReceivedCredit>
  19. */
  20. public function all($params = null, $opts = null)
  21. {
  22. return $this->requestCollection('get', '/v1/treasury/received_credits', $params, $opts);
  23. }
  24. /**
  25. * Retrieves the details of an existing ReceivedCredit by passing the unique
  26. * ReceivedCredit ID from the ReceivedCredit list.
  27. *
  28. * @param string $id
  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\Treasury\ReceivedCredit
  35. */
  36. public function retrieve($id, $params = null, $opts = null)
  37. {
  38. return $this->request('get', $this->buildPath('/v1/treasury/received_credits/%s', $id), $params, $opts);
  39. }
  40. }