InboundTransferService.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\TestHelpers\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. * Transitions a test mode created InboundTransfer to the <code>failed</code>
  12. * status. The InboundTransfer must already be in the <code>processing</code>
  13. * state.
  14. *
  15. * @param string $id
  16. * @param null|array $params
  17. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  18. *
  19. * @throws \Stripe\Exception\ApiErrorException if the request fails
  20. *
  21. * @return \Stripe\Treasury\InboundTransfer
  22. */
  23. public function fail($id, $params = null, $opts = null)
  24. {
  25. return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/inbound_transfers/%s/fail', $id), $params, $opts);
  26. }
  27. /**
  28. * Marks the test mode InboundTransfer object as returned and links the
  29. * InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the
  30. * <code>succeeded</code> state.
  31. *
  32. * @param string $id
  33. * @param null|array $params
  34. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  35. *
  36. * @throws \Stripe\Exception\ApiErrorException if the request fails
  37. *
  38. * @return \Stripe\Treasury\InboundTransfer
  39. */
  40. public function returnInboundTransfer($id, $params = null, $opts = null)
  41. {
  42. return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/inbound_transfers/%s/return', $id), $params, $opts);
  43. }
  44. /**
  45. * Transitions a test mode created InboundTransfer to the <code>succeeded</code>
  46. * status. The InboundTransfer must already be in the <code>processing</code>
  47. * state.
  48. *
  49. * @param string $id
  50. * @param null|array $params
  51. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  52. *
  53. * @throws \Stripe\Exception\ApiErrorException if the request fails
  54. *
  55. * @return \Stripe\Treasury\InboundTransfer
  56. */
  57. public function succeed($id, $params = null, $opts = null)
  58. {
  59. return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/inbound_transfers/%s/succeed', $id), $params, $opts);
  60. }
  61. }