#learner-intents
1 messages · Page 1 of 1 (latest)
Hi there 👋
So a bit of clarification on the beginning. Setup Intents are a way to save payment information without charging it at the same time. When it comes times to charge that payment method then that flow would still use a Payment Intent.
Payment Intents are currently the best and recommended route for charging payment methods.
The client-side piece of the flow is for collecting the user's payment information, and is done this way so that information only hits Stripe servers, which means only Stripe has to be PCI compliant (you don't :D).
You can create a payment intent and complete the entire flow server-side as long as you already have the payment method available in Stripe.
My problem statement: I want user to enter to credit card details for a subscription, charge the customer server side after 15 minutes for the very first subscription payment and then charge automatically when the subscription period expires
So a bit of clarification on the beginning. Setup Intents are a way to save payment information without charging it at the same time. When it comes times to charge that payment method then that flow would still use a Payment Intent.
is there a Demo example for same which completes this process? I sawhttps://github.com/stripe-samples/nextjs-typescript-react-stripe-jsdonate-with-elementsexample which I believe uses 1 above
@honest prawn if 1 supports ability to charge customer for first time from server side after 15 minutes, and also gives option to charge after subscription period expires, it is good for my use case, else would please suggest which would be the one
Will you already have the customer's payment information, or will you need to collect it (for the first payment)?
Will need to collect first time
Gotcha, so you will need a client/server approach for that then.
If you're looking to build your own flow/customer experience then you can use this guide to see how to collect payment info, charge that, and be able to charge it again in the future.
https://stripe.com/docs/payments/save-during-payment?platform=web
If you'd rather use our pre-built checkout page then this doc walks through how to build that integration:
https://stripe.com/docs/billing/quickstart
@honest prawn This will charge the customer right away the first time?
//`Elements` instance that was used to create the Payment Element
elements,
confirmParams: {
return_url: 'https://my-site.com/order/123/complete',
},
});```?
I want to collect the Payment information the first time, but charge them after 15 minutes from server side (strange business requirements)
Yup, that confirmation step is what triggers the payment. If you want to delay payment then you can delay calling that confirm function.
https://stripe.com/docs/api/payment_intents/confirm
Is it alright to put a hold for the amount on the payment method and then collect it after 15 minutes? If so you can look at this flow:
https://stripe.com/docs/payments/capture-later
If not, you should be wary that the payment intent may go into a requires_action status when you confirm it if the issuer requires additional authentication. If this happens you'd need to bring your customer back on-session to complete that authentication. This is more applicable to transactions that take place in Europe.
In my case, all customer all US based where we don't have 3DS as of now. So requires_action is covered
For https://stripe.com/docs/payments/capture-later, we would still need to save the payment method using Setup intent API ?
Like
- Setup Payment Intent
- Save Credit Card
- Initiate the
capture-payment-laterflow to block funds from user - Charge the customer after 15 minutes the first time
- Use card on file for future payments ?
Without Setup Payment Intent flow this is not possible?
There are two different ways to save payment methods, you can either do it while making a payment, or do it prior to making a payment.
This doc discusses saving while making a payment. The key step here is setting setup_future_usage to true on the payment intent:
https://stripe.com/docs/payments/save-during-payment
Setup intents are most useful when you're just trying to collect payment information with the intention of charging it later:
https://stripe.com/docs/payments/save-and-reuse
is there a performance benefit between two approaches?
no