InboundTransferService.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 InboundTransferService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Returns a list of InboundTransfers sent from the specified FinancialAccount.
  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\InboundTransfer>
  19. */
  20. public function all($params = null, $opts = null)
  21. {
  22. return $this->requestCollection('get', '/v1/treasury/inbound_transfers', $params, $opts);
  23. }
  24. /**
  25. * Cancels an InboundTransfer.
  26. *
  27. * @param string $id
  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\InboundTransfer
  34. */
  35. public function cancel($id, $params = null, $opts = null)
  36. {
  37. return $this->request('post', $this->buildPath('/v1/treasury/inbound_transfers/%s/cancel', $id), $params, $opts);
  38. }
  39. /**
  40. * Creates an InboundTransfer.
  41. *
  42. * @param null|array $params
  43. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  44. *
  45. * @throws \Stripe\Exception\ApiErrorException if the request fails
  46. *
  47. * @return \Stripe\Treasury\InboundTransfer
  48. */
  49. public function create($params = null, $opts = null)
  50. {
  51. return $this->request('post', '/v1/treasury/inbound_transfers', $params, $opts);
  52. }
  53. /**
  54. * Retrieves the details of an existing InboundTransfer.
  55. *
  56. * @param string $id
  57. * @param null|array $params
  58. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  59. *
  60. * @throws \Stripe\Exception\ApiErrorException if the request fails
  61. *
  62. * @return \Stripe\Treasury\InboundTransfer
  63. */
  64. public function retrieve($id, $params = null, $opts = null)
  65. {
  66. return $this->request('get', $this->buildPath('/v1/treasury/inbound_transfers/%s', $id), $params, $opts);
  67. }
  68. }