#knock2hell_code

1 messages ยท Page 1 of 1 (latest)

whole lintelBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1244873700449456159

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

gleaming hill
#

What's the subscription ID?

naive path
#

sub_1PL95zSCiougwFxyIg7Du51s

gleaming hill
naive path
#

i created subscription from free to basic

#

but it upgrade the user without payment (payment is in past_due)

gleaming hill
#

As I explained before, the payment didn't succeeded because its status becomes requires_action, which means it needs customer's authentication to confirm the payment.

naive path
#

i don't want to do that, I want user will only upgrade if he pays the amount(calculated using proration)

#

can you explain these events

gleaming hill
naive path
#

i can achieve what i want by using this

#

I want to do the same thing with api \

#

๐Ÿ˜ฆ

gleaming hill
#

It's the same thing. The customer is on-session when they make changes through billing portal, so billing portal is able to start the 3DS flow when needed.

naive path
#

can I create a invoice for a subscription with proration amount

#

so if user pays the amount , i will upgrade the user

gleaming hill
#

You can, but it doesn't solve the problem here.

#

The payment will likely become requires_action, and you still need to handle 3DS

naive path
#

if i do that i can get the pi and client secret and i will use elements to pay

gleaming hill
#

Yes you can do that.

naive path
#

can you help me with the flow

gleaming hill
#

You don't even need to integrate elements unless you want your customer to use a different payment method.

naive path
#

can you tell me how can i create payment intent like this pi_3PLIS6SCiougwFxy0clsinB3 so when this is successful user will automatically upgrade

gleaming hill
#

You don't need to, when you update the subscription and set proration_behavior to always_invoice, Stripe billing will create an invoice, and you can get the payment_intent from that invoice.

#

If you want to explicitly create a paymentIntent, then you need to calculate the proratoin amount by yourself, and create a paymentIntent by using the paymentIntents API

naive path
#

but if user pay for created payemt intent he is still not upgrade

gleaming hill
#

I don't quite understand, can you elaborate?

naive path
#

can you see the difference between pi_3PLIfnSCiougwFxy0r84V18Y and pi_3PLIS6SCiougwFxy0clsinB3

#

if pi_3PLIS6SCiougwFxy0clsinB3 succeed it will upgrade the user but not this pi_3PLIfnSCiougwFxy0r84V18Y

gleaming hill
#

I still struggle to understand you.

naive path
#

ok let me start from the beginning

I want to create code for a subscription upgrade and I followed this doc https://docs.stripe.com/billing/subscriptions/upgrade-downgrade but the issue is user will upgrade without paying the amount(pending amount is calculated by upcoming invoice / proration )

#

I dont want that kind of upgade

#

what i want is, User will only upgrade if he pays the amount

#

so how can I achieve this