#andrea-skuola-paymentmethods

1 messages ยท Page 1 of 1 (latest)

burnt moon
#

hi! that call does return all the payment methods attached to that customer, and the ordering is most-recently-created first.

candid coral
#

yes, if i want to order card ascending?

#

so the first created is the first in the list

burnt moon
#

that's not possible unfortunately, all list endpoints in our API use the same ordering of most recent first, and can't be customised

candid coral
#

oh ok

burnt moon
#

you can of course take that list and then reverse how you show it in your own UI and code

#

but in terms of what's returned by the API directly, the JSON response is a list of payment methods most-recently-created-first

candid coral
#

ok thanks

#

another question: can I create two setupIntents in the same page or they runs in conflict?

ebon saddle
#

Hello ๐Ÿ‘‹
Taking over for karllekko here as they had to step away.
I'm not sure I follow the use-case here.

candid coral
#

i have to add a payment method for customer, not in payment flow, just in case user want to change payment method

#

i give him 2 cases: card or sepa_debit

#

since i have my graphics can i create 2 setupIntent for generate the 2 forms that makes user add the payment method choosen

#

?

ebon saddle
#

since i have my graphics can i create 2 setupIntent for generate the 2 forms that makes user add the payment method choosen
are you creating these forms on your own or are you using Stripe elements?

candid coral
#

Stripe elements

#

if i give different ids to forms and elements everything should work, right?

ebon saddle
#

I'm not sure as I haven't tried this flow personally.
I'd suggest you give it a try and see if it gives you any errors. I'd be happy to help you resolve them if any.

candid coral
#

i asked this question because before i had only one form with card method and everything works

#

now i added the form to add the sepa_debit payment method and i run into this error:

#

the code its the same as card form that works before this

#

now the 2 forms doesnt work

#

same error on both

#

i try to explain it better,

candid coral
#

what can i do?

ebon saddle
#

can you share your example code for this?
I'm not sure I've seen something like this before ๐Ÿ˜„

candid coral
ebon saddle
#

so this is the code for the second payment element?

candid coral
#

now i noticed that even the two payment elements doesn't work so its the same

#

but they are identical, only variable names change

#

i copied the snippet in the documentation and changed variable names

#

i think i solved this alone..

ebon saddle
#

Oh nice! sorry juggling between a few threads at the moment.
What solved it for you?

candid coral
#

don't know actually ๐Ÿ˜†

ebon saddle
#

Ahaha np! As long as you're unblocked ๐Ÿ™‚

candid coral
#

proably I found it: if i comment this the integration will work

#

when i create 2 setupIntents it give me the error i attached before

#

did you know why?

ebon saddle
#

I cant say for sure but maybe elements don't like be initialized with two different client-secerts