#komal-shrestha_code
1 messages Β· Page 1 of 1 (latest)
π Welcome to your new thread!
β²οΈ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
β±οΈ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
π This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1375014830066630657
π Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there! So it is possible to obtain the card brand from Payment Element by first creating the payment method [0]. Then once you have the payment method object (pm_xxxxxx), you can look up the card.brand parameter [1] via the api
[0] https://docs.stripe.com/js/payment_methods/create_payment_method_elements
[1] https://docs.stripe.com/api/payment_methods/object#payment_method_object-card-brand
You'd want to listen for complete=true [0] on the onChange event before creating the payment method as well
I just found this
const { confirmationToken } = await stripe.createConfirmationToken({
elements,
});
const method =
confirmationToken?.payment_method_preview.card?.brand || paymentMethod;
is this fine to use?
Yup that's fine too
@gentle plinth
<PaymentElement
onChange={handlePaymentMethod}
options={{
layout: {
type: 'accordion',
defaultCollapsed: true,
},
}}
/>
i have defaultCollapsed set to true. But after some time "Klarna" accordion is opened automatically. I noticed same issue "https://docs.stripe.com/payments/payment-element" here as well it opens "Affirm" automatically.
Hi, taking over as my teammate needs to step away. Let me catch up.
sure. thanks
What does 'But after some time "Klarna" accordion is opened automatically. I noticed same issue "https://docs.stripe.com/payments/payment-element" here as well it opens "Affirm" automatically' mean? You initially asked ' card brand from Payment Element ' and I'm unsure what you're trying to accomplish here. Are you able to reword your ask please?
This is the accordion of "Klarna(payment method) that opens up automatically
If you go to this docs "https://docs.stripe.com/payments/payment-element" and check the section in below image. You will see that the accordion of random payment method is expanded automatically after certain interval
What do you want to see instead?
i want accordion to be in collasped state unless clicked
Ah, by default it is. Can you go here https://docs.stripe.com/elements/appearance-api and confirm the default behavior?
This is what I see
Can you check this? https://docs.stripe.com/payments/payment-element
I am not getting the expected behaviour on my end
And same issue is here https://docs.stripe.com/payments/payment-element
https://docs.stripe.com/elements/appearance-api >> can you wait for 30s, one payment methods expanda automatically
I can't reproduce what you're seeing, can you share your country location so I can try?
Nepal
Hey! Taking over for my colleague. Let me catch up.
sure
Could you please share a screen recording of the issue you are referring to please on our official guide ?
https://docs.stripe.com/payments/payment-element
sure
Thanks
And it's always Klarna that auto-expand or each time randomly a new PaymentMethod got expanded ?
Could you please share another screen recording where you reload the page and wiat ?
In this docs its random, but in my local i only have card so always klarna opens
And if you test here https://docs.stripe.com/payments/quickstart (in the preview section), you have the same behavior π€ ?
Same behaviour here as well
Thanks for sharing all these details, let me narrow this internally further. Please give me couple of minutes.
Sure. Will wait on the uodate.
Ok, This issue will require an in-depth investigation from our team in order to figure out the root cause. Can we ask that you write in to us via https://support.stripe.com/contact, providing as much detail and context as possible (you can also reference this thread).
Hello @pure hornet, we have sent you a direct message, please check it at https://discord.com/channels/@me/1375046950713294878
- πThe message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
If possible to share the Element Session logs too (in the network tab, reference to endpoints that include session)
This is the issue from Stripe's side??
We're not sure β we're going to need to investigate further to figure out what's going on. The link you just got in a DM will enable that