#kikko_portal-deeplink

1 messages · Page 1 of 1 (latest)

merry portalBOT
#

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

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

inner jungle
#

Hi there

#

Just so I'm clear, you're creating Portal Sessions with flow_data and including subscription_update in this hash?

#

Do you have an example Customer and Subscription ID?

earnest yacht
#

uuu wait a sec, I think I'm wrong, there is a proration_behavior let me double check

#

this is how I create the configuration:

{
      business_profile: { headline: "XXX" },
      features: {
        payment_method_update: { enabled: true },
        subscription_update: {
          products: [
            {
              product: subscriptonPlan.stripeProductId,
              prices: [subscriptonPlan.stripeProductPriceId],
            },
          ],
          enabled: true,
          default_allowed_updates: ["price"],
          proration_behavior: "create_prorations"
        },
      },
    }

and these the params:

{
  customer: args.customer.id,
  return_url: `${env.FRONTEND_URL}/admin/checkout`,
  configuration: args.configuration.id,
  flow_data: {
    type: "subscription_update_confirm",
    subscription_update_confirm: {
      subscription: args.subscription.id,
      items: [
        {
          id: args.subscription.items.data[0].id,
          price: args.plan.stripeProductPriceId,
          quantity: 1,
        },
      ],
    },
    after_completion: {
      type: "redirect",
      redirect: { return_url: `${env.FRONTEND_URL}/admin` },
    },
  },
}
#

I missed the proration_behavior

inner jungle
#

Ah, I see

earnest yacht
#

I think that initially I didn't set the proration, in my case it seems that proration_behavior: "always_invoice", does what I need, so for example if I buy a subs for 50£ and after 2 weeks I updgrade to a 100£ subs, the user will pay ~(100-50)/2 immediately and 100£ from the next billing cycle

#

thank to share the scheduled options

merry portalBOT
lunar osprey
#

kikko_portal-deeplink

earnest yacht
#

ps. I'd like to thank again Stripe support, I never seen something like you guys are doing, letting a user ask question in a chat and get immediate support, thank you!