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.
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