#PERF-default payment method
1 messages ยท Page 1 of 1 (latest)
for reference all four of the payment methods in that screen grab were created from the setup intent sdk UI
are you talking about the customer's payment methods?
yes
and is the default payment method for recurring invoices?
no we are not going to use it for recurring invoices
then there is no "default" concept on the API side, you can only set it as default through the Dashboard
what does this checkmark indicate then?
where are you getting that from?
payment setup sheet via the react native stripe SDK
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?
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.
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
the customer has no default according to the stripe dashboard though ๐ฆ
for reference this is the customer ID cus_M14LdNvN9Qa1zv if that helps
Right but the element as rendered requires an initial value. So without a default the first PM in the list is selected
oh well it saves the selected one, so is the API smart enough to swap which one it shows without actually updating the default?
I'm not sure what you mean by that. Could you rephrase your question?
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.
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
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
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
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
๐ค
I'm reaching out to my colleagues to see if anyone is more familiar with this exact scenario
thanks!
Found it, it IS local storage. The app saves the default in this code snippet: https://github.com/stripe/stripe-ios/blob/8ca9931984949fbce44c342d5cecdada03cda18f/Stripe/DefaultPaymentMethodStore.swift
alright a few questions following up
- Is that accessible?
- Can you send me the android portion?
- Also is it a bug that the payment methods are not setting a default normally?
- No, this is intended.
- It's a little busy for me to find that myself but our Android SDK is open source: https://github.com/stripe/stripe-android
- If by accessible do you mean you can configure it? No I don't think so
by accessible i mean can i get the value of the payment method object
The one selected? I don't think so .... but I wouldn't rule it out