16
Views
1
Comments
Cancel Stripe Subscription
Question

Hi everyone,

I have to cancel stripe subscription based on certain criteria. I need a little detailed solution on how exactly it can be done.

2025-01-09 14-56-57
IQ78

hi,

here the url:

https://docs.stripe.com/payments/checkout/free-trials

My 2 cents:

1. after u successfully create the REST API to consume (put the parameter in url form encoded in the request box:

stripe...?...&subscription_data[trial_settings][end_behavior][missing_payment_method]=cancel

2.  create an input parameter for that subscription_data_trial_settings__end_behavior__missing_payment_method_ , remember the request name put verbatimly: subscription_data[trial_settings][end_behavior][missing_payment_method] 

3. Now wrap the REST API in a server action with the same input and there u can do the logic whether to assign it to cancel or other

4. Otherwise u can put another REST api that has no that request parameter subscription_data[trial_settings][end_behavior][missing_payment_method]. 

5. So the logic if cancel then call the rest that has parameter subscription_data[trial_settings][end_behavior][missing_payment_method] else  call the rest that without parameter subscription_data[trial_settings][end_behavior][missing_payment_method]


may this helps

regards 


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.