#benkass
1 messages · Page 1 of 1 (latest)
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.
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?
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?
indeed
so a customer of ours can order food from multiple restaurants and each restaurant owner is a connected account
standard
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...
yes
- 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.
- 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.
But I'm using the stripe-react-native lib. I don't want to recreate it
I'm not saying you recreate the PaymentSheet, I'm saying you would show the amount prior to showing the PaymentSheet.
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.
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.
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?
One sec, let me check something...
sure
Ah, what you could do is collect the payment details before creating an Intent, then do the Setup Intent and Payment Intents async behind the scenes: https://stripe.com/docs/payments/accept-a-payment-deferred?platform=ios&type=payment
That approach lets you specify an arbitrary amount in the PaymentSheet.
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?
Yeah, you get a Payment Method and then you set it up with a Setup Intent on your server, clone, create Payment Intents, etc.
Ok cool. I don’t see I pass a customer ID in this call. Will the dialog remember the customer credit cards?
Not sure what you mean, can you elaborate? I thought you wanted to collect new payment details?
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
That's covered in this section of that guide: https://stripe.com/docs/payments/accept-a-payment-deferred?platform=ios&type=payment#ios-enable-saved-cards
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
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?
What version of the iOS SDK are you using?
Oh, right.
You need 0.29.0 or higher: https://github.com/stripe/stripe-react-native/blob/master/CHANGELOG.md#0290---2023-07-13
I'm not a React developer, so I'm not sure. I was under the impression that Expo required specific versions.
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
Ahhhh no. v0.29 doesn't seem to work out with expo