Package com.stripe.model.tax
Class Calculation
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.tax.Calculation
- All Implemented Interfaces:
HasId,StripeActiveObject,StripeObjectInterface
A Tax Calculation allows you to calculate the tax to collect from your customer.
Related guide: Calculate tax in your custom payment flow
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFor more details about CustomerDetails, please refer to the API Reference.static classFor more details about ShipFromDetails, please refer to the API Reference.static classFor more details about ShippingCost, please refer to the API Reference.static classFor more details about TaxBreakdown, please refer to the API Reference.Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod -
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic Calculationcreate(CalculationCreateParams params) Calculates tax based on the input and returns a TaxCalculationobject.static Calculationcreate(CalculationCreateParams params, RequestOptions options) Calculates tax based on the input and returns a TaxCalculationobject.static CalculationCalculates tax based on the input and returns a TaxCalculationobject.static Calculationcreate(Map<String, Object> params, RequestOptions options) Calculates tax based on the input and returns a TaxCalculationobject.booleanTotal amount after taxes in the smallest currency unit.Three-letter ISO currency code, in lowercase.The ID of an existing Customer used for the resource.Timestamp of date at which the tax calculation will expire.getId()Unique identifier for the calculation.The list of items the customer is purchasing.Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.String representing the object's type.The details of the ship from location, such as the address.The shipping cost details for the calculation.The amount of tax to be collected on top of the line item prices.The amount of tax already included in the line item prices.Breakdown of individual tax amounts that add up to the total.Timestamp of date at which the tax rules and rates in effect applies for the calculation.inthashCode()Retrieves the line items of a tax calculation as a collection, if the calculation hasn’t expired.Retrieves the line items of a tax calculation as a collection, if the calculation hasn’t expired.listLineItems(CalculationListLineItemsParams params, RequestOptions options) Retrieves the line items of a tax calculation as a collection, if the calculation hasn’t expired.listLineItems(Map<String, Object> params) Retrieves the line items of a tax calculation as a collection, if the calculation hasn’t expired.listLineItems(Map<String, Object> params, RequestOptions options) Retrieves the line items of a tax calculation as a collection, if the calculation hasn’t expired.static CalculationRetrieves a TaxCalculationobject, if the calculation hasn’t expired.static Calculationretrieve(String calculation, RequestOptions options) Retrieves a TaxCalculationobject, if the calculation hasn’t expired.static Calculationretrieve(String calculation, CalculationRetrieveParams params, RequestOptions options) Retrieves a TaxCalculationobject, if the calculation hasn’t expired.static CalculationRetrieves a TaxCalculationobject, if the calculation hasn’t expired.voidsetAmountTotal(Long amountTotal) Total amount after taxes in the smallest currency unit.voidsetCurrency(String currency) Three-letter ISO currency code, in lowercase.voidsetCustomer(String customer) The ID of an existing Customer used for the resource.voidsetCustomerDetails(Calculation.CustomerDetails customerDetails) voidsetExpiresAt(Long expiresAt) Timestamp of date at which the tax calculation will expire.voidUnique identifier for the calculation.voidsetLineItems(CalculationLineItemCollection lineItems) The list of items the customer is purchasing.voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidString representing the object's type.voidsetResponseGetter(StripeResponseGetter responseGetter) Three-letter ISO currency code, in lowercase.voidsetShipFromDetails(Calculation.ShipFromDetails shipFromDetails) The details of the ship from location, such as the address.voidsetShippingCost(Calculation.ShippingCost shippingCost) The shipping cost details for the calculation.voidsetTaxAmountExclusive(Long taxAmountExclusive) The amount of tax to be collected on top of the line item prices.voidsetTaxAmountInclusive(Long taxAmountInclusive) The amount of tax already included in the line item prices.voidsetTaxBreakdown(List<Calculation.TaxBreakdown> taxBreakdown) Breakdown of individual tax amounts that add up to the total.voidsetTaxDate(Long taxDate) Timestamp of date at which the tax rules and rates in effect applies for the calculation.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setGlobalResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
Calculation
public Calculation()
-
-
Method Details
-
create
Calculates tax based on the input and returns a TaxCalculationobject.- Throws:
StripeException
-
create
public static Calculation create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCalculates tax based on the input and returns a TaxCalculationobject.- Throws:
StripeException
-
create
Calculates tax based on the input and returns a TaxCalculationobject.- Throws:
StripeException
-
create
public static Calculation create(CalculationCreateParams params, RequestOptions options) throws StripeException Calculates tax based on the input and returns a TaxCalculationobject.- Throws:
StripeException
-
listLineItems
Retrieves the line items of a tax calculation as a collection, if the calculation hasn’t expired.- Throws:
StripeException
-
listLineItems
public CalculationLineItemCollection listLineItems(Map<String, Object> params) throws StripeExceptionRetrieves the line items of a tax calculation as a collection, if the calculation hasn’t expired.- Throws:
StripeException
-
listLineItems
public CalculationLineItemCollection listLineItems(Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves the line items of a tax calculation as a collection, if the calculation hasn’t expired.- Throws:
StripeException
-
listLineItems
public CalculationLineItemCollection listLineItems(CalculationListLineItemsParams params) throws StripeException Retrieves the line items of a tax calculation as a collection, if the calculation hasn’t expired.- Throws:
StripeException
-
listLineItems
public CalculationLineItemCollection listLineItems(CalculationListLineItemsParams params, RequestOptions options) throws StripeException Retrieves the line items of a tax calculation as a collection, if the calculation hasn’t expired.- Throws:
StripeException
-
retrieve
Retrieves a TaxCalculationobject, if the calculation hasn’t expired.- Throws:
StripeException
-
retrieve
public static Calculation retrieve(String calculation, RequestOptions options) throws StripeException Retrieves a TaxCalculationobject, if the calculation hasn’t expired.- Throws:
StripeException
-
retrieve
public static Calculation retrieve(String calculation, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves a TaxCalculationobject, if the calculation hasn’t expired.- Throws:
StripeException
-
retrieve
public static Calculation retrieve(String calculation, CalculationRetrieveParams params, RequestOptions options) throws StripeException Retrieves a TaxCalculationobject, if the calculation hasn’t expired.- Throws:
StripeException
-
setResponseGetter
Three-letter ISO currency code, in lowercase.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance to use for making further requests.
-
getAmountTotal
Total amount after taxes in the smallest currency unit. -
getCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
getCustomer
The ID of an existing Customer used for the resource. -
getCustomerDetails
-
getExpiresAt
Timestamp of date at which the tax calculation will expire. -
getLineItems
The list of items the customer is purchasing. -
getLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
tax.calculation. -
getShipFromDetails
The details of the ship from location, such as the address. -
getShippingCost
The shipping cost details for the calculation. -
getTaxAmountExclusive
The amount of tax to be collected on top of the line item prices. -
getTaxAmountInclusive
The amount of tax already included in the line item prices. -
getTaxBreakdown
Breakdown of individual tax amounts that add up to the total. -
getTaxDate
Timestamp of date at which the tax rules and rates in effect applies for the calculation. -
setAmountTotal
Total amount after taxes in the smallest currency unit. -
setCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
setCustomer
The ID of an existing Customer used for the resource. -
setCustomerDetails
-
setExpiresAt
Timestamp of date at which the tax calculation will expire. -
setId
Unique identifier for the calculation. -
setLineItems
The list of items the customer is purchasing. -
setLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
tax.calculation. -
setShipFromDetails
The details of the ship from location, such as the address. -
setShippingCost
The shipping cost details for the calculation. -
setTaxAmountExclusive
The amount of tax to be collected on top of the line item prices. -
setTaxAmountInclusive
The amount of tax already included in the line item prices. -
setTaxBreakdown
Breakdown of individual tax amounts that add up to the total. -
setTaxDate
Timestamp of date at which the tax rules and rates in effect applies for the calculation. -
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the calculation.
-