Class: Stripe::Terminal::ConnectionToken
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Terminal::ConnectionToken
- Extended by:
- APIOperations::Create
- Defined in:
- lib/stripe/resources/terminal/connection_token.rb
Overview
A Connection Token is used by the Stripe Terminal SDK to connect to a reader.
Related guide: [Fleet management](stripe.com/docs/terminal/fleet/locations)
Constant Summary collapse
- OBJECT_NAME =
"terminal.connection_token"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
The id of the location that this connection token is scoped to.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#secret ⇒ Object
readonly
Your application should pass this token to the Stripe Terminal SDK.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.create(params = {}, opts = {}) ⇒ Object
To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server.
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
- .object_name ⇒ Object
Methods included from APIOperations::Create
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#location ⇒ Object (readonly)
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 [the docs on scoping connection tokens](docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens).
18 19 20 |
# File 'lib/stripe/resources/terminal/connection_token.rb', line 18 def location @location end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
20 21 22 |
# File 'lib/stripe/resources/terminal/connection_token.rb', line 20 def object @object end |
#secret ⇒ Object (readonly)
Your application should pass this token to the Stripe Terminal SDK.
22 23 24 |
# File 'lib/stripe/resources/terminal/connection_token.rb', line 22 def secret @secret end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token.
25 26 27 28 29 30 31 32 |
# File 'lib/stripe/resources/terminal/connection_token.rb', line 25 def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/terminal/connection_tokens", params: params, opts: opts ) end |
.field_remappings ⇒ Object
38 39 40 |
# File 'lib/stripe/resources/terminal/connection_token.rb', line 38 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
34 35 36 |
# File 'lib/stripe/resources/terminal/connection_token.rb', line 34 def self.inner_class_types @inner_class_types = {} end |
.object_name ⇒ Object
13 14 15 |
# File 'lib/stripe/resources/terminal/connection_token.rb', line 13 def self.object_name "terminal.connection_token" end |