#Matt11-payments

1 messages · Page 1 of 1 (latest)

drowsy tendon
#

Hi! So your question is how to accept one time payments with Stripe? How are you currently creating the subscriptions?

leaden ember
#

I create them via APIs

#

with Ruby gems

drowsy tendon
#

And then how do you collect payment details? With Payment Elements?

leaden ember
#

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?

drowsy tendon
#

Oh, so you still want to charge your customer at a regular interval, but you want to stop using Stripe subscriptions?

leaden ember
#

exactly

drowsy tendon
#

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.
leaden ember
#

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?

drowsy tendon
#

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.

leaden ember
#

I mean what kind of objects I need to create. Session, payment intent, setup intent, etc

drowsy tendon
#

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.

leaden ember
#

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.

drowsy tendon
leaden ember
#

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?

drowsy tendon
#

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.

leaden ember
#

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

spark tree
#

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 the customer parameter on PI creation. This will save the PM to the customer for future usage

leaden ember
#

and after the payment intent creation, do i need to do something? like calling the pay method

spark tree