I’m trying to create a checkout session using the native stripe plugin that creates a subscription with a 7 day free trial.
I’ve checked out the API docs, and still having a little trouble. How can I add the subscription_data.trial_period_days parameter to the Checkout action?
Bumping this to see if I can get some help
You are trying to add the parameter to the metadata.
If the weweb integration doesn’t have all the options you need you can always use an api request action.
Ahh makes sense. Cool, thanks!
Just be sure to make the actual api call from your backend, then call your backend endpoint from weweb
Why, what’s the difference? I made the Stripe API call via weweb? Is that not a best practice?
Hmmm interesting, so this effectively means that any private API call should be done from the backend for security reasons?
Yes - you should never expose your private keys from Stripe (or any other service) to the front end. Anyone could then pick them up and use them as they see fit. Lots of people have seen lots of bills due to use from malign actors arising from this security hole.
Stripe has two keys you can work with. One is designed to be used from the front end, but is more limited in what it can do for this kind of situation. But most of the time you want to proxy your stripe requests through your backend (e.g. Xano etc).