ConnectionTokenService.php 801 B

12345678910111213141516171819202122232425
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Terminal;
  4. class ConnectionTokenService extends \Stripe\Service\AbstractService
  5. {
  6. /**
  7. * To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived
  8. * connection token from Stripe, proxied through your server. On your backend, add
  9. * an endpoint that creates and returns a connection token.
  10. *
  11. * @param null|array $params
  12. * @param null|array|\Stripe\Util\RequestOptions $opts
  13. *
  14. * @throws \Stripe\Exception\ApiErrorException if the request fails
  15. *
  16. * @return \Stripe\Terminal\ConnectionToken
  17. */
  18. public function create($params = null, $opts = null)
  19. {
  20. return $this->request('post', '/v1/terminal/connection_tokens', $params, $opts);
  21. }
  22. }