#iamajoe_api

1 messages ¡ Page 1 of 1 (latest)

worn grailBOT
#

👋 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/1360259687362072628

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

tranquil vortex
white vale
#

even though it does work, it schedules as a downgrade. when you set into the upgrade path the scheduled it changes straight away

#

so i want to treat this as an upgrade. i did set a product for monthly and other for yearly. shouldnt I? isnt this the right approach?

tranquil vortex
#

I do not undertsand what you mean by 'schedules as a downgrade.'? That is the right approach, yes

#

Can you reword this please?

#

The term 'downgrade' and 'upgrade' means if the proce is lower or higher than the initial price

white vale
#

ok ok so... i have the same plan, on my application. they have both monthly and yearly

#

the yearly is a discount overall on monthly

#

when you go to billing portal and you change to yearly, the yearly value is discounted if we take the monthly * 12

#

now, stripe doesnt see this as an upgrade from what i understand probably because it checks the price * 12 of the monthly and sees it is less expensive than the yearly

#

so... it schedules for next billing period

#

but from the application standpoint, the user moved from the same plan on monthly to yearly

#

so from the application standpoint, it is an upgrade

tranquil vortex
white vale
#

no no that is not the issue

#

i want to move to the "new plan" right now

#

i want to have the control for the user to pay through billing portal and since it is an upgrade (in terms of time), i want the user to be on that plan right now

#

so... i can do that if i can sort the products upgrade path but i cant find that on stripe api?!

tranquil vortex
white vale
#

ok. give me a second so i can redo the test. it takes a few minutes

#

almost almost...

#

req_r3FRHW4JqjRha9

#

so started even from scratch. from 1 plan to the other the upgrade happened and it was applied straight away, upgrade then to the yearly plan set the product on a schedule and didnt upgrade straight away

tranquil vortex
#

It looks like yous set schedule_at_period_end.conditions on bpc_1R3wTqBcNqF80vqKN97ZWFjk

#

That dicates this: 'List of conditions. When any condition is true, the update will be scheduled at the end of the current period.'

white vale
#

interesting...

#

because as per the request i didnt set it

#

maybe there is a way to force not to set it?!

#
  const session = await client.billingPortal.sessions.create({
    customer: customerId,
    // eslint-disable-next-line camelcase
    return_url: baseUrl,
    // eslint-disable-next-line camelcase
    flow_data: {
      // eslint-disable-next-line camelcase
      after_completion: {
        type: 'redirect',
        // eslint-disable-next-line camelcase
        redirect: {
          // eslint-disable-next-line camelcase
          return_url: successUrl,
        },
      },

      type: 'subscription_update_confirm',
      // eslint-disable-next-line camelcase
      subscription_update_confirm: {
        subscription: currentPlan.stripeSubId,
        discounts: [],
        items: [
          {
            id: currentPlan.stripeSubItemId,
            price: productPrice.id,
            quantity: 1,
          },
        ],
      },
    },
  });

this i smy code so... not willingly setting it

tranquil vortex
#

You can pass another config. when you make the request, or else it will use the default one

white vale
#

interesting. ok i think that is what i want to do

#

that way i can force stripe api. i think what happens is that stripe sees as a downgrade and on that i have a global config that does indeed wait for the end

#

so it is a matter of configuration bpc

tranquil vortex
#

Can you try another configuration without those conditions and try the flow again?

white vale
#

i will try. not today though because im swamped but thanks for the help. at least now i have a light on the end of the tunnel