#TomPham

1 messages · Page 1 of 1 (latest)

exotic cape
wanton galleon
#

I use the script code of stripe checkout button

exotic cape
#

there's really only 3 options : payment, subscription or setup - can you check your code and let me know which is it?

wanton galleon
#

And render the total amount to charge from creating a price id

#

It is payment

#

But the price id that the client pay is set up as interval "month". As I understand it is like subscription because it will charge again for the month after, will it?

exotic cape
#

You will not be able to create a Checkout Session using payment mode, with a Price that has an interval "month"

#

it will return an error

wanton galleon
#

At start I create a price to send the price id to the front end

#

And in front end it receive the price Id to charge the amount that I set up

#

I did like this and it succeeded

exotic cape
#

your mode is "subscription" in your code

#

not payment

#

so it's essentially creating a subscription

wanton galleon
#

Could you give me an example?

#

How can I render a subscribe button in front end then?

#

And what do I have to do in order to stop subscription of a client?

wanton galleon
#

But It really works, as you can see below

#

What I created and when the client paid it goes inside the subscription. That's why I believe I made it as a subscription

#

And if it was already a subscription, how can I cancel this subscription when client chose to cancel payment? (Since I do not have subscription id cos it was redirect to create a subscription from frontend). I only thing I have is price ID, can I update {active: false} to ensure the subscription of client for this price is canceled?

exotic cape
#

@wanton galleon because the Checkout mode is subscription, Stripe will automatically create the subscription

wanton galleon
#

And what will happen if I set the field "active" of price as "false"?

exotic cape
#

setting Price active=false would only prevent new Subscription creation using that Price. It won't cancel payments of existing subscriptions

wanton galleon
#

Thank you for the information