#surajpatidar

1 messages · Page 1 of 1 (latest)

half sentinelBOT
summer sable
#

I don't understanding. What do you mean by 'change time'?

toxic compass
#

i want to work on subscription upgrade and downgrade okay

#

so i want like that if subscription upgrade Immediate but when user downgrade subscription effect after end of the subscription

#

it possible to stripe subscription upgrade immediately but downgrade end of the date

summer sable
toxic compass
#

but how to i know this subscription downgreade or not

half sentinelBOT
brazen axle
#

Hi! I'm taking over this thread.

#

You write the code to upgrade/downgrade the subscription, so you should know if it's an upgrade or downgrade.

toxic compass
#

i have write this code for upgrade and down grade

                subscription.id,
                cancel_at_period_end=False,
                proration_behavior="always_invoice",
                items=[
                    {
                        "id": subscription["items"]["data"][0].id,
                        "price": price_id,
                    }
                ],
            )```
#

can it possible to create user request downgreade but plan chnage after and of the priod

brazen axle
toxic compass
#

okay but i have confuse

#
  customer='cus_GBXV9Q95NFT80k',
  start_date='now',
  end_behavior='release',
  phases=[
    {
      'items': [
        {'price': '{{PRICE_DIGITAL}}', 'quantity': 1},
        {'price': '{{PRICE_PRINT}}', 'quantity': 1},
      ],
      'iterations': 1,
    },
    {
      'items': [
        {'price': '{{PRICE_PRINT}}', 'quantity': 1},
      ],
      'iterations': 11,
    },
  ],
)```
i can't unserstand this
brazen axle
toxic compass
#

how it possible to upgrade or downgrade in simple way

brazen axle
#

With stripe.Subscription.modify(...), but the upgrade/download will happen immediately.

toxic compass
#

it possible to if upgrade with using .Modify but it downgrade with stripe Shedule

brazen axle
#

Yes, that's completely up to you.

toxic compass
#

how to use this attr proration_behavior

#

can work with for upgrade or down grade

brazen axle
#

I don't understand your question. What exactly are you trying to do?

toxic compass
#

can i us this for upgrade ```subscription = subscription.modify(
cancel_at_period_end=False,
proration_behavior='always_invoice',
items=[{
'id': subscription['items']['data'][0].id,
'plan': new_plan_id,
}]
)

#

and this for downgrade

        cancel_at_period_end=True,
        items=[{
            'id': subscription['items']['data'][0].id,
            'plan': new_plan_id,
        }]
    )```