ExchangeRateService.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service;
  4. class ExchangeRateService extends \Stripe\Service\AbstractService
  5. {
  6. /**
  7. * Returns a list of objects that contain the rates at which foreign currencies are
  8. * converted to one another. Only shows the currencies for which Stripe supports.
  9. *
  10. * @param null|array $params
  11. * @param null|array|\Stripe\Util\RequestOptions $opts
  12. *
  13. * @throws \Stripe\Exception\ApiErrorException if the request fails
  14. *
  15. * @return \Stripe\Collection
  16. */
  17. public function all($params = null, $opts = null)
  18. {
  19. return $this->requestCollection('get', '/v1/exchange_rates', $params, $opts);
  20. }
  21. /**
  22. * Retrieves the exchange rates from the given currency to every supported
  23. * currency.
  24. *
  25. * @param string $id
  26. * @param null|array $params
  27. * @param null|array|\Stripe\Util\RequestOptions $opts
  28. *
  29. * @throws \Stripe\Exception\ApiErrorException if the request fails
  30. *
  31. * @return \Stripe\ExchangeRate
  32. */
  33. public function retrieve($id, $params = null, $opts = null)
  34. {
  35. return $this->request('get', $this->buildPath('/v1/exchange_rates/%s', $id), $params, $opts);
  36. }
  37. }