#knock2hell_sub-pending-updates

1 messages ยท Page 1 of 1 (latest)

lavish stormBOT
lost hazelBOT
#

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.

lavish stormBOT
#

๐Ÿ‘‹ 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/1244912650828251166

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

soft stream
#

what are the different ways to upgrade subscription

meager copper
#

Hi there, I believe you have already found the doc. Do you have any specific questions that require clarifications?

soft stream
#

can i use checkout for stripe subscription

#

also I want user can manage there subscription but they cannot downgrade there plan

meager copper
#

I think you are talking about billing portal. And yes you can create a billing portal configuration that include a list of products that you customer can update to https://docs.stripe.com/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-products

soft stream
#

what are the different ways to upgrade subscription

meager copper
#
  1. programatically through API
  2. through dashboard
  3. through billing portal
soft stream
#

which method allow user to upgrade only

meager copper
#

I'v already answered this question. Check my previous message

soft stream
#

i cant allow user to acces my dashboard

#

๐Ÿ˜

#

also i tried with api

upgrade_subscription = stripe.Subscription.modify(
                subscription.id,
                items=[{
                    'id': subscription['items']['data'][0].id,
                    'price': price_id,
                }],
                billing_cycle_anchor='now',
                cancel_at_period_end=False,
                proration_behavior='always_invoice',
                expand=['latest_invoice.payment_intent'],
                discounts=[{'promotion_code': coupon_code}] if coupon_code else [],

                payment_behavior='allow_incomplete'
                # allow_incomplete  default_incomplete  pending_if_incomplete error_if_incomplete
            )
            return upgrade_subscription

but this directly upgrade the user, if user fails to pay payment, it goes to past_due but i dont want to upgrade user untill payment success

meager copper
#

Have you checked the billing portal that I shared earlier?

soft stream
#

yes but it dont go with my flow

meager copper
#

Is there a problem with billing portal? What make you think it doesn't work for you?

soft stream
#

from billing portal user can upgrade as well as downgrade plan

meager copper
#

Not true, have you checked the billing portal configuration that I shared earlier?

soft stream
#

yes

meager copper
#

Can you share with me the ID of the billing portal configuration that you created?

soft stream
#

i read the doc only ]

#

๐Ÿ˜…

#

you can chek this

#

bpc_1PDMylSCiougwFxyWNfaB8zf

lavish stormBOT
shell ore
#

Hey! Taking over for my colleague. Let me catch up.

soft stream
#

hi

#

do i need to explain from start

shell ore
#

No, checking your billing portal ...

soft stream
#

upgrade_subscription = stripe.Subscription.modify(
subscription.id,
items=[{
'id': subscription['items']['data'][0].id,
'price': price_id,
}],
billing_cycle_anchor='now',
cancel_at_period_end=False,
proration_behavior='always_invoice',
expand=['latest_invoice.payment_intent'],
discounts=[{'promotion_code': coupon_code}] if coupon_code else [],

            payment_behavior='allow_incomplete'
            # allow_incomplete  default_incomplete  pending_if_incomplete error_if_incomplete
        )
        return upgrade_subscription
#

i want to upgrade a subscription after collecting upgrade payment

shell ore
#

You want to let your customer to upgrade or downgrade their subscirption ?

soft stream
#

only upgrade

shell ore
#

Can you share the failing API request Id of the Subscription update ?

soft stream
#
upgrade_subscription = stripe.Subscription.modify(
                subscription.id,
                items=[{
                    'id': subscription['items']['data'][0].id,
                    'price': price_id,
                }],
                billing_cycle_anchor='now',
                cancel_at_period_end=False,
                proration_behavior='always_invoice',
                expand=['latest_invoice.payment_intent'],
                discounts=[{'promotion_code': coupon_code}] if coupon_code else [],

                payment_behavior='allow_incomplete'
                # allow_incomplete  default_incomplete  pending_if_incomplete error_if_incomplete
            )
            return upgrade_subscription ```
shell ore
#

Yes and what was the result ?

soft stream
#

it upgrade the user

#

but

shell ore
#

Can you share the Subscipriton Id and request ID? and what is the exprected behavior that you didn't observe

soft stream
#

as u can see user is upgraded but the status is past due

shell ore
#

the issue is that the payment method used need to be authenticated (3DS)

#

You need to ask your customer to complete their payment authentication

#

You can check this event evt_1PJY2USCiougwFxybWaC7L6y

soft stream
#

now look at this sub_1PLL4oSCiougwFxy6swXmJM8 subscription

#

or cus_Q9o4ujyrlcBKkR this customer

#

if this customer pay the anount he will upgrade

#

i want to do same thing

#

but with api

#

if this incomplete payment success this user's subscription will upgrade

#

i want to achieve this

#

are you there???

shell ore
#

Yes I'm here

#

For that Subscription, the customer the payment method didn't trigered a 3ds

#

the 3DS auth action has no direct link with the upgrade on the subscription or not

#

You need to adapt your integration to handle this case when it happens

soft stream
#

what is the flow

shell ore
#

You need to ask the customer to complete their 3ds auth action.

#

A payment for an invoice failed. The PaymentIntent status changes to requires_action. The status of the subscription changes to incomplete. If a payment fails, there are several possible actions to take:

Notify the customer.
If youโ€™re using PaymentIntents, collect new payment information and confirm the PaymentIntent.
Update the default payment method on the subscription.
Consider enabling Smart Retries.
https://docs.stripe.com/billing/subscriptions/webhooks#additional-action:~:text=invoice.payment_action_required-,A payment for an invoice failed. The PaymentIntent status changes to,Consider enabling Smart Retries.,-Track active subscriptions

#

In live mode, you can configure Stripe to send automatically emails to your customer in order to complete their payment

soft stream
shell ore
soft stream
#

i want the same flow using api and elemtents

shell ore
soft stream
#

i need the flow to cteate that

shell ore
#

You don't need to create any think

#

You listen to the event invoice.payment_action_required

#

For example evt_1PLL71SCiougwFxyN5F28jSK

soft stream
#

us user pay for that how can i upgrade subscription

shell ore
#

You send them an email for example and ask them to complete authenticate their payment

soft stream
#

can we connect on google meet

#

so i can tell explain you more in detail

#

please

#

I'm stuck in this from last 25 days

shell ore
#

Sorry we don't offer live meetings

soft stream
#

please

shell ore
#

To keep it simple, you can simply collect another payment method for the customer using SetupIntent

#

So that you are safe.

soft stream
#

thanks let me try this

#

dont close this thread

lavish stormBOT
#

knock2hell_update-dpm-sub

soft stream
#

hi i want to know how to upgrade subscription without collecting payment

sick lance
#

you mean immediately?

#

would you mind giving me an example with few words?

soft stream
#

i want to know how to upgrade user subscription with the help of api without charging him

#

for the upgrade

sick lance
#

so let's say your customer has a subscription with a price 10$

#

in mid cycle they asked for an upgrade for the 20$

#

what are you expecting to happen?

soft stream
#

user will upgrade and billing cycle start from now and but we dont collect mony for this month

sick lance
#

then you can add a trial period for the new upgraded price

#

or a 100% discount

#

and use prorations: none so that they don't get back the unused amount from the 10$ price

soft stream
#
                items=[{
                    'id': subscription['items']['data'][0].id,
                    'price': plan['plan_id'],
                }],
                billing_cycle_anchor='now',
                cancel_at_period_end=False,
                proration_behavior='none',
                expand=['latest_invoice.payment_intent'],
                discounts=[{'promotion_code': coupon_code}] if coupon_code else [],
                payment_behavior='allow_incomplete'
            ) 
#

can you help me in this code

#

discounts=[{'promotion_code': coupon_code}] if coupon_code else [],
how to apply 100% discount'

sick lance
#

in this line
discounts=[{'promotion_code': coupon_code}] if coupon_code else [],

#

you can pass the discount

soft stream
#

V5E9B6NA

#

how to apply this

sick lance
#

that's a promotion code right?

soft stream
#

think so

sick lance
#

instead of passing promotion_code you need to replace that with coupon

soft stream
#

i want to upgrade a user so i calculate proration and charge him

#

if he pays then i upgrade the subscription without collecting any upgrade amount

sick lance
#

but why do that?

soft stream
#

if i modify subscription directly and user not able to pay due to xyz reason

sick lance
#

that's what pending updates are for

#

please read through the doc I sent you

soft stream
#

if directly upgrade user

#

with payment past due

sick lance
#

please before we continue this discussion

soft stream
#

i dont want to do that

sick lance
#

go read that doc

#

you're not familiar with that feature and it might do it for you

#

instead of us reinventing the wheel, try to have a go and read it through and if you still think it's not what you need we'll figure something else

soft stream
#

upgrade_subscription = stripe.Subscription.modify(subscription.id,
items=[{
'id': subscription['items']['data'][0].id,
'price': plan['plan_id'],
}],
billing_cycle_anchor='now',
cancel_at_period_end=False,
proration_behavior='none',
expand=['latest_invoice.payment_intent'],
discounts=[{'promotion_code': coupon_code}] if coupon_code else [],
payment_behavior='allow_incomplete'
)

#

this will upgrade the subscription with past_due

sick lance
#

did you read the doc I sent you?

soft stream
#

yes

#

its says i need to manually downgrade user

#

if payment fails

sick lance
#

the upgrade won't happen unless the customer has paid the invoice

#

but if they don't, you can listen to webhooks events and choose when to "cancel" the upgrade request

lavish stormBOT
#

knock2hell_sub-pending-updates