CountrySpec.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe;
  4. /**
  5. * Stripe needs to collect certain pieces of information about each account
  6. * created. These requirements can differ depending on the account's country. The
  7. * Country Specs API makes these rules available to your integration.
  8. *
  9. * You can also view the information from this API call as <a href="/docs/connect/required-verification-information">an online
  10. * guide</a>.
  11. *
  12. * @property string $id Unique identifier for the object. Represented as the ISO country code for this country.
  13. * @property string $object String representing the object's type. Objects of the same type share the same value.
  14. * @property string $default_currency The default currency for this country. This applies to both payment methods and bank accounts.
  15. * @property \Stripe\StripeObject $supported_bank_account_currencies Currencies that can be accepted in the specific country (for transfers).
  16. * @property string[] $supported_payment_currencies Currencies that can be accepted in the specified country (for payments).
  17. * @property string[] $supported_payment_methods Payment methods available in the specified country. You may need to enable some payment methods (e.g., <a href="https://stripe.com/docs/ach">ACH</a>) on your account before they appear in this list. The <code>stripe</code> payment method refers to <a href="https://stripe.com/docs/connect/destination-charges">charging through your platform</a>.
  18. * @property string[] $supported_transfer_countries Countries that can accept transfers from the specified country.
  19. * @property \Stripe\StripeObject $verification_fields
  20. */
  21. class CountrySpec extends ApiResource
  22. {
  23. const OBJECT_NAME = 'country_spec';
  24. /**
  25. * Lists all Country Spec objects available in the API.
  26. *
  27. * @param null|array $params
  28. * @param null|array|string $opts
  29. *
  30. * @throws \Stripe\Exception\ApiErrorException if the request fails
  31. *
  32. * @return \Stripe\Collection<\Stripe\CountrySpec> of ApiResources
  33. */
  34. public static function all($params = null, $opts = null)
  35. {
  36. $url = static::classUrl();
  37. return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
  38. }
  39. /**
  40. * Returns a Country Spec for a given Country code.
  41. *
  42. * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
  43. * @param null|array|string $opts
  44. *
  45. * @throws \Stripe\Exception\ApiErrorException if the request fails
  46. *
  47. * @return \Stripe\CountrySpec
  48. */
  49. public static function retrieve($id, $opts = null)
  50. {
  51. $opts = \Stripe\Util\RequestOptions::parse($opts);
  52. $instance = new static($id, $opts);
  53. $instance->refresh();
  54. return $instance;
  55. }
  56. }