JurisdictionResponse Class
Namespace
Example
In this mock adapter example, the adapter sets the TaxDetailsResponse.setJurisdiction() method parameter to null if the request's document code indicates that the tax calculation didn't require any exceptions. Otherwise, it creates an instance of JurisdictionResponse and sets its address values. Because this code represents a mock adapter, the example defines the address parameters directly. In a standard implementation, the jurisdiction's setters receive values passed from the eternal tax engine.
1if(request.DocumentCode == 'SetsNullForResponseWithoutException'){
2 taxDetailsResponse.setJurisdiction(null);
3 }else{
4 commercetax.JurisdictionResponse jurisdiction = new commercetax.JurisdictionResponse();
5 jurisdiction.setCountry('country');
6 jurisdiction.setRegion('region');
7 jurisdiction.setName('name');
8 jurisdiction.setStateAssignedNumber('stateAssignedNo');
9 jurisdiction.setId('id');
10 jurisdiction.setLevel('level');
11 taxDetailsResponse.setJurisdiction(jurisdiction);
12}JurisdictionResponse Methods
The JurisdictionResponse class includes these methods.
setCountry(country)
Signature
global void setCountry(String country)
Parameters
- country
- Type: String
- The country of the tax jurisdiction entity's address.
Return Value
Type: void
setId(id)
Signature
global void setId(String id)
Parameters
- id
- Type: String
- User-defined Id value used to reference the jurisdiction response.
Return Value
Type: void
setLevel(level)
Signature
global void setLevel(String level)
Parameters
- level
- Type: String
- Level value used in the jurisdiction entity's address.
Return Value
Type: void
setName(name)
Signature
global void setName(String name)
Parameters
- name
- Type: String
- Optional user-defined name field for referencing the jurisdiction response.
Return Value
Type: void
setRegion(region)
Signature
global void setRegion(String region)
Parameters
- region
- Type: String
- Region value used in the tax jurisdiction entity's address.
Return Value
Type: void
setStateAssignedNumber(stateAssignedNo)
Signature
global void setStateAssignedNumber(String stateAssignedNo)
Parameters
- stateAssignedNo
- Type: String
- State assigned number value of the tax jurisdiction entity's address.
Return Value
Type: void