1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 13:08:17 -05:00

Fix sales tax error if using PayPal or credit (#1524)

Add sales tax information to previewInvoice, which is used to calculate
the amount of the PayPal or account credit charge. Without this, the
charged amount and Stripe subscription amounts are different and throws
an error.
This commit is contained in:
Thomas Rittson 2021-08-19 15:21:06 +10:00 committed by GitHub
parent bbc2483968
commit a735bdd027
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -513,7 +513,8 @@ namespace Bit.Core.Services
var previewInvoice = await invoiceService.UpcomingAsync(new UpcomingInvoiceOptions
{
Customer = customer.Id,
SubscriptionItems = ToInvoiceSubscriptionItemOptions(subCreateOptions.Items)
SubscriptionItems = ToInvoiceSubscriptionItemOptions(subCreateOptions.Items),
SubscriptionDefaultTaxRates = subCreateOptions.DefaultTaxRates,
});
if (previewInvoice.AmountDue > 0)
@ -599,7 +600,8 @@ namespace Bit.Core.Services
var previewInvoice = await invoiceService.UpcomingAsync(new UpcomingInvoiceOptions
{
Customer = customer.Id,
SubscriptionItems = ToInvoiceSubscriptionItemOptions(subCreateOptions.Items)
SubscriptionItems = ToInvoiceSubscriptionItemOptions(subCreateOptions.Items),
SubscriptionDefaultTaxRates = subCreateOptions.DefaultTaxRates,
});
if (previewInvoice.AmountDue > 0)
{