I can't find the method to retrieve selected payment method card image in PaymentSession.PaymentSessionListener onPaymentSessionDataChanged().
I'm using Stripe 12.8.0.
On the other hand this property is present in iOS SDK with call paymentContext.selectedPaymentOption?.image
I have the same issue. On iOS, we can easily get the card image but on Android it looks like the feature is missing. Hopefully an update will come soon!
@Wajahat-Jawaid I just put up a PR that introduces a class CardBrand that should help with this. Assuming you have a PaymentMethod instance, paymentMethod, you can do the following:
val brandIcon = ContextCompat.getDrawable(
context,
CardBrand.fromCode(paymentMethod.card?.brand).icon
)
This is now available in 12.8.2
Thanks @mshafrir-stripe for the resolution!
Most helpful comment
@Wajahat-Jawaid I just put up a PR that introduces a class
CardBrandthat should help with this. Assuming you have aPaymentMethodinstance,paymentMethod, you can do the following: