#fallen-upcoming-invoice

1 messages · Page 1 of 1 (latest)

lucid fossilBOT
pseudo burrow
#

fallen-upcoming-invoice

#

Not sure what that means @copper umbra

copper umbra
pseudo burrow
#

pictures are really tricky for me when all I care about is exact real code 🙂

#

are you passing proration_behavior: 'always_invoice'?

copper umbra
#

i am, yes

#
    req, itemParams, err := p.handleUnmarshalingUpdateRequest(c)
    if err != nil {
        p.Log.WithError(err).Error("Error reading request body")
        api.AbortWithErrors(c, http.StatusBadRequest, err)
        return
    }

    upcoming, err := invoice.Upcoming(&stripe.InvoiceUpcomingParams{
        Subscription:                  stripe.String(req.SubscriptionID),
        SubscriptionItems:             itemParams,
        SubscriptionProrationBehavior: stripe.String(string(stripe.SubscriptionSchedulePhaseProrationBehaviorAlwaysInvoice)),
    })
    if err != nil {
        p.Log.WithError(err).Error("Error previewing subscription update")
        api.AbortWithErrors(c, http.StatusInternalServerError, err)
        return
    }
    api.RespondWithData(c, http.StatusOK, upcoming)
}```
#

is the preview update call to your api

pseudo burrow
#

so no that's impossible.

#

when you pass this all you get is the real Invoice as it will be generated with just the proration

copper umbra
#

well shart... so i'd need to do two previews one with always invoice true and one with it not?

pseudo burrow
#

yep