#sanket8360

1 messages · Page 1 of 1 (latest)

frail hareBOT
quartz heart
#

Hi there

#

We can't re-open threads but if you summarize your issue here then I'd be happy to help

orchid arch
#

Hi Bismarck nice to see you again.

#

Yesterday we talked to you about hourly subscriptions.

#

And I am trying all the links you provided.

#

But I don't know how I can checkout the product with default payment methods or new payment methods.

#

?

quartz heart
#

Hey!

#

Can you explain a little bit more what you mean by "how I can checkout the product with default payment methods or new payment methods."?

orchid arch
#

Sure.

#

I want to subscribe hourly but stripe doesn't offer hourly subscription. So I am going to make this one time payment.

But I have more plans like monthly and yearly intervals. For that plan I use Stripe subscription methods.

So how can I implement one-time checkout with default payment methods?

quartz heart
#

Gotcha gotcha

#

So with one-time payments you don't use default payment methods

#

You have to pass the actual PaymentMethod ID to the payment_method parameter of the PaymentIntent

orchid arch
#

Here is my UI for both subscription and one-time.

quartz heart
#

So you want to retrieve the PaymentMethod ID associated with the "saved card" that you have selected.

#

Then pass that PaymentMethod ID to the PaymentIntent when you create/confirm it

orchid arch
#

But

#

How do I pass payment intent here?

quartz heart
orchid arch
#

Done

#

Then what next?

#

?

quartz heart
#

So when you do that you also pass the PaymentMethod ID to payment_method and pass confirm: true

orchid arch
#

Ok then next?

quartz heart
#

Well that should create a Charge

orchid arch
#

?

quartz heart
#

Neither

#

The PaymentIntent creates the one-time payment

#

Did you test it out?

orchid arch
#

Yes

quartz heart
#

If you created/confirmed the PaymentIntent then you should see a charge

#

Can you give me the example PaymentIntent ID?

orchid arch
#

Sure

#

GIve me a min.

#

Without Payment Method: pi_3NSi1OID8KX4Fnem1a54EKjw

With payment Methods:
pi_3NSi5vID8KX4Fnem0eJ5P2iK

quartz heart
#

Yep cool so there is a Charge associated with pi_3NSi5vID8KX4Fnem0eJ5P2iK

#

So that one was successful

orchid arch
#

Ohhh Ok

#

So our payment is successful right?

#

And how do we get payment confirmation in the system?

#

And how to add expiration time in PaymentIntent?

quartz heart
#

You listen for payment_intent.succeeded to ingest data to your database.

#

Not sure exactly what you mean by "expiration time"

#

But you can add any metadata you want to the PaymentIntent

#

This will then come through the webhook as well

#

And you can ingest it to your database

orchid arch
#

Ok I understand

#

Thanks for your help.