Class Card

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

public class Card extends ApiResource implements MetadataStore<Card>, ExternalAccount, PaymentSource
You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

Related guide: Card payments with Sources

  • Constructor Details

    • Card

      public Card()
  • Method Details

    • getAccount

      public String getAccount()
      Get ID of expandable account object.
    • setAccount

      public void setAccount(String id)
    • getAccountObject

      public Account getAccountObject()
      Get expanded account.
    • setAccountObject

      public void setAccountObject(Account expandableObject)
    • getCustomer

      public String getCustomer()
      Get ID of expandable customer object.
    • setCustomer

      public void setCustomer(String id)
    • getCustomerObject

      public Customer getCustomerObject()
      Get expanded customer.
    • setCustomerObject

      public void setCustomerObject(Customer expandableObject)
    • update

      public Card update(Map<String,Object> params) throws StripeException
      If you need to update only some card details, like the billing address or expiration date, you can do so without having to re-enter the full card details. Stripe also works directly with card networks so that your customers can continue using your service without interruption.

      Updates a specified card for a given customer.

      Specified by:
      update in interface ExternalAccount
      Specified by:
      update in interface MetadataStore<Card>
      Throws:
      StripeException
    • update

      public Card update(Map<String,Object> params, RequestOptions options) throws StripeException
      If you need to update only some card details, like the billing address or expiration date, you can do so without having to re-enter the full card details. Stripe also works directly with card networks so that your customers can continue using your service without interruption.

      Updates a specified card for a given customer.

      Specified by:
      update in interface ExternalAccount
      Specified by:
      update in interface MetadataStore<Card>
      Throws:
      StripeException
    • update

      public Card update(CardUpdateOnAccountParams params) throws StripeException
      If you need to update only some card details, like the billing address or expiration date, you can do so without having to re-enter the full card details. Stripe also works directly with card networks so that your customers can continue using your service without interruption.

      Updates a specified card for a given customer.

      Throws:
      StripeException
    • update

      public Card update(CardUpdateOnAccountParams params, RequestOptions options) throws StripeException
      If you need to update only some card details, like the billing address or expiration date, you can do so without having to re-enter the full card details. Stripe also works directly with card networks so that your customers can continue using your service without interruption.

      Updates a specified card for a given customer.

      Throws:
      StripeException
    • update

      public Card update(CardUpdateOnCustomerParams params) throws StripeException
      If you need to update only some card details, like the billing address or expiration date, you can do so without having to re-enter the full card details. Stripe also works directly with card networks so that your customers can continue using your service without interruption.

      Updates a specified card for a given customer.

      Throws:
      StripeException
    • update

      public Card update(CardUpdateOnCustomerParams params, RequestOptions options) throws StripeException
      If you need to update only some card details, like the billing address or expiration date, you can do so without having to re-enter the full card details. Stripe also works directly with card networks so that your customers can continue using your service without interruption.

      Updates a specified card for a given customer.

      Throws:
      StripeException
    • delete

      public Card delete() throws StripeException
      Delete a specified external account for a given account.

      Delete a specified source for a given customer.

      Specified by:
      delete in interface ExternalAccount
      Throws:
      StripeException
    • delete

      public Card delete(RequestOptions options) throws StripeException
      Delete a specified external account for a given account.

      Delete a specified source for a given customer.

      Specified by:
      delete in interface ExternalAccount
      Throws:
      StripeException
    • delete

      public Card delete(Map<String,Object> params) throws StripeException
      Delete a specified external account for a given account.

      Delete a specified source for a given customer.

      Specified by:
      delete in interface ExternalAccount
      Throws:
      StripeException
    • delete

      public Card delete(Map<String,Object> params, RequestOptions options) throws StripeException
      Delete a specified external account for a given account.

      Delete a specified source for a given customer.

      Specified by:
      delete in interface ExternalAccount
      Throws:
      StripeException
    • getAddressCity

      public String getAddressCity()
      City/District/Suburb/Town/Village.
    • getAddressCountry

      public String getAddressCountry()
      Billing address country, if provided when creating card.
    • getAddressLine1

      public String getAddressLine1()
      Address line 1 (Street address/PO Box/Company name).
    • getAddressLine1Check

      public String getAddressLine1Check()
      If address_line1 was provided, results of the check: pass, fail, unavailable, or unchecked.
    • getAddressLine2

      public String getAddressLine2()
      Address line 2 (Apartment/Suite/Unit/Building).
    • getAddressState

      public String getAddressState()
      State/County/Province/Region.
    • getAddressZip

      public String getAddressZip()
      ZIP or postal code.
    • getAddressZipCheck

      public String getAddressZipCheck()
      If address_zip was provided, results of the check: pass, fail, unavailable, or unchecked.
    • getAvailablePayoutMethods

      public List<String> getAvailablePayoutMethods()
      A set of available payout methods for this card. Only values from this set should be passed as the method when creating a payout.
    • getBrand

      public String getBrand()
      Card brand. Can be American Express, Diners Club, Discover, Eftpos Australia, JCB, MasterCard, UnionPay, Visa, or Unknown.
    • getCountry

      public String getCountry()
      Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
    • getCurrency

      public String getCurrency()
      Three-letter ISO code for currency. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency.
    • getCvcCheck

      public String getCvcCheck()
      If a CVC was provided, results of the check: pass, fail, unavailable, or unchecked. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see Check if a card is valid without a charge.
    • getDefaultForCurrency

      public Boolean getDefaultForCurrency()
      Whether this card is the default external account for its currency.
    • getDeleted

      public Boolean getDeleted()
      Always true for a deleted object.
    • getDescription

      public String getDescription()
      A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.)
    • getDynamicLast4

      public String getDynamicLast4()
      (For tokenized numbers only.) The last four digits of the device account number.
    • getExpMonth

      public Long getExpMonth()
      Two-digit number representing the card's expiration month.
    • getExpYear

      public Long getExpYear()
      Four-digit number representing the card's expiration year.
    • getFingerprint

      public String getFingerprint()
      Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.

      As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.

    • getFunding

      public String getFunding()
      Card funding type. Can be credit, debit, prepaid, or unknown.
    • getIin

      public String getIin()
      Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)
    • getIssuer

      public String getIssuer()
      The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)
    • getLast4

      public String getLast4()
      The last four digits of the card.
    • getName

      public String getName()
      Cardholder name.
    • getNetworks

      public Card.Networks getNetworks()
    • getObject

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

      Equal to card.

    • getStatus

      public String getStatus()
      For external accounts that are cards, possible values are new and errored. If a payout fails, the status is set to errored and scheduled payouts are stopped until account details are updated.
    • getTokenizationMethod

      public String getTokenizationMethod()
      If the card number is tokenized, this is the method that was used. Can be android_pay (includes Google Pay), apple_pay, masterpass, visa_checkout, or null.
    • setAddressCity

      public void setAddressCity(String addressCity)
      City/District/Suburb/Town/Village.
    • setAddressCountry

      public void setAddressCountry(String addressCountry)
      Billing address country, if provided when creating card.
    • setAddressLine1

      public void setAddressLine1(String addressLine1)
      Address line 1 (Street address/PO Box/Company name).
    • setAddressLine1Check

      public void setAddressLine1Check(String addressLine1Check)
      If address_line1 was provided, results of the check: pass, fail, unavailable, or unchecked.
    • setAddressLine2

      public void setAddressLine2(String addressLine2)
      Address line 2 (Apartment/Suite/Unit/Building).
    • setAddressState

      public void setAddressState(String addressState)
      State/County/Province/Region.
    • setAddressZip

      public void setAddressZip(String addressZip)
      ZIP or postal code.
    • setAddressZipCheck

      public void setAddressZipCheck(String addressZipCheck)
      If address_zip was provided, results of the check: pass, fail, unavailable, or unchecked.
    • setAvailablePayoutMethods

      public void setAvailablePayoutMethods(List<String> availablePayoutMethods)
      A set of available payout methods for this card. Only values from this set should be passed as the method when creating a payout.
    • setBrand

      public void setBrand(String brand)
      Card brand. Can be American Express, Diners Club, Discover, Eftpos Australia, JCB, MasterCard, UnionPay, Visa, or Unknown.
    • setCountry

      public void setCountry(String country)
      Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
    • setCurrency

      public void setCurrency(String currency)
      Three-letter ISO code for currency. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency.
    • setCvcCheck

      public void setCvcCheck(String cvcCheck)
      If a CVC was provided, results of the check: pass, fail, unavailable, or unchecked. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see Check if a card is valid without a charge.
    • setDefaultForCurrency

      public void setDefaultForCurrency(Boolean defaultForCurrency)
      Whether this card is the default external account for its currency.
    • setDeleted

      public void setDeleted(Boolean deleted)
      Always true for a deleted object.
    • setDescription

      public void setDescription(String description)
      A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.)
    • setDynamicLast4

      public void setDynamicLast4(String dynamicLast4)
      (For tokenized numbers only.) The last four digits of the device account number.
    • setExpMonth

      public void setExpMonth(Long expMonth)
      Two-digit number representing the card's expiration month.
    • setExpYear

      public void setExpYear(Long expYear)
      Four-digit number representing the card's expiration year.
    • setFingerprint

      public void setFingerprint(String fingerprint)
      Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.

      As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.

    • setFunding

      public void setFunding(String funding)
      Card funding type. Can be credit, debit, prepaid, or unknown.
    • setId

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

      public void setIin(String iin)
      Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)
    • setIssuer

      public void setIssuer(String issuer)
      The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)
    • setLast4

      public void setLast4(String last4)
      The last four digits of the card.
    • 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.
    • setName

      public void setName(String name)
      Cardholder name.
    • setNetworks

      public void setNetworks(Card.Networks networks)
    • setObject

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

      Equal to card.

    • setStatus

      public void setStatus(String status)
      For external accounts that are cards, possible values are new and errored. If a payout fails, the status is set to errored and scheduled payouts are stopped until account details are updated.
    • setTokenizationMethod

      public void setTokenizationMethod(String tokenizationMethod)
      If the card number is tokenized, this is the method that was used. Can be android_pay (includes Google Pay), apple_pay, masterpass, visa_checkout, or null.
    • 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>