Resolution Class
Resolution of a resolution strategy, which conditionally invokes default domain logic,
logic provided by an extension provider, or no logic.
Namespace
Example
1public class TaxServiceExtensionResolverSample extends commercestoretax.TaxService implements CommerceExtension.ResolutionStrategy {
2 public CommerceExtension.Resolution resolve() {
3 // The Sample Extension Provider registered with developer name as 'tax_extension_provider_for_us' will be selected for execution for en_US locale
4 if(CommerceExtension.ExtensionInfo.getLocaleString() == 'en_US') {
5 return new CommerceExtension.Resolution('tax_extension_provider_for_us');
6 }
7 // The Sample Extension Provider registered with developer name as 'tax_extension_provider_for_canada' will be selected for execution for en_CA locale
8 if(CommerceExtension.ExtensionInfo.getLocaleString() == 'en_CA') {
9 return new CommerceExtension.Resolution('tax_extension_provider_for_canada');
10 }
11 // The default Salesforce Internal Tax Api will return an empty response for German locale
12 if(CommerceExtension.ExtensionInfo.getLocaleString() == 'de') {
13 return new CommerceExtension.Resolution(CommerceExtension.ResolutionStates.OFF);
14 }
15 // The default Salesforce Internal Tax Api will be selected for execution for all other locales than US, Canada and Germany
16 return new CommerceExtension.Resolution();
17 }
18}Resolution Constructors
The following are constructors for Resolution.
Resolution(resolutionState)
Constructor that takes a CommerceExtension.ResolutionStates object as an
argument.
Signature
public Resolution(CommerceExtension.ResolutionStates resolutionState)
Parameters
- resolutionState
- Type: CommerceExtension.ResolutionStates
- Resolution state.
Resolution(providerName)
Constructor that takes the name of an extension provider as an argument.
Signature
public Resolution(String providerName)
Parameters
- providerName
- Type: String
- Name of the extension provider.
Resolution Methods
The following are methods for Resolution.
getProviderName()
Returns the name of an extension provider.
Signature
public String getProviderName()