mirror of
https://github.com/bitwarden/server.git
synced 2024-11-24 12:35:25 +01:00
add
This commit is contained in:
parent
ae82074dcb
commit
58cf8b183c
@ -74,16 +74,23 @@ public class StripeController(
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var taxCalculation = await stripeAdapter.CalculateTaxAsync(options);
|
try
|
||||||
var response = new CalculateTaxResponseModel
|
|
||||||
{
|
{
|
||||||
SalesTaxRate = taxCalculation.TaxBreakdown.Any()
|
var taxCalculation = await stripeAdapter.CalculateTaxAsync(options);
|
||||||
? decimal.Parse(taxCalculation.TaxBreakdown.Single().TaxRateDetails.PercentageDecimal) / 100
|
var response = new CalculateTaxResponseModel
|
||||||
: 0,
|
{
|
||||||
SalesTaxAmount = Convert.ToDecimal(taxCalculation.TaxAmountExclusive) / 100,
|
SalesTaxRate = taxCalculation.TaxBreakdown.Any()
|
||||||
TaxableAmount = Convert.ToDecimal(requestBody.Amount),
|
? decimal.Parse(taxCalculation.TaxBreakdown.Single().TaxRateDetails.PercentageDecimal) / 100
|
||||||
TotalAmount = Convert.ToDecimal(taxCalculation.AmountTotal) / 100,
|
: 0,
|
||||||
};
|
SalesTaxAmount = Convert.ToDecimal(taxCalculation.TaxAmountExclusive) / 100,
|
||||||
return TypedResults.Ok(response);
|
TaxableAmount = Convert.ToDecimal(requestBody.Amount),
|
||||||
|
TotalAmount = Convert.ToDecimal(taxCalculation.AmountTotal) / 100,
|
||||||
|
};
|
||||||
|
return TypedResults.Ok(response);
|
||||||
|
}
|
||||||
|
catch (StripeException e)
|
||||||
|
{
|
||||||
|
return TypedResults.BadRequest(e.Message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user