#alanx4654
1 messages ยท Page 1 of 1 (latest)
It'd be card. You can look at the card[wallet] hash for specific details: https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-wallet
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
card[wallet][type]: https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-wallet-type
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
The API reference has all the available fields
card.brand
Why not test an Apple Pay transaction and find out?
Because that's not a brand
As I explained, there'll be a card[wallet] hash if it's a Google/Apple Pay payment
OK, fine
String cardType = subscription.getDefaultPaymentMethodObject().getCard().getBrand();
cardType = (cardType == "unknown") ? subscription.getDefaultPaymentMethodObject().getCard().getWallet().getType();
cardInfo.setCardType(cardType);
am i right?
I want to show payment logo on my own page
so I need to know what's the payment method...
brand is the key field I need
Hi! I'm taking over this thread.
you are so nice
I want to show payment logo on my own page
so I need to know what's the payment method...
brand is the key field I need
String cardType = subscription.getDefaultPaymentMethodObject().getCard().getBrand();
cardType = (cardType == "unknown" && subscription.getDefaultPaymentMethodObject().getCard().getWallet() != null) ? subscription.getDefaultPaymentMethodObject().getCard().getWallet().getType() : cardType;
cardInfo.setCardType(cardType);
am i right in this way?
That looks okay to me, but the best way to know it to actually test the code ๐
I dont have google pay ๐ข
You can't set it up for a quick test?
I just want to confirm ....If I use google pay , the card.brand will give me unknown ?
and google_pay will be in the card.wallet.type field?
Give me a few minutes to test this on my end.
In my case I do see the brand of the card, and I get wallet.type: "google_pay"
what's your brand value?
It depends on the card used I guess. In my case it was visa.
Note that I tested this in test mode, in live mode it might be different.
Is there any suggestion about show payment logo on my own front-end page?
So I recommend just looking at wallet.type to know if the card is Google/Apple Pay.
We have this article: https://support.stripe.com/questions/where-to-find-logos-for-accepted-credit-card-types
ok, big thanks