FinancialAccountService.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 FinancialAccountService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Returns a list of FinancialAccounts.
  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\FinancialAccount>
  19. */
  20. public function all($params = null, $opts = null)
  21. {
  22. return $this->requestCollection('get', '/v1/treasury/financial_accounts', $params, $opts);
  23. }
  24. /**
  25. * Creates a new FinancialAccount. For now, each connected account can only have
  26. * one FinancialAccount.
  27. *
  28. * @param null|array $params
  29. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  30. *
  31. * @throws \Stripe\Exception\ApiErrorException if the request fails
  32. *
  33. * @return \Stripe\Treasury\FinancialAccount
  34. */
  35. public function create($params = null, $opts = null)
  36. {
  37. return $this->request('post', '/v1/treasury/financial_accounts', $params, $opts);
  38. }
  39. /**
  40. * Retrieves the details of a FinancialAccount.
  41. *
  42. * @param string $id
  43. * @param null|array $params
  44. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  45. *
  46. * @throws \Stripe\Exception\ApiErrorException if the request fails
  47. *
  48. * @return \Stripe\Treasury\FinancialAccount
  49. */
  50. public function retrieve($id, $params = null, $opts = null)
  51. {
  52. return $this->request('get', $this->buildPath('/v1/treasury/financial_accounts/%s', $id), $params, $opts);
  53. }
  54. /**
  55. * Retrieves Features information associated with the FinancialAccount.
  56. *
  57. * @param string $id
  58. * @param null|array $params
  59. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  60. *
  61. * @throws \Stripe\Exception\ApiErrorException if the request fails
  62. *
  63. * @return \Stripe\Treasury\FinancialAccountFeatures
  64. */
  65. public function retrieveFeatures($id, $params = null, $opts = null)
  66. {
  67. return $this->request('get', $this->buildPath('/v1/treasury/financial_accounts/%s/features', $id), $params, $opts);
  68. }
  69. /**
  70. * Updates the details of a FinancialAccount.
  71. *
  72. * @param string $id
  73. * @param null|array $params
  74. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  75. *
  76. * @throws \Stripe\Exception\ApiErrorException if the request fails
  77. *
  78. * @return \Stripe\Treasury\FinancialAccount
  79. */
  80. public function update($id, $params = null, $opts = null)
  81. {
  82. return $this->request('post', $this->buildPath('/v1/treasury/financial_accounts/%s', $id), $params, $opts);
  83. }
  84. /**
  85. * Updates the Features associated with a FinancialAccount.
  86. *
  87. * @param string $id
  88. * @param null|array $params
  89. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  90. *
  91. * @throws \Stripe\Exception\ApiErrorException if the request fails
  92. *
  93. * @return \Stripe\Treasury\FinancialAccountFeatures
  94. */
  95. public function updateFeatures($id, $params = null, $opts = null)
  96. {
  97. return $this->request('post', $this->buildPath('/v1/treasury/financial_accounts/%s/features', $id), $params, $opts);
  98. }
  99. }