1
votes

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

1

1 Answers

0
votes

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
 }