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, 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, #_get_union_variant_class, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #encode_with, #eql?, field_encodings, #hash, #init_with, #initialize, inner_class_union_variant_types, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #reattach_api_key, #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

#brand ⇒ Object (readonly)

The brand of the card.



267
268
269
# File 'lib/stripe/resources/issuing/card.rb', line 267

def brand
  @brand
end

#cancellation_reason ⇒ Object (readonly)

The reason why the card was canceled.



269
270
271
# File 'lib/stripe/resources/issuing/card.rb', line 269

def cancellation_reason
  @cancellation_reason
end

#cardholder ⇒ Object (readonly)

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

Related guide: How to create a cardholder



273
274
275
# File 'lib/stripe/resources/issuing/card.rb', line 273

def cardholder
  @cardholder
end

#created ⇒ Object (readonly)

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



275
276
277
# File 'lib/stripe/resources/issuing/card.rb', line 275

def created
  @created
end

#currency ⇒ Object (readonly)

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



277
278
279
# File 'lib/stripe/resources/issuing/card.rb', line 277

def currency
  @currency
end

#cvc ⇒ Object (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.



279
280
281
# File 'lib/stripe/resources/issuing/card.rb', line 279

def cvc
  @cvc
end

#exp_month ⇒ Object (readonly)

The expiration month of the card.



281
282
283
# File 'lib/stripe/resources/issuing/card.rb', line 281

def exp_month
  @exp_month
end

#exp_year ⇒ Object (readonly)

The expiration year of the card.



283
284
285
# File 'lib/stripe/resources/issuing/card.rb', line 283

def exp_year
  @exp_year
end

#financial_account ⇒ Object (readonly)

The financial account this card is attached to.



285
286
287
# File 'lib/stripe/resources/issuing/card.rb', line 285

def 
  @financial_account
end

#id ⇒ Object (readonly)

Unique identifier for the object.



287
288
289
# File 'lib/stripe/resources/issuing/card.rb', line 287

def id
  @id
end

#last4 ⇒ Object (readonly)

The last 4 digits of the card number.



289
290
291
# File 'lib/stripe/resources/issuing/card.rb', line 289

def last4
  @last4
end

#latest_fraud_warning ⇒ Object (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 reduce the risk of fraudulent activity. Stripe may remove a fraud warning if the cardholder confirms that the activity on the card is legitimate.



291
292
293
# File 'lib/stripe/resources/issuing/card.rb', line 291

def latest_fraud_warning
  @latest_fraud_warning
end

#lifecycle_controls ⇒ Object (readonly)

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



293
294
295
# File 'lib/stripe/resources/issuing/card.rb', line 293

def lifecycle_controls
  @lifecycle_controls
end

#livemode ⇒ Object (readonly)

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



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

def livemode
  @livemode
end

#metadata ⇒ Object (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.



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

def 
  @metadata
end

#number ⇒ Object (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.



299
300
301
# File 'lib/stripe/resources/issuing/card.rb', line 299

def number
  @number
end

#object ⇒ Object (readonly)

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



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

def object
  @object
end

#personalization_design ⇒ Object (readonly)

The personalization design object belonging to this card.



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

def personalization_design
  @personalization_design
end

#replaced_by ⇒ Object (readonly)

The latest card that replaces this card, if any.



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

def replaced_by
  @replaced_by
end

#replacement_for ⇒ Object (readonly)

The card this card replaces, if any.



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

def replacement_for
  @replacement_for
end

#replacement_reason ⇒ Object (readonly)

The reason why the previous card needed to be replaced.



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

def replacement_reason
  @replacement_reason
end

#second_line ⇒ Object (readonly)

Text separate from cardholder name, printed on the card.



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

def second_line
  @second_line
end

#shipping ⇒ Object (readonly)

Where and how the card will be shipped.



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

def shipping
  @shipping
end

#spending_controls ⇒ Object (readonly)

Attribute for field spending_controls



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

def spending_controls
  @spending_controls
end

#status ⇒ Object (readonly)

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



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

def status
  @status
end

#type ⇒ Object (readonly)

The type of the card.



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

def type
  @type
end

#wallets ⇒ Object (readonly)

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



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

def wallets
  @wallets
end

Class Method Details

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

Creates an Issuing Card object.



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

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

.field_remappings ⇒ Object



464
465
466
# File 'lib/stripe/resources/issuing/card.rb', line 464

def self.field_remappings
  @field_remappings = {}
end

.inner_class_types ⇒ Object



454
455
456
457
458
459
460
461
462
# File 'lib/stripe/resources/issuing/card.rb', line 454

def self.inner_class_types
  @inner_class_types = {
    latest_fraud_warning: LatestFraudWarning,
    lifecycle_controls: LifecycleControls,
    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.



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

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

.object_name ⇒ Object



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.



334
335
336
337
338
339
340
341
# File 'lib/stripe/resources/issuing/card.rb', line 334

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_helpers ⇒ Object



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

def test_helpers
  TestHelpers.new(self)
end