stripe/model/line_items_tax_amount.rs
1use serde::{Serialize, Deserialize};
2use super::TaxRate;
3///
4#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5pub struct LineItemsTaxAmount {
6 ///Amount of tax applied for this rate.
7 pub amount: i64,
8 /**Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax.
9
10Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates)*/
11 pub rate: TaxRate,
12 ///The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
13 #[serde(skip_serializing_if = "Option::is_none")]
14 pub taxability_reason: Option<String>,
15 ///The amount on which tax is calculated, in cents (or local equivalent).
16 #[serde(skip_serializing_if = "Option::is_none")]
17 pub taxable_amount: Option<i64>,
18}
19impl std::fmt::Display for LineItemsTaxAmount {
20 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
21 write!(f, "{}", serde_json::to_string(self).unwrap())
22 }
23}