#kostas-sioupoulis_best-practices

1 messages ¡ Page 1 of 1 (latest)

balmy lindenBOT
#

👋 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. Thank you for your patience!

⏱️ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.

🔗 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/1214901287326318592

📝 Have more to share? You can add more detail below, including code, screenshots, videos, etc.

acoustic daggerBOT
#

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.

echo shuttle
acoustic daggerBOT
errant epoch
#

hi! answered you in the other thread. It does already, what am I missing?

echo shuttle
#

Hello sorry, I mean here if is possible to show the description of the product the subscription has.

#

Only if he can Update his plan though?

#

Because we don't the user to be able to change his plan because each customer has a different product because the price depends on various parameters from our eshop.

errant epoch
#

not sure what you mean, can you show me what exactly you want to be different?

echo shuttle
#

in the screenshot I sent

#

I would like the customer to be able to see the description of the product that is attached to the subscription without being able to change his plan through the customer portal

#

If that is possible of course

errant epoch
#

makes sense. But yeah not possible, this is not customisable today, but it's a sensible feature request

echo shuttle
#

Okay thank you very much!

errant epoch
#

apparently that field will appear in the portal

echo shuttle
#

Okay perfect thank you very much that is very useful!

#

How do I pass it in the subscription.modify? Because right now it returns this:

#

is this correct? subscription = stripe.Subscription.modify(
stripe_subscription.subscription_id,
payment_behavior = 'pending_if_incomplete',
items=[{
'id': subscription['items']['data'][0].id,
'price': stripe_price.id,
}],
proration_behavior='always_invoice',
proration_date=request.session['proration_date'],
metadata={"description": description},

        )
#

or this? subscription = stripe.Subscription.modify(
stripe_subscription.subscription_id,
payment_behavior = 'pending_if_incomplete',
items=[{
'id': subscription['items']['data'][0].id,
'price': stripe_price.id,
}],
proration_behavior='always_invoice',
description= description
)

slate horizon
#

What are you trying to achieve exactly?

echo shuttle
#

to update the subscription description

slate horizon
#

Why do you provide all the other fields?

slate horizon
echo shuttle
#

I gues you can't update the description when pending_if_incomplete

slate horizon
#

Yes, you will need to update it in a separate call.

echo shuttle
#

Okay thank you!

#

can I add the subscription description during the checkout?

#

price = stripe.Price.create(
unit_amount=int(total_amount * 100),
currency=request.user.currency,
recurring={'interval': 'month'},
product=product.id,
)

checkout_session = stripe.checkout.Session.create(
    mode="subscription",
    line_items=[{"price": price.id, "quantity": 1}],
    ui_mode="embedded",
    payment_method_types=[
        'card',
    ],
    return_url=f"http://localhost:{port}/store/checkout/return?session_id={{CHECKOUT_SESSION_ID}}",
    customer=request.user.stripe_customer_id,
)
slate horizon
#

I would suggest listening to subscription.created webhook event and updating it in the handler. I don't think you can pass the Subscription.description via Checkout Session.

slate horizon