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