#rahul_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1247371198028054538
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
We have a use case where users get charged a few days after they make their payment, so we're switching to Setup Intents
We're also moving from using the PaymentSheet to the PaymentSheet.FlowController
The first time makes sense - users enter card details, it creates a setup intent, and once succeeded, we can use the payment method on a payment method
on a subsequent checkout, do we have to set up a new setup intent (would that be good practise) or can we just use the payment method directly in a new paymentintent
You can use the saved payment method collected from Setup Intent for the new Payment Intent. Here's how you can do it: https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=elements#charge-saved-payment-method
Ok awesome - and there's no limit on the # of transactions?
There is no limit on the Payment intent to be created
awesome, thank you!
No problem! Happy to help ๐
also 1 last thing
i was also looking at https://docs.stripe.com/payments/finalize-payments-on-the-server?platform=ios&type=setup&integration=paymentsheet-flowcontroller
and this outlines the process of doing the setup intent, but just to double check
The Setup Intent integration guide is correct for iOS
After the first payment,
- does the PaymentSheet.FlowController payment sheet list out the customer's existing payment methods?
- I assume that if a payment method previously created for off_session is on the list, i can handle everything else on my server? no need for the client to do any further payment stuff?
and to follow up - when passing the payment_method_id back to our server, is there any variable that indicates whether the method has been configured for future payments? For e.g. - I believe cards registered with apple pay cannot be used for non-subscription recurrent payments, so how would i distinguish that from a card that can?
When accepting the payments via Payment Intent with the integration guide here: https://docs.stripe.com/payments/accept-a-payment?platform=ios , Payment Sheet will list customer's saved payment method
If you process the Payment Intents with saved payment method and off_session: true, it can be done at server end without client side
when passing the payment_method_id back to our server, is there any variable that indicates whether the method has been configured for future payments?
If thecustomeris present in the Payment Method object: https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer, this means that it has been saved onto the customer and can be used for future payment
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Gotcha - but does that also extend to Apple Pay payments?
bc on our dashboard, it explicitly says
This payment successfully set up pm_REDACTED for future off-session payments
but that violates the PassKit rules about non-subscription recurrent payments
Whether the payment methods saved through iOS can be used for recurring payments depends on your business type. I'd recommend checking the guide here: https://docs.stripe.com/apple-pay?platform=ios#using-stripe-and-apple-pay-versus-in-app-purchases
ok really sorry for bugging but i promise 1 last thing ๐ญ
in these 2 cases
how do i know that in the first one, I have to call paymentSheetFlowController.confirm
but in the second one i can just directly hand it back to the server
bc in both cases the paymentSheetFlowController.paymentMethod is configured
If it's paid by card, there is no need to present the UI. Your server can create a Payment Intent to charge to the saved payment method directly
what about the case where a user is given a chance to change their card?
i.e.: In the checkout flow, the default paymentmethod is card A but they have the option to switch to card B - both of which are configured for future off_session payments
where would i display the payment methods?
- Would i use the customer sheet? This seems right, but it says
You can use the Customer Sheet UI outside of a checkout flow- can I also use it during my checkout flow?
https://docs.stripe.com/elements/customer-sheet?platform=ios#ios-get-selected-payment-method
The default payment method on a Stripe customer is only used for invoice payments such as subscription, but not one-time payment using Payment Intent.
i.e.: In the checkout flow, the default paymentmethod is card A but they have the option to switch to card B - both of which are configured for future off_session payments
Is this for one-time or recurring payments using Invoices?
this is for 1-time - when the user processes their second payment, they can choose from the saved paymentmethods or add a new one
i'm talking about the default on-device method noted here https://docs.stripe.com/elements/customer-sheet?platform=ios#ios-get-selected-payment-method
Customer Sheet is used to manage the saved payment methods on the customer, but not for payment.
If you wish to let the user to choose the payment method for Payment Intent, I'd recommend this guide: https://docs.stripe.com/payments/accept-a-payment?platform=ios - customer will choose the saved payment method or create the new payment method to be used for payment
as an example
doordash checkout has the payment method on the bottom
and when i click it
but it's still a separated 2 step confirmation
this but for ios
vs if i use this, i have to use stripe's paymentsheet and complete checkout on stripe's ui, not ours
The payment method list in the screenshot is managed by DoorDash themselves
You'd need to build your own UI to render the payment method list. Once the customer choose the payment method (pm_xxx), you'd then create the Payment Intent with the selected payment method for the payments
This has been outlined in the guide here: https://docs.stripe.com/payments/save-and-reuse?platform=ios&mobile-ui=payment-element#charge-saved-payment-method
- Retrieve the payment method list of this specific customer
- Let customer choose the payment method
- Create the Payment Intent with the saved payment method
This will achieve the same as DoorDash's flow
ah gotcha - we have to build the page ourselves - was trying to do it through stripe
sorry for the relentless questioning - you're awesome @ashen mantle! Have a great night
No problem! Happy to help ๐