#PERF-default payment method

1 messages ยท Page 1 of 1 (latest)

lost shell
#

๐Ÿ‘‹ happy to help

sour hare
#

for reference all four of the payment methods in that screen grab were created from the setup intent sdk UI

lost shell
#

are you talking about the customer's payment methods?

sour hare
#

yes

lost shell
#

and is the default payment method for recurring invoices?

sour hare
#

no we are not going to use it for recurring invoices

lost shell
#

then there is no "default" concept on the API side, you can only set it as default through the Dashboard

sour hare
#

what does this checkmark indicate then?

lost shell
#

where are you getting that from?

sour hare
#

payment setup sheet via the react native stripe SDK

prime basin
#

HI ๐Ÿ‘‹ I'm stepping in for @lost shell . On the Payment Sheet I think the checkmark is just used to indicate the selected payment method. Can you test whether it stays on that card if you select the MasterCard next to it?

sour hare
#

The checkmark changes when selecting a new card, however when first opening the sheet, it preselects a payment method. I am wondering how it determines which card to have preselected.

prime basin
#

I don't have a good answer for you other than I think the default is the first value in the list of payment methods returned by the API when the Payment Sheet loads

sour hare
#

the customer has no default according to the stripe dashboard though ๐Ÿ˜ฆ

#

for reference this is the customer ID cus_M14LdNvN9Qa1zv if that helps

prime basin
#

Right but the element as rendered requires an initial value. So without a default the first PM in the list is selected

sour hare
#

oh well it saves the selected one, so is the API smart enough to swap which one it shows without actually updating the default?

prime basin
#

I'm not sure what you mean by that. Could you rephrase your question?

sour hare
#

When originally opening the sheet i am shown this

#

I then selected a new card

#

Then finally when opening the sheet again it successfully picks that new card that was previously selected. However within the Dashboard UI it doesn't update anything or have any indication of what the default card is.

prime basin
#

Okay, I'm not sure and I don't think that's the API. I suspect that has more to do with local cached preferences but I'm not 100% certain

sour hare
#

If you kill the application completely , re open the sheet it still knows which was previously selected

#

to my knowledge the sheet is just fetching the customer's payment methods via the standard list endpoint for payment methods

prime basin
#

That is what I would expect too initially but based on this behavior I would suspect some degree of local storage. Let me see if I can find anything about that

sour hare
#

the order of the list isn't correlated to the order of the list displayed either.

that being that the checked or "default" payment method is always first in the display but not in the fetched list

prime basin
#

๐Ÿค”

#

I'm reaching out to my colleagues to see if anyone is more familiar with this exact scenario

sour hare
#

thanks!

prime basin
sour hare
#

alright a few questions following up

  1. Is that accessible?
  2. Can you send me the android portion?
  3. Also is it a bug that the payment methods are not setting a default normally?
prime basin
#
  1. No, this is intended.
#
  1. If by accessible do you mean you can configure it? No I don't think so
sour hare
#

by accessible i mean can i get the value of the payment method object

prime basin
#

The one selected? I don't think so .... but I wouldn't rule it out