#PERF-payment-sheet

1 messages ยท Page 1 of 1 (latest)

fallen cedar
#

Hello ๐Ÿ‘‹
Let me take a look

#

What is the setupIntent status when you set the customeFlow to false?

dense hare
#

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

fallen cedar
#

do you have an example SetupIntent ID that I can take a look at?

dense hare
#

seti_1LPXSwFdV4bT3T5FiQOu0Ziu_secret_M7n3Z7hdPzXcdl7oQELFjSHUUYhPCRa

#

just created that one

fallen cedar
#

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?

dense hare
#

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

fallen cedar
#

when you say dismissing, you mean closing the sheet without clicking on set up button correct?

dense hare
#

yes

#

or when clicking an existing payment method when customFlow: true

fallen cedar
#

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

dense hare
#

hmm alright...

I am trying to get access to the assumed "default" payment method in the client.

#

aka the checkmarked one.

fallen cedar
#

AFAIK its retrieved from the customer

#

So if the customer has one default payment method then it would show up there as default

dense hare
#

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 ๐Ÿฅฒ

fallen cedar
#

all good ๐Ÿ™‚

#

Yeah I believe the order is maintained on the app level

dense hare
#

Is there any way to access the value stored there?

lucid willow
#

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?

dense hare
#

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

lucid willow
#

I believe the PaymentSheet sets the default to whatever the last selected PaymentMethod was.

#

This is in React Native, correct?

dense hare
#

for reference

 "@stripe/stripe-react-native": "^0.15.0",
dense hare
lucid willow
#

Yep, they're two separate things.

#

Let me see if we expose this in React Native...

dense hare
#

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?

lucid willow
#

Let's back up a bit; at a high level what are you trying to accomplish?

dense hare
#

i want to charge a customer's default payment at a later time

#

and display said payment method to the customer

#

before doing so

lucid willow
#

What do you consider to be their default payment method?

dense hare
#

i guess whatever is pre-selected here

#

when first opening the model

lucid willow
#

Can you give me the Customer ID (cus_) of the Customer you're testing with in that screenshot?

dense hare
#
cus_M14LdNvN9Qa1zv
lucid willow
#

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?

dense hare
#

That's whichever one was last selected on that device.
yea is that accessible via a hook or something ?

lucid willow
#

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.

dense hare
#

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

lucid willow
#

Right... that's what the PaymentSheet handles for you, but you were talking about using it later outside the PaymentSheet?

dense hare
#

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.

lucid willow
#

Wait... sorry, I think I'm missing some important context.

#

Updating to Payment Intents?

#

Updating to Payment Intents from what?

dense hare
#

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.

lucid willow
#

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.

dense hare
#

oh

#

ok

#

that is useful ๐Ÿ™‚

#

@lucid willow thanks for the time !

lucid willow
#

Happy to help! Is there anything else I can do to assist?

dense hare
#

no, that is it