OutboundTransferService.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 OutboundTransferService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Returns a list of OutboundTransfers 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\OutboundTransfer>
  19. */
  20. public function all($params = null, $opts = null)
  21. {
  22. return $this->requestCollection('get', '/v1/treasury/outbound_transfers', $params, $opts);
  23. }
  24. /**
  25. * An OutboundTransfer can be canceled if the funds have not yet been paid out.
  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\OutboundTransfer
  34. */
  35. public function cancel($id, $params = null, $opts = null)
  36. {
  37. return $this->request('post', $this->buildPath('/v1/treasury/outbound_transfers/%s/cancel', $id), $params, $opts);
  38. }
  39. /**
  40. * Creates an OutboundTransfer.
  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\OutboundTransfer
  48. */
  49. public function create($params = null, $opts = null)
  50. {
  51. return $this->request('post', '/v1/treasury/outbound_transfers', $params, $opts);
  52. }
  53. /**
  54. * Retrieves the details of an existing OutboundTransfer by passing the unique
  55. * OutboundTransfer ID from either the OutboundTransfer creation request or
  56. * OutboundTransfer list.
  57. *
  58. * @param string $id
  59. * @param null|array $params
  60. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  61. *
  62. * @throws \Stripe\Exception\ApiErrorException if the request fails
  63. *
  64. * @return \Stripe\Treasury\OutboundTransfer
  65. */
  66. public function retrieve($id, $params = null, $opts = null)
  67. {
  68. return $this->request('get', $this->buildPath('/v1/treasury/outbound_transfers/%s', $id), $params, $opts);
  69. }
  70. }