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
Modifier and TypeClassDescriptionstatic class
static class
The value of the tax ID.static class
State/province as an ISO 3166-2 subdivision code, without country prefix.static class
The tax type, such asvat
orsales_tax
.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_GSON
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
static Calculation
create
(CalculationCreateParams params) Calculates tax based on the input and returns a TaxCalculation
object.static Calculation
create
(CalculationCreateParams params, RequestOptions options) Calculates tax based on the input and returns a TaxCalculation
object.static Calculation
Calculates tax based on the input and returns a TaxCalculation
object.static Calculation
create
(Map<String, Object> params, RequestOptions options) Calculates tax based on the input and returns a TaxCalculation
object.boolean
Total 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 valuetrue
if the object exists in live mode or the valuefalse
if 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.int
hashCode()
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 Calculation
Retrieves a TaxCalculation
object, if the calculation hasn’t expired.static Calculation
retrieve
(String calculation, RequestOptions options) Retrieves a TaxCalculation
object, if the calculation hasn’t expired.static Calculation
retrieve
(String calculation, CalculationRetrieveParams params, RequestOptions options) Retrieves a TaxCalculation
object, if the calculation hasn’t expired.static Calculation
Retrieves a TaxCalculation
object, if the calculation hasn’t expired.void
setAmountTotal
(Long amountTotal) Total amount after taxes in the smallest currency unit.void
setCurrency
(String currency) Three-letter ISO currency code, in lowercase.void
setCustomer
(String customer) The ID of an existing Customer used for the resource.void
setCustomerDetails
(Calculation.CustomerDetails customerDetails) void
setExpiresAt
(Long expiresAt) Timestamp of date at which the tax calculation will expire.void
Unique identifier for the calculation.void
setLineItems
(CalculationLineItemCollection lineItems) The list of items the customer is purchasing.void
setLivemode
(Boolean livemode) Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.void
String representing the object's type.void
setResponseGetter
(StripeResponseGetter responseGetter) The tax type, such asvat
orsales_tax
.void
setShipFromDetails
(Calculation.ShipFromDetails shipFromDetails) The details of the ship from location, such as the address.void
setShippingCost
(Calculation.ShippingCost shippingCost) The shipping cost details for the calculation.void
setTaxAmountExclusive
(Long taxAmountExclusive) The amount of tax to be collected on top of the line item prices.void
setTaxAmountInclusive
(Long taxAmountInclusive) The amount of tax already included in the line item prices.void
setTaxBreakdown
(List<Calculation.TaxBreakdown> taxBreakdown) Breakdown of individual tax amounts that add up to the total.void
setTaxDate
(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, setStripeResponseGetter, urlEncode, urlEncodeId
Methods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 TaxCalculation
object.- Throws:
StripeException
-
create
public static Calculation create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCalculates tax based on the input and returns a TaxCalculation
object.- Throws:
StripeException
-
create
Calculates tax based on the input and returns a TaxCalculation
object.- Throws:
StripeException
-
create
public static Calculation create(CalculationCreateParams params, RequestOptions options) throws StripeException Calculates tax based on the input and returns a TaxCalculation
object.- 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 TaxCalculation
object, if the calculation hasn’t expired.- Throws:
StripeException
-
retrieve
public static Calculation retrieve(String calculation, RequestOptions options) throws StripeException Retrieves a TaxCalculation
object, if the calculation hasn’t expired.- Throws:
StripeException
-
retrieve
public static Calculation retrieve(String calculation, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves a TaxCalculation
object, if the calculation hasn’t expired.- Throws:
StripeException
-
retrieve
public static Calculation retrieve(String calculation, CalculationRetrieveParams params, RequestOptions options) throws StripeException Retrieves a TaxCalculation
object, if the calculation hasn’t expired.- Throws:
StripeException
-
setResponseGetter
The tax type, such asvat
orsales_tax
.One of
amusement_tax
,communications_tax
,gst
,hst
,igst
,jct
,lease_tax
,pst
,qst
,rst
,sales_tax
, orvat
.- Specified by:
setResponseGetter
in interfaceStripeActiveObject
- Overrides:
setResponseGetter
in classApiResource
- Parameters:
responseGetter
- theStripeResponseGetter
instance 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 valuetrue
if the object exists in live mode or the valuefalse
if 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 valuetrue
if the object exists in live mode or the valuefalse
if 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.
-