I am using Stripe API and using below code I fetch details -
Customer cu = Customer.retrieve(customerid); // customerid
List<ExternalAccount> object = cu.getSources().getData();
Log.d("customerobj",object + "");
I get this object data
D/customerobj: [
<com.stripe.model.Card@148232829id=>JSON: {
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": "71000",
"address_zip_check": "pass",
"available_payout_methods": null,
"brand": "Visa",
"country": "US",
"currency": null,
"cvc_check": "pass",
"default_for_currency": null,
"description": null,
"dynamic_last4": null,
"exp_month": 4,
"exp_year": 2021,
"fingerprint": "EmNhHLSbWLElhMvG",
"funding": "credit",
"iin": null,
"issuer": null,
"last4": "4242",
"name": null,
"recipient": null,
"status": null,
"three_d_secure": null,
"tokenization_method": null,
"type": null,
"account": null,
"customer": "cus_DL2GSWX9bfTZeU",
"id": "card_1CuMC8A41bIzZYFFlpiW3hZp",
"metadata": {
},
"object": "card"
}
]
I want to get last 4 digits card number, exp_year, exp_month and address_zip.
Please help me get this String values
0thelement ofobjectwhich will return you object ofExternalAccountPoJo. After getting object ofExternalAccountPoJo just use their getters to fetch all values you require - Varad Mondkar