#neha_upcoming-prorationdate

1 messages ¡ Page 1 of 1 (latest)

full pumiceBOT
#

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

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

cunning frigateBOT
#

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.

minor ermine
#

i call it like this:

        subscription: subscriptionId,
        subscription_cancel_now: true,
        // subscription_billing_cycle_anchor: "now",
        // subscription_proration_behavior: "create_prorations",
        // subscription_proration_date: timestamp,
      });
      return invoice;```
cursive ermine
minor ermine
#

its not being returned.

#

The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource.

#

but it is not in the response

#

i can send you the full response if youd like

cursive ermine
#

It's not expected to be returned, it's purely a write parameter.

#

neha_upcoming-prorationdate

minor ermine
#

ok one second

#

nope

#

i tried this

#
      const invoice = await this.stripe.invoices.retrieveUpcoming({
        subscription: subscriptionId,
        subscription_cancel_now: true,
        // subscription_billing_cycle_anchor: "now",
        subscription_proration_behavior: "create_prorations",
        subscription_proration_date: Math.round(new Date().getTime() / 1000),
      });
#

and it's still not being returned

cursive ermine
#

It will never be returned, it's not supposed to ever be returned. It's a parameter. You pass a value to influence how we calculate proration, but it's not returned back.

minor ermine
#

should be the same as the subscription_proration_date returned on the upcoming invoice resource

#

ok the docs are confusing then

cursive ermine
#

ah yeah I don't know what that sentence could mean. I'll flag it internally

minor ermine
#

ok

#

thanks

#

does my code look right?

cursive ermine
#

sure thing, sorry for the confusion

minor ermine
#

for calculating the pro-rated refund based on the time right now

#
        subscription: subscriptionId,
        subscription_cancel_now: true,
        // subscription_billing_cycle_anchor: "now",
        subscription_proration_behavior: "create_prorations",
        subscription_proration_date: Math.round(new Date().getTime() / 1000),
      });```
cursive ermine
#

that seems correct, you can test this end to end in Test mode to confirm

minor ermine
#

it's confusing that i can't get out of a test clock

#

once the customer is in test clock... there's no "stop"

cursive ermine
#

correct, that's expected, it wouldn't make sense to reset the time back to today when you're simulating time that could already be in the future

minor ermine
#

yeah

#

ok one last thing

#

for some reason i can't set prices to be the "Default"

#

i see the default price, but i can't set another one to be the default instead

#

is that a recent change?

minor ermine
#

im trying to do it through the ui

cursive ermine
#

I don't know then, sorry. I focus on helping developers with code here. I'd recommend asking our support team directly about whether this changed: https://support.stripe.com/contact

minor ermine
#
    "subtotal_excluding_tax": -3498,
    "tax": 0,
    "test_clock": null,
    "total": -3498,
    "total_discount_amounts": [],
    "total_excluding_tax": -3498,```
#
        "object": "list",
        "data": [
            {
                "id": "il_tmp_193eb0BZ8IchjqOe4045623f",
                "object": "line_item",
                "amount": -3498,
                "amount_excluding_tax": -3498,```
#

which is the right value to use off the invoice object

#

to show the customer the credit that will be returned

#

i think total? or lineItem.amount?

cursive ermine
#

Try it yourself, do the math, look at the result, and understand wht's happening. Each property on the Invoice means something different and it depends what you want to surface to your end customer

minor ermine
#

ok thanks