Class: Stripe::Issuing::Card

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List
Includes:
APIOperations::Save
Defined in:
lib/stripe/resources/issuing/card.rb

Overview

You can create physical or virtual cards that are issued to cardholders.

Defined Under Namespace

Classes: LatestFraudWarning, LifecycleControls, ProductGraduationState, Redaction, Shipping, SpendingControls, TestHelpers, Wallets

Constant Summary collapse

OBJECT_NAME =
"issuing.card"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

list

Methods included from APIOperations::Save

included, #save

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 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

#brandObject (readonly)

The brand of the card.



295
296
297
# File 'lib/stripe/resources/issuing/card.rb', line 295

def brand
  @brand
end

#cancellation_reasonObject (readonly)

The reason why the card was canceled.



297
298
299
# File 'lib/stripe/resources/issuing/card.rb', line 297

def cancellation_reason
  @cancellation_reason
end

#cardholderObject (readonly)

An Issuing Cardholder object represents an individual or business entity who is issued cards.

Related guide: How to create a cardholder



301
302
303
# File 'lib/stripe/resources/issuing/card.rb', line 301

def cardholder
  @cardholder
end

#createdObject (readonly)

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



303
304
305
# File 'lib/stripe/resources/issuing/card.rb', line 303

def created
  @created
end

#currencyObject (readonly)

Three-letter ISO currency code, in lowercase. Supported currencies are usd in the US, eur in the EU, and gbp in the UK.



305
306
307
# File 'lib/stripe/resources/issuing/card.rb', line 305

def currency
  @currency
end

#cvcObject (readonly)

The card's CVC. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint.



307
308
309
# File 'lib/stripe/resources/issuing/card.rb', line 307

def cvc
  @cvc
end

#exp_monthObject (readonly)

The expiration month of the card.



309
310
311
# File 'lib/stripe/resources/issuing/card.rb', line 309

def exp_month
  @exp_month
end

#exp_yearObject (readonly)

The expiration year of the card.



311
312
313
# File 'lib/stripe/resources/issuing/card.rb', line 311

def exp_year
  @exp_year
end

#financial_accountObject (readonly)

The financial account this card is attached to.



313
314
315
# File 'lib/stripe/resources/issuing/card.rb', line 313

def 
  @financial_account
end

#idObject (readonly)

Unique identifier for the object.



315
316
317
# File 'lib/stripe/resources/issuing/card.rb', line 315

def id
  @id
end

#last4Object (readonly)

The last 4 digits of the card number.



317
318
319
# File 'lib/stripe/resources/issuing/card.rb', line 317

def last4
  @last4
end

#latest_fraud_warningObject (readonly)

Stripe’s assessment of whether this card’s details have been compromised. If this property isn't null, cancel and reissue the card to prevent fraudulent activity risk.



319
320
321
# File 'lib/stripe/resources/issuing/card.rb', line 319

def latest_fraud_warning
  @latest_fraud_warning
end

#lifecycle_controlsObject (readonly)

Rules that control the lifecycle of this card, such as automatic cancellation. Refer to our documentation for more details.



321
322
323
# File 'lib/stripe/resources/issuing/card.rb', line 321

def lifecycle_controls
  @lifecycle_controls
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.



323
324
325
# File 'lib/stripe/resources/issuing/card.rb', line 323

def livemode
  @livemode
end

#metadataObject (readonly)

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.



325
326
327
# File 'lib/stripe/resources/issuing/card.rb', line 325

def 
  @metadata
end

#numberObject (readonly)

The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint.



327
328
329
# File 'lib/stripe/resources/issuing/card.rb', line 327

def number
  @number
end

#objectObject (readonly)

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



329
330
331
# File 'lib/stripe/resources/issuing/card.rb', line 329

def object
  @object
end

#personalization_designObject (readonly)

The personalization design object belonging to this card.



331
332
333
# File 'lib/stripe/resources/issuing/card.rb', line 331

def personalization_design
  @personalization_design
end

#product_codeObject (readonly)

The product code the card is currently enrolled under. product_graduation_state reflects any in-flight product graduation and whether the card network has confirmed it.



333
334
335
# File 'lib/stripe/resources/issuing/card.rb', line 333

def product_code
  @product_code
end

#product_graduation_stateObject (readonly)

State of the product graduation request on this card. Only present when a product graduation has been requested.



335
336
337
# File 'lib/stripe/resources/issuing/card.rb', line 335

def product_graduation_state
  @product_graduation_state
end

#programObject (readonly)

The program that this card belongs to — will not be nil.



337
338
339
# File 'lib/stripe/resources/issuing/card.rb', line 337

def program
  @program
end

#redactionObject (readonly)

Redaction status of this card. If not null, this card is associated to a redaction job.



339
340
341
# File 'lib/stripe/resources/issuing/card.rb', line 339

def redaction
  @redaction
end

#replaced_byObject (readonly)

The latest card that replaces this card, if any.



341
342
343
# File 'lib/stripe/resources/issuing/card.rb', line 341

def replaced_by
  @replaced_by
end

#replacement_forObject (readonly)

The card this card replaces, if any.



343
344
345
# File 'lib/stripe/resources/issuing/card.rb', line 343

def replacement_for
  @replacement_for
end

#replacement_reasonObject (readonly)

The reason why the previous card needed to be replaced.



345
346
347
# File 'lib/stripe/resources/issuing/card.rb', line 345

def replacement_reason
  @replacement_reason
end

#second_lineObject (readonly)

Text separate from cardholder name, printed on the card.



347
348
349
# File 'lib/stripe/resources/issuing/card.rb', line 347

def second_line
  @second_line
end

#shippingObject (readonly)

Where and how the card will be shipped.



349
350
351
# File 'lib/stripe/resources/issuing/card.rb', line 349

def shipping
  @shipping
end

#spending_controlsObject (readonly)

Attribute for field spending_controls



351
352
353
# File 'lib/stripe/resources/issuing/card.rb', line 351

def spending_controls
  @spending_controls
end

#statusObject (readonly)

Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to inactive.



353
354
355
# File 'lib/stripe/resources/issuing/card.rb', line 353

def status
  @status
end

#typeObject (readonly)

The type of the card.



355
356
357
# File 'lib/stripe/resources/issuing/card.rb', line 355

def type
  @type
end

#walletsObject (readonly)

Information relating to digital wallets (like Apple Pay and Google Pay).



357
358
359
# File 'lib/stripe/resources/issuing/card.rb', line 357

def wallets
  @wallets
end

Class Method Details

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

Creates an Issuing Card object.



360
361
362
# File 'lib/stripe/resources/issuing/card.rb', line 360

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

.field_remappingsObject



502
503
504
# File 'lib/stripe/resources/issuing/card.rb', line 502

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



490
491
492
493
494
495
496
497
498
499
500
# File 'lib/stripe/resources/issuing/card.rb', line 490

def self.inner_class_types
  @inner_class_types = {
    latest_fraud_warning: LatestFraudWarning,
    lifecycle_controls: LifecycleControls,
    product_graduation_state: ProductGraduationState,
    redaction: Redaction,
    shipping: Shipping,
    spending_controls: SpendingControls,
    wallets: Wallets,
  }
end

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

Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.



365
366
367
# File 'lib/stripe/resources/issuing/card.rb', line 365

def self.list(params = {}, opts = {})
  request_stripe_object(method: :get, path: "/v1/issuing/cards", params: params, opts: opts)
end

.object_nameObject



13
14
15
# File 'lib/stripe/resources/issuing/card.rb', line 13

def self.object_name
  "issuing.card"
end

.update(card, params = {}, opts = {}) ⇒ Object

Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.



370
371
372
373
374
375
376
377
# File 'lib/stripe/resources/issuing/card.rb', line 370

def self.update(card, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/issuing/cards/%<card>s", { card: CGI.escape(card) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

#test_helpersObject



379
380
381
# File 'lib/stripe/resources/issuing/card.rb', line 379

def test_helpers
  TestHelpers.new(self)
end