#ylang-ylang_best-practices

1 messages ¡ Page 1 of 1 (latest)

molten depotBOT
#

👋 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.

open tendon
#

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.

lavish valve
#

Hi there, so basically you want the subscription to automatically change to a new price from the second month?

open tendon
#

Yes

#

Subscription schedules seem useful but i'm not sure how to use it with checkout sessions

lavish valve
#

No, you can't use subscription schedule with checkout session. You need to use subscription schedule API directly

open tendon
#

How can i then explicitly take merchant to payment step upon upgrades?

lavish valve
#

You don't, Stripe will automatically charge the customer, or send them an invoice.

open tendon
#

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

lavish valve
open tendon
#

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

lavish valve
#

Just to clarify, so you want to implment a flow where you customer manually pay the invoices?

open tendon
#

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

lavish valve
#

The best way to learn Stripe products is trying out by yourself. You can use test clocks to simulate time advancement

open tendon
#

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

lavish valve
#

The email contains a link for them to visit the hosted invoice page, where they can make the payment

open tendon
#

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

lavish valve
#

"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?

open tendon
#

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

lavish valve
#

Ok, did you set proration_behavior to always_invoice when you update the subscription?

open tendon
#

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

lavish valve
#

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.

open tendon
#

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?

lavish valve
#

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

open tendon
#

Got it, thanks a bunch for your help!

#

Really appreciate that :)