#Jenya - Subscription Creation

1 messages · Page 1 of 1 (latest)

dark remnant
#

Hello. Let's chat in this thread

#

Give me just a moment to catch up

#

So that api call looks like it's a subscription update call

#

You say you're creating a subscription like that?

#

I think you may have just shared the wrong code snippet

wind bison
#

Sorry, not creating subscription

#

When upgrading

#

I have existing subscription and updating the items

dark remnant
#

Ah got it

#

Can you share a request ID for the update call where you aren't seeing an invoice being created?

wind bison
#

It is being created

#

Just auto paid

#

I need to somehow retrieve it and redirect the user to it

#

But the update doesn't return it

dark remnant
wind bison
#

@dark remnant That upgrades automatically

#

Invoice isn't auto paid which is good

#

But user get's upgraded before invoice is even paid

dark remnant
wind bison
#

I need it to not be enabled until paid

#

That's what the pending_until_complete was doing

#

Maybe I can just get the invoice and redirect user to it?

#

Or remove the payment method, so that it doesn't auto charge

dark remnant
#

Can you send your whole request?

#

What are all the parameters you're passing in?

wind bison
#

It's just two items below that

#
const sub = await stripe.subscriptions.update(subscriptions.data[0].id, {
                        payment_behavior: 'pending_if_incomplete',
                        proration_behavior: 'always_invoice',
                        items: [
                            {
                                id: subscriptions.data[0].items.data[0].id,
                                price: priceIds[0].price,
                                quantity: priceIds[0].quantity
                            },
                            {
                                id: subscriptions.data[0].items.data[1].id,
                                price: priceIds[1].price,
                                quantity: priceIds[1].quantity
                            }
                        ]
                    });
smoky maple
#

catching up here give me a sec.

Just to word the question back - you want to upgrade the user but wait for it to be paid in full? is that right?

why do you want to bring the customer back on session though, you already have their cards attached to the customer so they don't need to come back online

wind bison
#

Maybe they want to use another card or something

#

Like they click a button to upgrade

#

And it needs to redirect to some sort of payment page you know

#

I do that for initially buying a plan

#

But from what I've seen I can't use checkout session for upgrading, only creating new subscription