Integration with a tax provider system

To integrate with a tax provider system, certain components are needed in Sterling™ Order Management System Software.

The following components are needed in Sterling Order Management System Software in order to integrate with a tax provider system:
  • An adapter for a specific tax provider system.
  • The GetTax service to compute tax for an order. This service calls the adapter used for a specific tax provider system.
  • The CommitTax service 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 YFSRecalculateHeaderTaxUE and YFSRecalculateLineTaxUE user 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 the GetTax service.
  • An action attached to the ON_INVOICE_COLLECTION event on PAYMENT_COLLECTION transaction, which invokes the CommitTax service.
In this approach, the Order Capturing Application has to make a call to 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:

GetTax or CommitTax service configuration

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:

YFSRecalculateHeaderTaxUE and YFSRecalculateLineTaxUE user exits implementation in Applications Manager

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.

CommitTax action configuration that 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:

A sample ON_INVOICE_COLLECTION event activation on PAYMENT_COLLECTION transaction, and attach the CommitTax action.