#asif

1 messages ยท Page 1 of 1 (latest)

pine lilyBOT
rotund birch
#

Hi there

native vigil
#

hello

rotund birch
#

When you create a trialing Subscription you get a pending_setup_intent

#

You then use that SetupIntent's client secret with confirmSetup()

native vigil
#

let me generate a request right now and share it with you

rotund birch
#

Sure

native vigil
#

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}

    )
rotund birch
#

Yep so you see the pending_setup_intent in the response?

native vigil
#

yes

rotund birch
#

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

native vigil
#

i can see pending_setup_intent as this

"pending_setup_intent":"seti_1Mtt8OGIfc8cX9TotyhOLKjh",

rotund birch
#

Right

#

So change your code to expand: ['pending_setup_intent']

native vigil
#

not sure what you mean by expand?

rotund birch
#

See your code: expand=['latest_invoice.payment_intent'],

native vigil
#

yes

rotund birch
#

That is expanding the Invoice's PaymentIntent

#

You want to do the same thing here but with the pending_setup_intent instead

native vigil
#

ok

#

let me try this

native vigil
#

thank you so much, it worked

rotund birch
#

๐ŸŽ‰

native vigil
#

should have messaged you 48 hours before

rotund birch
#

We are here 24/5 so pop in if we can ever help!