Class: Stripe::SharedPayment::IssuedToken

Inherits:
APIResource show all
Extended by:
APIOperations::Create
Defined in:
lib/stripe/resources/shared_payment/issued_token.rb

Overview

A SharedPaymentIssuedToken is a limited-use reference to a PaymentMethod that can be created with a secret key. When shared with another Stripe account (Seller), it enables that account to either process a payment on Stripe against a PaymentMethod that your Stripe account owns, or to forward a usable credential created against the originalPaymentMethod to then process the payment off-Stripe.

Defined Under Namespace

Classes: NextAction, RiskDetails, SellerDetails, UsageDetails, UsageLimits

Constant Summary collapse

OBJECT_NAME =
"shared_payment.issued_token"

Constants inherited from Stripe::StripeObject

Stripe::StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from Stripe::StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::Create

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

included

Methods inherited from Stripe::StripeObject

#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, field_encodings, #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

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



214
215
216
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 214

def created
  @created
end

#deactivated_atObject (readonly)

Time at which this SharedPaymentIssuedToken was deactivated.



216
217
218
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 216

def deactivated_at
  @deactivated_at
end

#deactivated_reasonObject (readonly)

The reason why the SharedPaymentIssuedToken has been deactivated.



218
219
220
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 218

def deactivated_reason
  @deactivated_reason
end

#idObject (readonly)

Unique identifier for the object.



220
221
222
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 220

def id
  @id
end

#livemodeObject (readonly)

If the object exists in live mode, the value is ‘true`. If the object exists in test mode, the value is `false`.



222
223
224
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 222

def livemode
  @livemode
end

#next_actionObject (readonly)

If present, describes the action required to make this ‘SharedPaymentIssuedToken` usable for payments. Present when the token is in `requires_action` state.



224
225
226
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 224

def next_action
  @next_action
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



226
227
228
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 226

def object
  @object
end

#payment_methodObject (readonly)

ID of an existing PaymentMethod.



228
229
230
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 228

def payment_method
  @payment_method
end

#return_urlObject (readonly)

If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.



230
231
232
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 230

def return_url
  @return_url
end

#risk_detailsObject (readonly)

Risk details of the SharedPaymentIssuedToken.



232
233
234
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 232

def risk_details
  @risk_details
end

#seller_detailsObject (readonly)

Seller details of the SharedPaymentIssuedToken, including network_id and external_id.



234
235
236
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 234

def seller_details
  @seller_details
end

#setup_future_usageObject (readonly)

Indicates that you intend to save the PaymentMethod of this SharedPaymentToken to a customer later.



236
237
238
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 236

def setup_future_usage
  @setup_future_usage
end

#shared_metadataObject (readonly)

Metadata about the SharedPaymentIssuedToken.



238
239
240
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 238

def 
  @shared_metadata
end

#statusObject (readonly)

Status of this SharedPaymentIssuedToken, one of ‘active`, `requires_action`, or `deactivated`.



240
241
242
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 240

def status
  @status
end

#usage_detailsObject (readonly)

Usage details of the SharedPaymentIssuedToken



242
243
244
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 242

def usage_details
  @usage_details
end

#usage_limitsObject (readonly)

Usage limits of the SharedPaymentIssuedToken.



244
245
246
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 244

def usage_limits
  @usage_limits
end

Class Method Details

.create(params = {}, opts = {}) ⇒ Object

Creates a new SharedPaymentIssuedToken object



247
248
249
250
251
252
253
254
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 247

def self.create(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/shared_payment/issued_tokens",
    params: params,
    opts: opts
  )
end

.field_remappingsObject



286
287
288
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 286

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



276
277
278
279
280
281
282
283
284
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 276

def self.inner_class_types
  @inner_class_types = {
    next_action: NextAction,
    risk_details: RiskDetails,
    seller_details: SellerDetails,
    usage_details: UsageDetails,
    usage_limits: UsageLimits,
  }
end

.object_nameObject



11
12
13
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 11

def self.object_name
  "shared_payment.issued_token"
end

.revoke(shared_payment_issued_token, params = {}, opts = {}) ⇒ Object

Revokes a SharedPaymentIssuedToken



267
268
269
270
271
272
273
274
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 267

def self.revoke(shared_payment_issued_token, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/shared_payment/issued_tokens/%<shared_payment_issued_token>s/revoke", { shared_payment_issued_token: CGI.escape(shared_payment_issued_token) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

#revoke(params = {}, opts = {}) ⇒ Object

Revokes a SharedPaymentIssuedToken



257
258
259
260
261
262
263
264
# File 'lib/stripe/resources/shared_payment/issued_token.rb', line 257

def revoke(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/shared_payment/issued_tokens/%<shared_payment_issued_token>s/revoke", { shared_payment_issued_token: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end