AmountDetailsResponse Class

Sets tax amount fields based on a response from the external tax engine.

CommerceTax

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.

Learn more about the methods available from the AmountDetailsResponse class.

The following are methods for AmountDetailsResponse.

Sets the value of the ExemptAmount field.

global void setExemptAmount(Double exemptAmount)

  • exemptAmount:

    Type: Double

    The amount of a line item’s total amount that’s exempt from tax calculation.

Type: void

Sets the value of the TaxAmount field.

global void setTaxAmount(Double taxAmount)

  • taxAmount:

    Type: Double

    The calculated amount of tax for a line item.

Type: void

Sets the value of the TotalAmount field.

global void setTotalAmount(Double totalAmount)

  • totalAmount:

    Type: Double

    The total amount of a line item, excluding tax.

Type: void

Sets the value of the TotalAmountWithTax field.

global void setTotalAmountWithTax(Double totalAmtWithTax)

  • totalAmtWithTax:

    Type: Double

    The total amount of a line item combined with the calculated tax for that line item.

Type: void