#schteve
1 messages · Page 1 of 1 (latest)
Have you tried listening to the on change event? I think you get updates with the brand once the number is complete like with the card element but am not 100% sure and can't test right now. Can look further in to it https://stripe.com/docs/js/element/events/on_change?type=paymentElement
Sadly it does not work for me. I always, regardless if the number is complete or not, get the same event structure, like this:
Gotcha, thank you for checking. Will see if there is anything else you can do here
Otherwise I can put in a feature request
Thank you very much 🙂
Yes that would be great, since my company cooperates with Visa and we want to give customers a discount when they pay with their Visa card.
Gotcha, thanks for the context. For what it is worth I do see "Charge a different application fee amount based on the card brand, country, or payment method" listed as something that can be done for either element type though I am unsure how that may work here https://stripe.com/docs/payments/payment-card-element-comparison#advanced-scenarios
I will ask a colleague who is more familiar with this and will get back to you
Hey @void dirge thanks for the patience here. So the element itself can't detect card brand but there are two ways that you may be able to do this flow
The first is with a current beta that we have, the "deferred intents" beta. Basically you would be able to collect card data client side and look at it server side to see how much you should charge with your payment intent https://stripe.com/docs/payments/defer-intent-creation
Without that beta, you could do something similar with separate auth and capture. Basically you would place a hold on each card whenever you are trying to take payment, then you could check the card brand and only capture a partial amount if you see that it is a visa card https://stripe.com/docs/payments/place-a-hold-on-a-payment-method
Thank you for the two suggestions. We actually already use the place hold & charge approach, so the actual charging of the discount is not the problem. It's rather that we want to show the user that the discount is applied when they enter their card details. Thats why we need the card network in the frontend upon user input.