#PERF-payment-sheet
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Let me take a look
What is the setupIntent status when you set the customeFlow to false?
the setupIntent starts in RequiresPaymentMethod status and goes to Succeeded when the "Set up" button is tapped
the status doesn't appear to change if the model is dismissed or custom flow is set to true and a payment method is selected
do you have an example SetupIntent ID that I can take a look at?
seti_1LPXSwFdV4bT3T5FiQOu0Ziu_secret_M7n3Z7hdPzXcdl7oQELFjSHUUYhPCRa
just created that one
Just to make sure I'm on the same page, Is your question why the paymentMethodId doesn't show up in setupIntentResult after you confirm the SetupIntent?
It won't be available before you confirm the SetupIntent.
SetupIntents are used to setup new payment methods, not existing ones right?
Is there a guide you're following for this? If so, can you share the link to it?
Ah okay, so this is a different flow
https://stripe.com/docs/payments/save-and-reuse?platform=react-native&ui=payment-sheet#react-native-flowcontroller
I guess my question was. confusing a little
my question was more so that why when dismissing the model the presentPaymentSheet has a return value for paymentOption yet the setup intent does not have an attached paymentMethodId and no error
when you say dismissing, you mean closing the sheet without clicking on set up button correct?
customFlow: true is the manual confirmation flow
so it is creates a payment method but waits for you to confirm the intent. So its expected that it'll have the paymentmethodID
I've not personally used this flow with SetupIntent as mostly we see this with PaymentIntents
with customFlow: false, it triggers the usual payment method collection flow where we don't expect you to receive paymentOptions as shown in the example as the idea is that the payment method will only be saved if the SetupIntent is successfully confirmed
https://stripe.com/docs/payments/save-and-reuse?platform=react-native&ui=payment-sheet#react-native-collect-payment-details
hmm alright...
I am trying to get access to the assumed "default" payment method in the client.
aka the checkmarked one.
AFAIK its retrieved from the customer
So if the customer has one default payment method then it would show up there as default
yea they don't
so it defaults to the first in the list, unless swapped at any point in the apps life time.
until the app is uninstall and reinstalled, to my knowledge
so the app's concept of "default" vs data's could be different i think
sorry for the mouth full ๐ฅฒ
Is there any way to access the value stored there?
Hello! I'm taking over and catching up now... so you're trying to access what the PaymentSheet considers to be the default payment method? When are you trying to access it, and why?
i want to be able to properly display outside the payment sheet model what currently selected payment method the user has. It seems the "default" payment method is updated regardless if the users actually taps "Set up" or not
I believe the PaymentSheet sets the default to whatever the last selected PaymentMethod was.
This is in React Native, correct?
yes
for reference
"@stripe/stripe-react-native": "^0.15.0",
yea, but this isn't reflective of what is the "default" within the dashboard or api
since you can not set a "default" payment method via the sheets the concept of "default" is gone ?
unless manually set elsewhere via the API?
Let's back up a bit; at a high level what are you trying to accomplish?
i want to charge a customer's default payment at a later time
and display said payment method to the customer
before doing so
What do you consider to be their default payment method?
Can you give me the Customer ID (cus_) of the Customer you're testing with in that screenshot?
cus_M14LdNvN9Qa1zv
That's whichever one was last selected on that device. It's not something you can access from the API if that's what you mean?
That's whichever one was last selected on that device.
yea is that accessible via a hook or something ?
I don't think so, I'm looking through the React Native SDK's API now though...
While I'm looking I'm not sure I completely understand why you want to know that value? You mentioned using it to charge them later... that seems like something I would not recommend. As a customer, the last thing I selected in the payment sheet shouldn't really matter. You should decide which PaymentMethod to use based on something more concrete/deliberate than that.
well i guess the idea is that, you would be prompted the payment sheet. like the last screen grab. then be charged on the payment method picked there
we are trying to do a raffle like payment. If you win the raffle you are given the opportunity to purchase
Right... that's what the PaymentSheet handles for you, but you were talking about using it later outside the PaymentSheet?
yea...
the context is kinda convoluted since it is more of a bandaid fix before updating this section to payment intents.
at the end of the day setting a confirmed but un-captured payment intent would be best.
Wait... sorry, I think I'm missing some important context.
Updating to Payment Intents?
Updating to Payment Intents from what?
currently my whole ORG is using charge API.
This purpose of doing what I wanted to do was to have minimal changes to this portion of our application.
The PaymentSheet is not compatible with the Charges API, nor are PaymentMethods. None of the PaymentMethods shown in your screenshot can be used to create a Charge directly.
Happy to help! Is there anything else I can do to assist?
no, that is it