#benkass

1 messages · Page 1 of 1 (latest)

hushed meadowBOT
misty cove
#

Hello! There is no equivalent. Setup Intents are designed to set up a Payment Method for future use without taking a payment. No payment means no amount.

narrow horizon
#

I see. To explain what I'm trying to do: I'm working on creating a setupIntent with which I will create a payment method. I will then clone it on a connected account and with the clone generate the paymentIntent.
So now, I got the setupIntent. Should I first create the paymentMethod before presentPaymentSheet?

#

I mean create paymentMethod, clone it, create the paymentIntent and then only show the dialog?

misty cove
#

To clarify your use case, it sounds like you're saving the Payment Method on your platform account so you can reuse it for multiple direct charges with multiple connected accounts, is that correct?

narrow horizon
#

indeed

#

so a customer of ours can order food from multiple restaurants and each restaurant owner is a connected account

#

standard

misty cove
#

Generally the correct approach is to do what you're doing now, create a Setup Intent on your platform, confirm it with the PaymentSheet, then clone the Payment Method for each direct charge. Typically the Payment Intents created on the connected accounts would happen later and be off-session payments, but it sounds like you want to create a payment while the customer is still on-session?

#

Ah, I see.

#

In that case you have two options...

misty cove
#
  1. You can create the Payment Intents and confirm each of them client-side individually. This would allow any next actions, like 3D Secure, to be handled by the customer.
#
  1. You can create the Payment Intents and confirm each of them server-side, then if a next action is required you can pass the client secret to your app and handle the action there.
#

Regardless, though, you'll still be doing the Setup Intent on your platform initially, and no amount will be defined at that point. You would need to show an amount yourself, in your own UI.

narrow horizon
#

But I'm using the stripe-react-native lib. I don't want to recreate it

misty cove
#

I'm not saying you recreate the PaymentSheet, I'm saying you would show the amount prior to showing the PaymentSheet.

narrow horizon
#

Yes, I do. The customer sees their order details, they click the pay by card button, it goes to the server, creates the setupIntent, ephemeralKey, and then pulls up the stripe bottom sheet that allows them to add a credit card. There it should show the amount to be paid.

misty cove
#

Yeah, that can't happen with this setup.

#

There is no amount to show at that point.

#

The individual amount(s) come later, with the Payment Intents.

narrow horizon
#

Which is what I suggested above, no? create the clone and paymentIntent on the connected account, and then I would have the object to present the bottom sheet with the amount, no?

misty cove
#

One sec, let me check something...

narrow horizon
#

sure

misty cove
#

That approach lets you specify an arbitrary amount in the PaymentSheet.

narrow horizon
#

good

#

checking the link

#

OK, so if I get this right, I am presenting the bottom sheet to the client on the app showing the amount they will pay. They can input a credit card and once they confirm, I process it on the server, right?

misty cove
#

Yeah, you get a Payment Method and then you set it up with a Setup Intent on your server, clone, create Payment Intents, etc.

narrow horizon
#

Ok cool. I don’t see I pass a customer ID in this call. Will the dialog remember the customer credit cards?

misty cove
#

Not sure what you mean, can you elaborate? I thought you wanted to collect new payment details?

narrow horizon
#

Not necessarily. Imagine we are Uber eats and each restaurant is a connected account. The customer adds items to the cart and once they are ready to pay we show them the dialog. There they can select or enter new credit cards confirm and voila

misty cove
narrow horizon
#

Ah there you go, so I init the payment sheet with the custom id and ephemeralKeySecret. cool. I'll give it a try

#

thank you

narrow horizon
# misty cove Yeah, you get a Payment Method and then you set it up with a Setup Intent on you...

So I'm testing this... I have a button to pay by card. onPress I try to initializePaymentSheet. It returns an error: You must provide either paymentIntentClientSecret or setupIntentClientSecret", "message": "You must provide either paymentIntentClientSecret or setupIntentClientSecret
So if that's the case, then I believe you don't get a Payment Method with this dialog before creating a setupIntent on the server, no?

misty cove
#

What version of the iOS SDK are you using?

narrow horizon
#

react native

#

let me look

misty cove
#

Oh, right.

narrow horizon
#

"@stripe/stripe-react-native": "0.28.0",

#

in Expo

#

latest version of expo though

misty cove
narrow horizon
#

gotcha. Let me try to upgrade

#

Do you think the latest will work with expo 49?

misty cove
#

I'm not a React developer, so I'm not sure. I was under the impression that Expo required specific versions.

narrow horizon
#

it does. Although I have installed newer version of some libs before

#

It gives you a warning but doesn't restrict you

#

I'll try it

hushed meadowBOT
narrow horizon
#

Ahhhh no. v0.29 doesn't seem to work out with expo