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](stripe.com/docs/issuing) that are issued to cardholders.

Defined Under Namespace

Classes: CreateParams, DeliverCardParams, FailCardParams, ListParams, ReturnCardParams, ShipCardParams, Shipping, SpendingControls, SubmitCardParams, TestHelpers, UpdateParams, 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?, #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.



708
709
710
# File 'lib/stripe/resources/issuing/card.rb', line 708

def brand
  @brand
end

#cancellation_reasonObject (readonly)

The reason why the card was canceled.



710
711
712
# File 'lib/stripe/resources/issuing/card.rb', line 710

def cancellation_reason
  @cancellation_reason
end

#cardholderObject (readonly)

An Issuing ‘Cardholder` object represents an individual or business entity who is [issued](stripe.com/docs/issuing) cards.

Related guide: [How to create a cardholder](stripe.com/docs/issuing/cards/virtual/issue-cards#create-cardholder)



714
715
716
# File 'lib/stripe/resources/issuing/card.rb', line 714

def cardholder
  @cardholder
end

#createdObject (readonly)

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



716
717
718
# File 'lib/stripe/resources/issuing/card.rb', line 716

def created
  @created
end

#currencyObject (readonly)

Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Supported currencies are ‘usd` in the US, `eur` in the EU, and `gbp` in the UK.



718
719
720
# File 'lib/stripe/resources/issuing/card.rb', line 718

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](stripe.com/docs/api/expanding_objects). Additionally, it’s only available via the [“Retrieve a card” endpoint](stripe.com/docs/api/issuing/cards/retrieve), not via “List all cards” or any other endpoint.



720
721
722
# File 'lib/stripe/resources/issuing/card.rb', line 720

def cvc
  @cvc
end

#exp_monthObject (readonly)

The expiration month of the card.



722
723
724
# File 'lib/stripe/resources/issuing/card.rb', line 722

def exp_month
  @exp_month
end

#exp_yearObject (readonly)

The expiration year of the card.



724
725
726
# File 'lib/stripe/resources/issuing/card.rb', line 724

def exp_year
  @exp_year
end

#financial_accountObject (readonly)

The financial account this card is attached to.



726
727
728
# File 'lib/stripe/resources/issuing/card.rb', line 726

def 
  @financial_account
end

#idObject (readonly)

Unique identifier for the object.



728
729
730
# File 'lib/stripe/resources/issuing/card.rb', line 728

def id
  @id
end

#last4Object (readonly)

The last 4 digits of the card number.



730
731
732
# File 'lib/stripe/resources/issuing/card.rb', line 730

def last4
  @last4
end

#livemodeObject (readonly)

Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.



732
733
734
# File 'lib/stripe/resources/issuing/card.rb', line 732

def livemode
  @livemode
end

#metadataObject (readonly)

Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.



734
735
736
# File 'lib/stripe/resources/issuing/card.rb', line 734

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](stripe.com/docs/api/expanding_objects). Additionally, it’s only available via the [“Retrieve a card” endpoint](stripe.com/docs/api/issuing/cards/retrieve), not via “List all cards” or any other endpoint.



736
737
738
# File 'lib/stripe/resources/issuing/card.rb', line 736

def number
  @number
end

#objectObject (readonly)

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



738
739
740
# File 'lib/stripe/resources/issuing/card.rb', line 738

def object
  @object
end

#personalization_designObject (readonly)

The personalization design object belonging to this card.



740
741
742
# File 'lib/stripe/resources/issuing/card.rb', line 740

def personalization_design
  @personalization_design
end

#replaced_byObject (readonly)

The latest card that replaces this card, if any.



742
743
744
# File 'lib/stripe/resources/issuing/card.rb', line 742

def replaced_by
  @replaced_by
end

#replacement_forObject (readonly)

The card this card replaces, if any.



744
745
746
# File 'lib/stripe/resources/issuing/card.rb', line 744

def replacement_for
  @replacement_for
end

#replacement_reasonObject (readonly)

The reason why the previous card needed to be replaced.



746
747
748
# File 'lib/stripe/resources/issuing/card.rb', line 746

def replacement_reason
  @replacement_reason
end

#shippingObject (readonly)

Where and how the card will be shipped.



748
749
750
# File 'lib/stripe/resources/issuing/card.rb', line 748

def shipping
  @shipping
end

#spending_controlsObject (readonly)

Attribute for field spending_controls



750
751
752
# File 'lib/stripe/resources/issuing/card.rb', line 750

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



752
753
754
# File 'lib/stripe/resources/issuing/card.rb', line 752

def status
  @status
end

#typeObject (readonly)

The type of the card.



754
755
756
# File 'lib/stripe/resources/issuing/card.rb', line 754

def type
  @type
end

#walletsObject (readonly)

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



756
757
758
# File 'lib/stripe/resources/issuing/card.rb', line 756

def wallets
  @wallets
end

Class Method Details

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

Creates an Issuing Card object.



759
760
761
# File 'lib/stripe/resources/issuing/card.rb', line 759

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

.field_remappingsObject



897
898
899
# File 'lib/stripe/resources/issuing/card.rb', line 897

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



889
890
891
892
893
894
895
# File 'lib/stripe/resources/issuing/card.rb', line 889

def self.inner_class_types
  @inner_class_types = {
    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.



764
765
766
# File 'lib/stripe/resources/issuing/card.rb', line 764

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.



769
770
771
772
773
774
775
776
# File 'lib/stripe/resources/issuing/card.rb', line 769

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



778
779
780
# File 'lib/stripe/resources/issuing/card.rb', line 778

def test_helpers
  TestHelpers.new(self)
end