OutboundPaymentService.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 OutboundPaymentService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Transitions a test mode created OutboundPayment to the <code>failed</code>
  12. * status. The OutboundPayment 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\OutboundPayment
  22. */
  23. public function fail($id, $params = null, $opts = null)
  24. {
  25. return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/outbound_payments/%s/fail', $id), $params, $opts);
  26. }
  27. /**
  28. * Transitions a test mode created OutboundPayment to the <code>posted</code>
  29. * status. The OutboundPayment must already be in the <code>processing</code>
  30. * 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\OutboundPayment
  39. */
  40. public function post($id, $params = null, $opts = null)
  41. {
  42. return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/outbound_payments/%s/post', $id), $params, $opts);
  43. }
  44. /**
  45. * Transitions a test mode created OutboundPayment to the <code>returned</code>
  46. * status. The OutboundPayment 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\OutboundPayment
  56. */
  57. public function returnOutboundPayment($id, $params = null, $opts = null)
  58. {
  59. return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/outbound_payments/%s/return', $id), $params, $opts);
  60. }
  61. /**
  62. * Updates a test mode created OutboundPayment with tracking details. The
  63. * OutboundPayment must not be cancelable, and cannot be in the
  64. * <code>canceled</code> or <code>failed</code> states.
  65. *
  66. * @param string $id
  67. * @param null|array $params
  68. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  69. *
  70. * @throws \Stripe\Exception\ApiErrorException if the request fails
  71. *
  72. * @return \Stripe\Treasury\OutboundPayment
  73. */
  74. public function update($id, $params = null, $opts = null)
  75. {
  76. return $this->request('post', $this->buildPath('/v1/test_helpers/treasury/outbound_payments/%s', $id), $params, $opts);
  77. }
  78. }