#Matt11-payments
1 messages · Page 1 of 1 (latest)
Hi! So your question is how to accept one time payments with Stripe? How are you currently creating the subscriptions?
And then how do you collect payment details? With Payment Elements?
yes I have the elements JS in my checkout page
and I create a customer via APIs with the stripeToken
so my idea is to:
1- create a customer + his payment method
2- create a one-shot payment
3- handle the renewal logica in my app
4- if the customer wants to renew the subscription create another one-shot payment
is it possible?
Oh, so you still want to charge your customer at a regular interval, but you want to stop using Stripe subscriptions?
exactly
Yes, what you described is possible! You just need to make sure that:
- The first time a customer makes a payment, save the payment method for future usage
- When you do an off session payment, it's possible that the payment will fail. So you will need to handle these case yourself.
yes of course. I will use stripe webhook for that
Can you help me figure out what steps I need to do to fulfill this request?
what steps I need to do to fulfill this request?
What do you mean? The steps you mentioned above look correct to me. However note that handling payment failure and retry is tricky, that's why we recommend to use Stripe Subscription since they will handle all of that complexity for you.
I mean what kind of objects I need to create. Session, payment intent, setup intent, etc
The simplest way to collect payment details is with Checkout Sessions, and then you could reuse the payment method created by Checkout to create off session PaymentIntents.
but do I need a price on Stripe? is it possible to charge the customer directly with an amount?
I would like to avoid to have an hardcoded data inside the code or to copy stripe IDs inside my database.
With Checkout Session, you can either pass a price ID, or hard code the price in line_items.price_data https://stripe.com/docs/api/checkout/sessions/create?lang=dotnet#create_checkout_session-line_items-price_data
ok nice, but with checkout session the customer will be redirected outside my platform isn't he? there's a way to collect data using elements and create a one-time payment staying inside my app?
That's correct, you don't have to use Checkout Sessions. You could create a PaymentIntent (with setup_future_usage) and then collect payment details with the Payment Element.
Do I need to create a customer with the stripe token (so it attach the payment method) before or after the payment intent?
I don't understand the steps that I need to take
I receive the stripeToken from my form, so I think that the first thing that I need to do is to create a Customer + payment method
Hey, taking over from @drowsy tendon – let me catch-up!
Do I need to create a customer with the stripe token (so it attach the payment method) before or after the payment intent?
You'd create the customer before the Payment Intent so it can be passed to thecustomerparameter on PI creation. This will save the PM to the customer for future usage
and after the payment intent creation, do i need to do something? like calling the pay method
Generally you'd need to confirm the PI, attaching the payment method in the process: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment