TaxCodeService.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service;
  4. class TaxCodeService extends \Stripe\Service\AbstractService
  5. {
  6. /**
  7. * A list of <a href="https://stripe.com/docs/tax/tax-codes">all tax codes
  8. * available</a> to add to Products in order to allow specific tax calculations.
  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<\Stripe\TaxCode>
  16. */
  17. public function all($params = null, $opts = null)
  18. {
  19. return $this->requestCollection('get', '/v1/tax_codes', $params, $opts);
  20. }
  21. /**
  22. * Retrieves the details of an existing tax code. Supply the unique tax code ID and
  23. * Stripe will return the corresponding tax code information.
  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\TaxCode
  32. */
  33. public function retrieve($id, $params = null, $opts = null)
  34. {
  35. return $this->request('get', $this->buildPath('/v1/tax_codes/%s', $id), $params, $opts);
  36. }
  37. }