Configuration.php
2 months ago
ConnectionToken.php
2 months ago
Location.php
2 months ago
Reader.php
2 months ago
ConnectionToken.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | // File generated from our OpenAPI spec |
| 4 | namespace ProfilePressVendor\Stripe\Terminal; |
| 5 | |
| 6 | /** |
| 7 | * A Connection Token is used by the Stripe Terminal SDK to connect to a reader. |
| 8 | * |
| 9 | * Related guide: <a href="https://stripe.com/docs/terminal/fleet/locations">Fleet management</a> |
| 10 | * |
| 11 | * @property string $object String representing the object's type. Objects of the same type share the same value. |
| 12 | * @property null|string $location The id of the location that this connection token is scoped to. Note that location scoping only applies to internet-connected readers. For more details, see <a href="https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens">the docs on scoping connection tokens</a>. |
| 13 | * @property string $secret Your application should pass this token to the Stripe Terminal SDK. |
| 14 | */ |
| 15 | class ConnectionToken extends \ProfilePressVendor\Stripe\ApiResource |
| 16 | { |
| 17 | const OBJECT_NAME = 'terminal.connection_token'; |
| 18 | /** |
| 19 | * To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived |
| 20 | * connection token from Stripe, proxied through your server. On your backend, add |
| 21 | * an endpoint that creates and returns a connection token. |
| 22 | * |
| 23 | * @param null|array $params |
| 24 | * @param null|array|string $options |
| 25 | * |
| 26 | * @throws \Stripe\Exception\ApiErrorException if the request fails |
| 27 | * |
| 28 | * @return \Stripe\Terminal\ConnectionToken the created resource |
| 29 | */ |
| 30 | public static function create($params = null, $options = null) |
| 31 | { |
| 32 | self::_validateParams($params); |
| 33 | $url = static::classUrl(); |
| 34 | list($response, $opts) = static::_staticRequest('post', $url, $params, $options); |
| 35 | $obj = \ProfilePressVendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts); |
| 36 | $obj->setLastResponse($response); |
| 37 | return $obj; |
| 38 | } |
| 39 | } |
| 40 |