#ylang-ylang_code

1 messages ¡ Page 1 of 1 (latest)

tribal bloomBOT
#

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

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

mint ermine
#

What do you mean by "manual proration " ?

trim lion
#

Also I just realised there's an error in the code sample i gave above, amount in invoice_items should be -ve for manual proration to work. Here's the updated code

def upgrade_subscription():
    ...
    resp = stripe.Subscription.modify(
        subscription_id,
        items=[
            ...
        ],
        proration_behavior='none',
        payment_behavior='pending_if_incomplete',
        add_invoice_items=[
            {
                'price_data': {
                    'currency': 'usd',
                    'product': product_id,
                    'unit_amount': -500,
                }
            }
        ],
    )
mint ermine
trim lion
#

Yes, I've tried it. As mentioned in the code posted above

mint ermine
#

What's the subscription ID?

trim lion
#

I've finished the test clock a while ago, let me recreate it

#

Here's the subscription id sub_1PxNfzHxoLyKoVBRzaTODeLG

#

Description of invoices:

2nd invoice generated and paid automatically for oct month
3rd invoice generated after upgrading plan to $38 plan (manually computed prorate charge was $19)
mint ermine
#

Isn't the 3rd invoice paid successfully?

trim lion
#

Yes I manually confirmed the payment. My issue is, up until I don't pay the invoice, I do not want subscription to update, right now subscription automatically updates to new plan price

mint ermine
#

No, that invoice was paid automatically. I don't see any request to pay this invoice manually.

trim lion
#

I did pay it manually

mint ermine
#

What's the ID of the invoice that you are looking at?

trim lion
#

Id is in_1PxNlBHxoLyKoVBRasrpCr6L
Also, here's how i created invoice after subscription update

        invoice = stripe.Invoice.create(
            auto_advance=True,
            subscription=subscription_id,
            collection_method='send_invoice',
            customer=customer_id,
            description='Pending upgrade charge',
            days_until_due=1,
        )
mint ermine
#

No, that's not the invoice created by the subscription, it's the invoice created by yourself.

#

That's not how pending updates work.

trim lion
#

So coming back to my question, how to use pending_if_incomplete payment_behavior with manual proration?

mint ermine
#

Hmm? I though you already did it ? no?