简体   繁体   中英

Is there any method or parameter to get the invalid/stop card information from stripe api I get only expiry month/year from stripe

Is there any method or parameter from stripe where I get the information every time when I get card details of the customer to identify this card is valid/Stop or not because in my case user added his card and after that, he stops his credit card then after he his able to do the payment.

I already check user card expiry detail(month/year) that I get from stripe API.

ExternalAccountCollection externalAccountCollection = 
Customer.retrieve(user.getCustomer_id()).getSources().list(cardParams;

List<ExternalAccount> externalAccounts = new ArrayList<>(); 
externalAccounts.addAll(externalAccountCollection.getData());
Card card = (Card) externalAccounts.get(0);

I get below parameters from card object.

addressCity, addressCountry, addressLine1, addressLine1Check; addressLine2, addressState, addressZip, addressZipCheck, availablePayoutMethods brand country currency cvcCheck defaultForCurrency dynamicLast4 Month Year fingerprint funding last4 name recipient status tokenizationMethod

when you use stripe you have to enter card number, exp date, cvc in form then stripe check this card and return token , if you want to check card expiry use this :

 Card card = new Card("4242424242424242", 12, 2020, "123");  
 if (!card.validateCard())
     {// Do not continue token creation.
    }
 else
 {
  // generate token
 }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM