Class Card

All Implemented Interfaces:
HasId, MetadataStore<Card>, StripeActiveObject, StripeObjectInterface

public class Card extends ApiResource implements HasId, MetadataStore<Card>
You can create physical or virtual cards that are issued to cardholders.
  • Constructor Details

    • Card

      public Card()
  • Method Details

    • getPersonalizationDesign

      public String getPersonalizationDesign()
      Get ID of expandable personalizationDesign object.
    • setPersonalizationDesign

      public void setPersonalizationDesign(String id)
    • getPersonalizationDesignObject

      public PersonalizationDesign getPersonalizationDesignObject()
      Get expanded personalizationDesign.
    • setPersonalizationDesignObject

      public void setPersonalizationDesignObject(PersonalizationDesign expandableObject)
    • getReplacedBy

      public String getReplacedBy()
      Get ID of expandable replacedBy object.
    • setReplacedBy

      public void setReplacedBy(String id)
    • getReplacedByObject

      public Card getReplacedByObject()
      Get expanded replacedBy.
    • setReplacedByObject

      public void setReplacedByObject(Card expandableObject)
    • getReplacementFor

      public String getReplacementFor()
      Get ID of expandable replacementFor object.
    • setReplacementFor

      public void setReplacementFor(String id)
    • getReplacementForObject

      public Card getReplacementForObject()
      Get expanded replacementFor.
    • setReplacementForObject

      public void setReplacementForObject(Card expandableObject)
    • create

      public static Card create(Map<String,Object> params) throws StripeException
      Creates an Issuing Card object.
      Throws:
      StripeException
    • create

      public static Card create(Map<String,Object> params, RequestOptions options) throws StripeException
      Creates an Issuing Card object.
      Throws:
      StripeException
    • create

      public static Card create(CardCreateParams params) throws StripeException
      Creates an Issuing Card object.
      Throws:
      StripeException
    • create

      public static Card create(CardCreateParams params, RequestOptions options) throws StripeException
      Creates an Issuing Card object.
      Throws:
      StripeException
    • list

      public static CardCollection list(Map<String,Object> params) throws StripeException
      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.
      Throws:
      StripeException
    • list

      public static CardCollection list(Map<String,Object> params, RequestOptions options) throws StripeException
      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.
      Throws:
      StripeException
    • list

      public static CardCollection list(CardListParams params) throws StripeException
      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.
      Throws:
      StripeException
    • list

      public static CardCollection list(CardListParams params, RequestOptions options) throws StripeException
      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.
      Throws:
      StripeException
    • retrieve

      public static Card retrieve(String card) throws StripeException
      Retrieves an Issuing Card object.
      Throws:
      StripeException
    • retrieve

      public static Card retrieve(String card, RequestOptions options) throws StripeException
      Retrieves an Issuing Card object.
      Throws:
      StripeException
    • retrieve

      public static Card retrieve(String card, Map<String,Object> params, RequestOptions options) throws StripeException
      Retrieves an Issuing Card object.
      Throws:
      StripeException
    • retrieve

      public static Card retrieve(String card, CardRetrieveParams params, RequestOptions options) throws StripeException
      Retrieves an Issuing Card object.
      Throws:
      StripeException
    • update

      public Card update(Map<String,Object> params) throws StripeException
      Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
      Specified by:
      update in interface MetadataStore<Card>
      Throws:
      StripeException
    • update

      public Card update(Map<String,Object> params, RequestOptions options) throws StripeException
      Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
      Specified by:
      update in interface MetadataStore<Card>
      Throws:
      StripeException
    • update

      public Card update(CardUpdateParams params) throws StripeException
      Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
      Throws:
      StripeException
    • update

      public Card update(CardUpdateParams params, RequestOptions options) throws StripeException
      Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
      Throws:
      StripeException
    • getTestHelpers

      public Card.TestHelpers getTestHelpers()
      Reason the card is ineligible for Google Pay

      One of missing_agreement, missing_cardholder_contact, or unsupported_region.

    • setResponseGetter

      public void setResponseGetter(StripeResponseGetter responseGetter)
      Description copied from interface: StripeActiveObject
      Method is used by the containing object or StripeResponseGetter implementations to set the StripeResponseGetter instance used to make further requests.
      Specified by:
      setResponseGetter in interface StripeActiveObject
      Overrides:
      setResponseGetter in class ApiResource
      Parameters:
      responseGetter - the StripeResponseGetter instance to use for making further requests.
    • getBrand

      public String getBrand()
      The brand of the card.
    • getCancellationReason

      public String getCancellationReason()
      The reason why the card was canceled.

      One of design_rejected, lost, or stolen.

    • getCardholder

      public Cardholder getCardholder()
      An Issuing Cardholder object represents an individual or business entity who is issued cards.

      Related guide: How to create a cardholder

    • getCreated

      public Long getCreated()
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • getCurrency

      public String getCurrency()
      Three-letter ISO currency code, in lowercase. Supported currencies are usd in the US, eur in the EU, and gbp in the UK.
    • getCvc

      public String getCvc()
      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.
    • getExpMonth

      public Long getExpMonth()
      The expiration month of the card.
    • getExpYear

      public Long getExpYear()
      The expiration year of the card.
    • getFinancialAccount

      public String getFinancialAccount()
      The financial account this card is attached to.
    • getLast4

      public String getLast4()
      The last 4 digits of the card number.
    • getLivemode

      public Boolean getLivemode()
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • getNumber

      public String getNumber()
      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.
    • getObject

      public String getObject()
      String representing the object's type. Objects of the same type share the same value.

      Equal to issuing.card.

    • getReplacementReason

      public String getReplacementReason()
      The reason why the previous card needed to be replaced.

      One of damaged, expired, lost, or stolen.

    • getShipping

      public Card.Shipping getShipping()
      Where and how the card will be shipped.
    • getSpendingControls

      public Card.SpendingControls getSpendingControls()
    • getStatus

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

      One of active, canceled, or inactive.

    • getType

      public String getType()
      The type of the card.

      One of physical, or virtual.

    • getWallets

      public Card.Wallets getWallets()
      Information relating to digital wallets (like Apple Pay and Google Pay).
    • setBrand

      public void setBrand(String brand)
      The brand of the card.
    • setCancellationReason

      public void setCancellationReason(String cancellationReason)
      The reason why the card was canceled.

      One of design_rejected, lost, or stolen.

    • setCardholder

      public void setCardholder(Cardholder cardholder)
      An Issuing Cardholder object represents an individual or business entity who is issued cards.

      Related guide: How to create a cardholder

    • setCreated

      public void setCreated(Long created)
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • setCurrency

      public void setCurrency(String currency)
      Three-letter ISO currency code, in lowercase. Supported currencies are usd in the US, eur in the EU, and gbp in the UK.
    • setCvc

      public void setCvc(String cvc)
      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.
    • setExpMonth

      public void setExpMonth(Long expMonth)
      The expiration month of the card.
    • setExpYear

      public void setExpYear(Long expYear)
      The expiration year of the card.
    • setFinancialAccount

      public void setFinancialAccount(String financialAccount)
      The financial account this card is attached to.
    • setId

      public void setId(String id)
      Unique identifier for the object.
    • setLast4

      public void setLast4(String last4)
      The last 4 digits of the card number.
    • setLivemode

      public void setLivemode(Boolean livemode)
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • setMetadata

      public void setMetadata(Map<String,String> metadata)
      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.
    • setNumber

      public void setNumber(String number)
      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.
    • setObject

      public void setObject(String object)
      String representing the object's type. Objects of the same type share the same value.

      Equal to issuing.card.

    • setReplacementReason

      public void setReplacementReason(String replacementReason)
      The reason why the previous card needed to be replaced.

      One of damaged, expired, lost, or stolen.

    • setShipping

      public void setShipping(Card.Shipping shipping)
      Where and how the card will be shipped.
    • setSpendingControls

      public void setSpendingControls(Card.SpendingControls spendingControls)
    • setStatus

      public void setStatus(String status)
      Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to inactive.

      One of active, canceled, or inactive.

    • setType

      public void setType(String type)
      The type of the card.

      One of physical, or virtual.

    • setWallets

      public void setWallets(Card.Wallets wallets)
      Information relating to digital wallets (like Apple Pay and Google Pay).
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Unique identifier for the object.
      Specified by:
      getId in interface HasId
    • getMetadata

      public Map<String,String> getMetadata()
      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.
      Specified by:
      getMetadata in interface MetadataStore<Card>