AddressesResponse Class
Namespace
Usage
Example
This code sample represents a portion of the code used in a mock tax adapter. In this example, you create three AddressResponse classes, set their location codes, and pass them to the Ship To, Ship From, and Sold To setter methods in AddressesResponse. In an actual implementation, your AddressResponse classes already have a location code based on the response from the external tax engine.
commercetax.AddressesResponse addressesRes = new commercetax.AddressesResponse();
//AddressResponse containing ShipTo information
commercetax.AddressResponse shipToAddress = new commercetax.AddressResponse();
shipToAddress.setLocationCode('1234567');
//AddressResponse containing ShipFrom information
commercetax.AddressResponse shipFromAddress = new commercetax.AddressResponse();
shipFromAddress.setLocationCode('84720385');
//AddressResponse containing Sold To information
commercetax.AddressResponse soldToAddress = new commercetax.AddressResponse();
soldToAddress.setLocationCode('92381749');
//set values of addressesRes
addressesRes.setShipFrom(shipFromAddress);
addressesRes.setShipTo(shipToAddress);
addressesRes.setSoldTo(soldToAddress);
AddressesResponse Methods
The AddressesResponse class includes these methods.
setShipFrom(shipFrom)
Signature
global void setShipFrom(commercetax.AddressResponse shipFrom)
Parameters
- shipFrom
- Type: AddressResponse
- A single address. Use this generic address parameter to store any type of address, such as Ship From, Ship To, and Sold To details. Users set the specific address in an AddressResponse instance and then pass that instance to the AddressesResponse’s setShipTo(), setShipFrom(), and setSoldTo() methods as needed.
Return Value
Type: void
setShipTo(shipTo)
Signature
global void setShipTo(commercetax.AddressResponse shipTo)
Parameters
- shipTo
- Type: AddressResponse
- Stores a single address. This is a generic address parameter and can be used to store any type of address, such as Ship From, Ship To, and Sold To details. Users set the specific address in an AddressResponse instance and then pass that instance to the AddressesResponse’s setShipTo(), setShipFrom(), and setSoldTo() methods as needed.
Return Value
Type: void
setSoldTo(soldTo)
Signature
global void setSoldTo(commercetax.AddressResponse soldTo)
Parameters
- soldTo
- Type: AddressResponse
- Stores a single address. This is a generic address parameter and can be used to store any type of address, such as Ship From, Ship To, Sold To details. Users set the specific address in an AddressResponse instance and then pass that instance to the AddressesResponse’s setShipTo(), setShipFrom(), and setSoldTo() methods as needed.
Return Value
Type: void