#Cédric Morelle
1 messages · Page 1 of 1 (latest)
Recommend following this guide https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
You'll need to pass default_incompelte
This step specifically: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#create-subscription
so something like that
payment_behavior: 'default_incomplete',
payment_settings: {save_default_payment_method: 'on_subscription'},
{
customer: customer.id,
items: [
{
price: product.price_id,
},
],
payment_behavior: "default_incomplete",
payment_settings: {
save_default_payment_method: "on_subscription",
},
coupon: params[:coupon_code],
}
)```
ok please I read it but now
I created my subscription
as for exemple
where do I get my client_secret key ?
subscription.latest_invoice.payment_intent.client_secret is empty
does not exists
You need to retrieve the invoice
see it's an id in the above object
Also read the doc I sent
It explains you need to use expansion for it to show
expand=['latest_invoice.payment_intent'],
If you don't want to retrieve the invoice
not well documented but I appreciate much your great knowledges !