ConnectionTokenService.php 975 B

1234567891011121314151617181920212223242526272829
  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 ConnectionTokenService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived
  12. * connection token from Stripe, proxied through your server. On your backend, add
  13. * an endpoint that creates and returns a connection token.
  14. *
  15. * @param null|array $params
  16. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  17. *
  18. * @throws \Stripe\Exception\ApiErrorException if the request fails
  19. *
  20. * @return \Stripe\Terminal\ConnectionToken
  21. */
  22. public function create($params = null, $opts = null)
  23. {
  24. return $this->request('post', '/v1/terminal/connection_tokens', $params, $opts);
  25. }
  26. }