ReaderService.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Terminal;
  4. /**
  5. * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  6. * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  7. */
  8. class ReaderService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Returns a list of <code>Reader</code> objects.
  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\Terminal\Reader>
  19. */
  20. public function all($params = null, $opts = null)
  21. {
  22. return $this->requestCollection('get', '/v1/terminal/readers', $params, $opts);
  23. }
  24. /**
  25. * Cancels the current reader action.
  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\Terminal\Reader
  34. */
  35. public function cancelAction($id, $params = null, $opts = null)
  36. {
  37. return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/cancel_action', $id), $params, $opts);
  38. }
  39. /**
  40. * Creates a new <code>Reader</code> object.
  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\Terminal\Reader
  48. */
  49. public function create($params = null, $opts = null)
  50. {
  51. return $this->request('post', '/v1/terminal/readers', $params, $opts);
  52. }
  53. /**
  54. * Deletes a <code>Reader</code> object.
  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\Terminal\Reader
  63. */
  64. public function delete($id, $params = null, $opts = null)
  65. {
  66. return $this->request('delete', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts);
  67. }
  68. /**
  69. * Initiates a payment flow on a Reader.
  70. *
  71. * @param string $id
  72. * @param null|array $params
  73. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  74. *
  75. * @throws \Stripe\Exception\ApiErrorException if the request fails
  76. *
  77. * @return \Stripe\Terminal\Reader
  78. */
  79. public function processPaymentIntent($id, $params = null, $opts = null)
  80. {
  81. return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/process_payment_intent', $id), $params, $opts);
  82. }
  83. /**
  84. * Initiates a setup intent flow on a Reader.
  85. *
  86. * @param string $id
  87. * @param null|array $params
  88. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  89. *
  90. * @throws \Stripe\Exception\ApiErrorException if the request fails
  91. *
  92. * @return \Stripe\Terminal\Reader
  93. */
  94. public function processSetupIntent($id, $params = null, $opts = null)
  95. {
  96. return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/process_setup_intent', $id), $params, $opts);
  97. }
  98. /**
  99. * Initiates a refund on a Reader.
  100. *
  101. * @param string $id
  102. * @param null|array $params
  103. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  104. *
  105. * @throws \Stripe\Exception\ApiErrorException if the request fails
  106. *
  107. * @return \Stripe\Terminal\Reader
  108. */
  109. public function refundPayment($id, $params = null, $opts = null)
  110. {
  111. return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/refund_payment', $id), $params, $opts);
  112. }
  113. /**
  114. * Retrieves a <code>Reader</code> object.
  115. *
  116. * @param string $id
  117. * @param null|array $params
  118. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  119. *
  120. * @throws \Stripe\Exception\ApiErrorException if the request fails
  121. *
  122. * @return \Stripe\Terminal\Reader
  123. */
  124. public function retrieve($id, $params = null, $opts = null)
  125. {
  126. return $this->request('get', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts);
  127. }
  128. /**
  129. * Sets reader display to show cart details.
  130. *
  131. * @param string $id
  132. * @param null|array $params
  133. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  134. *
  135. * @throws \Stripe\Exception\ApiErrorException if the request fails
  136. *
  137. * @return \Stripe\Terminal\Reader
  138. */
  139. public function setReaderDisplay($id, $params = null, $opts = null)
  140. {
  141. return $this->request('post', $this->buildPath('/v1/terminal/readers/%s/set_reader_display', $id), $params, $opts);
  142. }
  143. /**
  144. * Updates a <code>Reader</code> object by setting the values of the parameters
  145. * passed. Any parameters not provided will be left unchanged.
  146. *
  147. * @param string $id
  148. * @param null|array $params
  149. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  150. *
  151. * @throws \Stripe\Exception\ApiErrorException if the request fails
  152. *
  153. * @return \Stripe\Terminal\Reader
  154. */
  155. public function update($id, $params = null, $opts = null)
  156. {
  157. return $this->request('post', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts);
  158. }
  159. }