#knock2hell_code
1 messages ยท Page 1 of 1 (latest)
๐ 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.
What's the subscription ID?
sub_1PL95zSCiougwFxyIg7Du51s
https://dashboard.stripe.com/test/events/evt_1PL9spSCiougwFxySy3KytYo the latest invoice is in requires_action state, you need to bring your customer back to your website and start 3DS authentication.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I also noticed that your account is based in India. You'd like to go through this doc to learn more about recurring payments in India https://docs.stripe.com/india-recurring-payments
i created subscription from free to basic
I'm using api for upgradation by following the below doc
https://docs.stripe.com/billing/subscriptions/upgrade-downgrade
but it upgrade the user without payment (payment is in past_due)
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.
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
https://docs.stripe.com/billing/subscriptions/webhooks you can read this doc to understand subscription related events
https://docs.stripe.com/payments/paymentintents/lifecycle and this doc to understand the paymentIntent lifecycle
i can achieve what i want by using this
I want to do the same thing with api \
๐ฆ
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.
Now you are making the changes from your backend, so you need to bring your customer to back to your website in order to star the 3DS flow. you can learn more about 3DS here https://docs.stripe.com/payments/3d-secure/authentication-flow
can I create a invoice for a subscription with proration amount
so if user pays the amount , i will upgrade the user
You can, but it doesn't solve the problem here.
The payment will likely become requires_action, and you still need to handle 3DS
if i do that i can get the pi and client secret and i will use elements to pay
Yes you can do that.
can you help me with the flow
https://docs.stripe.com/payments/3d-secure/authentication-flow this doc already explains the details. Basically you just need to call stripe.confirmCardPayment() to start the 3DS flow.
You don't even need to integrate elements unless you want your customer to use a different payment method.
https://docs.stripe.com/api/invoices/object#invoice_object-hosted_invoice_url Alternatively you can also send the hosted invoice url to your customer and they can make payment there.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
can you tell me how can i create payment intent like this pi_3PLIS6SCiougwFxy0clsinB3 so when this is successful user will automatically upgrade
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
but if user pay for created payemt intent he is still not upgrade
I don't quite understand, can you elaborate?
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
I still struggle to understand you.
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