#fallen-upcoming-invoice
1 messages · Page 1 of 1 (latest)
when updating a subscription, i call /invoices/upcoming to preview the charge with this view in my ui, https://p181.p1.n0.cdn.getcloudapp.com/items/12uRlENP/9ffcc229-fbfa-4d1d-a5ae-c6bc8f4da389.jpg?v=6c331fca6b347c9273ced66d67aeb7fa but the response's totals are only the prorated amount i want to also know what the non prorated amount would be monthly in this example?
pictures are really tricky for me when all I care about is exact real code 🙂
are you passing proration_behavior: 'always_invoice'?
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
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
well shart... so i'd need to do two previews one with always invoice true and one with it not?
yep