#ylang-ylang_best-practices
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/1282588906205741067
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
A little more detail on why we want this specific behaviour: We want to ensure our customer performs payment step explicitly while upgrading their plan. Just like they do while opting for new subscription for the first time. Automatic payment attempt while plan upgrades and sending invoices via email would not work for us.
Hi there, so basically you want the subscription to automatically change to a new price from the second month?
Yes
Subscription schedules seem useful but i'm not sure how to use it with checkout sessions
https://docs.stripe.com/billing/subscriptions/subscription-schedules/use-cases#upgrading-subscriptions you can achieve it by using subscription schedules
No, you can't use subscription schedule with checkout session. You need to use subscription schedule API directly
How can i then explicitly take merchant to payment step upon upgrades?
You don't, Stripe will automatically charge the customer, or send them an invoice.
I understand that, but we want to make this step a merchant triggered action. The problem with automatic charges is, we have to handle lot of webhooks for success and also for failure cases, we want to offload it to stripe
We are currently using shopify payments which has explicit upgrade step, and we want to replicate it with stripe
https://docs.stripe.com/billing/collection-method#automatic-charging-versus-manual-payments so these are the two collection methods for invoice. charge_automatically is the default method and it will automtatically charge the customer for renewal. If the payment fails, Stripe will also retry payments
Is there anyway you can provide me with, to make it explicit
Sorry, for repeating myself like a jukebox, but we want a different flow. I have been scrolling through stripe docs since past week and couldn't find a way
Just to clarify, so you want to implment a flow where you customer manually pay the invoices?
Yes, they manually pay not just while subscribing to a recurring plan (which is possible via checkout sesisons) but also while upgrading their current subscription
Sure, then you can set collection_method to send_invoice when creating the subscription schedule https://docs.stripe.com/api/subscriptions/create#create_subscription-collection_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
The best way to learn Stripe products is trying out by yourself. You can use test clocks to simulate time advancement
As per my knowledge send_invoice sends the invoice via mail to the customer, it doesn't redirect them to payment page. Correct me if i'm wrong
The email contains a link for them to visit the hosted invoice page, where they can make the payment
Just to be clear, here's the user journey we want:
- Customer goes to our app billing page (say customer is on $10 recurring subscription plan)
- They click on upgrade link on our billing page to upgrade to $20 plan
- They get redirected to stripe payment page <---- i'm not able to achieve this yet
We don't want customer to check their email and then click on payment link, it's an extra indirection which we want to eliminate.
Edit: Also automatic payments has lot of drawbacks, assume that we are in a domain where fraudulent customers are there so handle failure (like card expired/invalid) on our end is again extra work for us
I'm aware of one way tho: wait for stripe invoice.finalize webhook and then extract invoice link from it and then redirect merchant to it. But like I said we want to rely as little as possible on webhook events, because they are not instantaneous and everything 'extra' we handle at our end increases chances of more bugs
"They get redirected to stripe payment page <---- i'm not able to achieve this yet". can you elaborate more about this? what problem do you face?
Sure, suppose to achieve step 2 ie "They click on upgrade link on our billing page to upgrade to $20 plan"
I use subscription modify api (stripe.Subscription.modify in python) to create a new subscription with subcriptions schedule. Then I don't get any redirect link as a response of stripe.Subscription.modify api so I'm not able to redirect customer directly to stripe payment page
Ok, did you set proration_behavior to always_invoice when you update the subscription?
I tried that but haven't checked the response of stripe.Subscription.modify with it. Will doing that makes stripe.Subscription.modify api return a response?
let me try
So setting proration_behavior to always_invoicetells Stripe to immediately create an inovoice. If the collection_method is send_invoice, Stripe will send the invoice to your customer.
I just checked the response, and i can see invoice id in latest_invoice key. And I suppose I can use it to retrieve whole invoice object and extract payment link from it?
Sure you can do that. As I mentioned earlier, Stripe will also automatically send invoice to your customer if the collection_method is send_invoice