#asif
1 messages ยท Page 1 of 1 (latest)
Hi there
hello
When you create a trialing Subscription you get a pending_setup_intent
You then use that SetupIntent's client secret with confirmSetup()
let me generate a request right now and share it with you
Sure
subscription data:
primary_subscription = stripe.Subscription.create(
customer=customer.third_party_id,
items=stripe_items_to_purchase,
payment_behavior='default_incomplete',
payment_settings={'save_default_payment_method': 'on_subscription'},
expand=['latest_invoice.payment_intent'],
trial_end=billing_anchor,
# billing_cycle_anchor=billing_anchor,
metadata = {"order_id" : order.order_id,
"customer_id" : customer.customer_id}
)
RESPONSE::
Yep so you see the pending_setup_intent in the response?
yes
What you want to do is expand that instead of latest_invoice.payment_intent.
Then take the client_secret from the SetupIntent and send that to your front end
i can see pending_setup_intent as this
"pending_setup_intent":"seti_1Mtt8OGIfc8cX9TotyhOLKjh",
not sure what you mean by expand?
See your code: expand=['latest_invoice.payment_intent'],
yes
That is expanding the Invoice's PaymentIntent
Give a read through https://stripe.com/docs/expand to better understand how expanding works
You want to do the same thing here but with the pending_setup_intent instead
thank you so much, it worked
๐
should have messaged you 48 hours before
We are here 24/5 so pop in if we can ever help!