AmountDetailsResponse Class
Namespace
Example
In this example, an instance of AmountDetailsResponse class in a mock adapter calculates several tax amount fields. The totalTax and totalAmount parameters were defined in an instance of LineItemResponse class. The adapter then assigns the instance to lineItemResponse.
1commercetax.AmountDetailsResponse amountResponse = new commercetax.AmountDetailsResponse();
2amountResponse.setTotalAmountWithTax(totalTax+totalAmount);
3amountResponse.setExemptAmount(0);
4amountResponse.setTotalAmount(totalAmount);
5amountResponse.setTaxAmount(totalTax);
6lineItemResponse.setAmountDetails(amountResponse);AmountDetailsResponse Methods
Learn more about the methods available from the AmountDetailsResponse class.
The following are methods for AmountDetailsResponse.
setExemptAmount(exemptAmount)
Signature
global void setExemptAmount(Double exemptAmount)
Parameters
- exemptAmount
- Type: Double
- The amount of a line item's total amount that's exempt from tax calculation.
Return Value
Type: void
setTaxAmount(taxAmount)
Signature
global void setTaxAmount(Double taxAmount)
Parameters
- taxAmount
- Type: Double
- The calculated amount of tax for a line item.
Return Value
Type: void
setTotalAmount(totalAmount)
Signature
global void setTotalAmount(Double totalAmount)
Parameters
- totalAmount
- Type: Double
- The total amount of a line item, excluding tax.
Return Value
Type: void
setTotalAmountWithTax(totalAmtWithTax)
Signature
global void setTotalAmountWithTax(Double totalAmtWithTax)
Parameters
- totalAmtWithTax
- Type: Double
- The total amount of a line item combined with the calculated tax for that line item.
Return Value
Type: void