#Shx-checkout

1 messages · Page 1 of 1 (latest)

fair tapir
#

Hello! what's the issue?

split linden
#

basically it generates multiple invoices with amount $0

fair tapir
#

Do you have an example? And can you clarify what behavior you're expecting to happen instead?

split linden
#

I have Screen shot can I share here?

fair tapir
#

As long as there's no PII it's fine

split linden
#

Basically I am using stripe checkout session for subscription, I am simply redirecting users to stripe checkout portal

#

This is the issue I am facing

fair tapir
#

Can you give me one of the invoice IDs so I can take a closer look?

split linden
#

ok

#

in_1KEI9IEgubaVKt5JDYkr4IbG

fair tapir
#

Those $0 invoices are being created as a result of requests that set billing_cycle_anchor: now. This is happening somewhere in your own code, so if you don't want these Invoices you need to pinpoint where those requests are coming from

split linden
#

Ok this is what I got from stripe support but I am not using billing_cycle_anchor any where in my code

#

Basically, I am using stripe example which is in the documentation

fair tapir
#

These server-side requests have to be coming from somewhere, and they are not coming from our internal processes or the dashboard. Are there maybe other places in your code you haven't looked? Do you have any test scripts that could possibly be causing this?

#

I need to head out, but one of my teammates will be hopping in to help

split linden
#

can I share the code that I am using? and there is only one server-side request "create checkout session" which I am using

plush granite
#

Sure you can share that here

split linden
#

This is what I am uisng

#

I am just redirecting users to check out URL

#

Maybe something I am missing

plush granite
#

are you calling subscriptions.update() somewhere?

split linden
#

No this is test code I am using just this one I shared

plush granite
#

There must be other code running somewhere

split linden
#

Oh 🧐

plush granite
#

see the pattern of 9 subscription update requests following each checkout session?

#

I wonder if you have a webhook endpoint doing something you dont expect?

split linden
#

I first realize that may this be because of webhooks but in my webhooks, I am not using stripe again I am just calling my database

#

will see it again without webhooks in separate test server locally

plush granite
#

you can try disabling your test webhook endpoint to see if the behavior stops

#

which would be in indication that it would be a rogue webhook handler you have running somewhere

split linden
#

I want to know another thing, How can I charge Immediately using the stripe billing portal, without proration, I see the document If I use proration_behavior = "none" It will charge after the billing period, and for an immediate charge I need to use "always_invoice" but it will charge a prorated amount

plush granite
#

what are you trying to charge for, whats the scenario?

#

for that scenario it sounds like you might wish to be resetting the billing anchor to reset the billing period (which is what happens in these requests we cant find the source of)

split linden
#

Ok for upgrading I want to charge immediately and for downgrading I want to charge at the end of billing cycle

#

yes want to reset the billing cycle but and want to charge full amount

plush granite
#

It's not possible to configure that set of preferences via the billing portal, you would need to build the upgrade/downgrade logic yourself

#

and handle the two scenarios differently with subscription update requests

split linden
#

Oh ok ok Thank you, means billing portal will always charge prorated amount

#

Thank you for your help and guidence

plush granite