Integration with a tax provider system
To integrate with a tax provider system, certain components are needed in Sterling™ Order Management System Software.
- An adapter for a specific tax provider system.
- The
GetTaxservice to compute tax for an order. This service calls the adapter used for a specific tax provider system. - The
CommitTaxservice to commit tax on the tax provider system for auditing purpose. This service calls the adapter used for a specific tax provider system with a different operation code. - Implement the
YFSRecalculateHeaderTaxUEandYFSRecalculateLineTaxUEuser exits to invoke a custom API component. This is to compute the tax whenever a tax-change scenario arrives. This component first evaluates the conditions for tax recalculation and if necessary calls theGetTaxservice. - An action attached to the
ON_INVOICE_COLLECTIONevent onPAYMENT_COLLECTIONtransaction, which invokes theCommitTaxservice.
GetTax service on check out to determine the tax details. After the
order is submitted to Sterling Order Management System Software,
it invokes the YFSRecalculateHeaderTaxUE and
YFSRecalculateLineTaxUE user exits whenever tax recalculation is
needed. It also calls the custom API component to retrieve the updated tax details. On
payment settlement, Sterling Order Management System Software
raises the ON_INVOICE_COLLECTION event on
PAYMENT_COLLECTION transaction, which calls the
CommitTax service to commit tax on the tax provider system.A sample GetTax or CommitTax service
configuration in Applications Manager under Service Definition
Framework is as follows:

Both prepareInput and getOutput components
are modeled as custom java components to prepare the input document
to adapter, set the operation mode get or commit, and form a service
output from the adapter output.
The YFSRecalculateHeaderTaxUE and YFSRecalculateLineTaxUE user
exits are implemented in Applications Manager as follows:

The sample user exit implementation SDATaxUEManager.class is
as follows:
public class SDATaxUEManager implements YFSRecalculateHeaderTaxUE,
YFSRecalculateLineTaxUE {
@Override
public YFSExtnTaxCalculationOutStruct recalculateLineTax(
YFSEnvironment env, YFSExtnLineTaxCalculationInputStruct inStruct)
throws YFSUserExitException {
// validate whether tax needs to be recalculated.
// call GetTax service.
// prepare UE output based on the GetTax output.
return taxOutStruct;
}
@Override
public YFSExtnTaxCalculationOutStruct recalculateHeaderTax(
YFSEnvironment env, YFSExtnHeaderTaxCalculationInputStruct inStruct)
throws YFSUserExitException {
// validate whether tax needs to be recalculated.
// call GetTax service.
// prepare UE output based on the GetTax output.
return taxOutStruct;
}
}
Each implementation can decide whether to consider all or few tax change scenarios such as the changes in Ship From address, tax rates, and others.
A sample CommitTax action is configured as follows.
This invokes the CommitTax service.

Activate the ON_INVOICE_COLLECTION event on PAYMENT_COLLECTION transaction,
and attach the CommitTax action.
A sample configuration is as follows:
