public class ProcCreateInvoiceRequestInfo extends GenericService implements PipelineProcessor
PaymentManagerPipelineArgs.getPaymentInfo().
This processor is designed so that the InvoiceRequestInfo class can
easily be extended. See
"setInvoiceRequestInfoClass
"
and
"#addDataToInvoiceRequestInfo "addDataToInvoiceRequestInfo
for more information.
InvoiceRequestInfo
,
GenericInvoiceRequestInfo
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION |
static int |
SUCCESS
Return values for this processor.
|
SERVICE_INFO_KEY
STOP_CHAIN_EXECUTION, STOP_CHAIN_EXECUTION_AND_COMMIT, STOP_CHAIN_EXECUTION_AND_ROLLBACK
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
ProcCreateInvoiceRequestInfo() |
Modifier and Type | Method and Description |
---|---|
protected void |
addDataToInvoiceRequestInfo(Order pOrder,
InvoiceRequest pPaymentGroup,
double pAmount,
PaymentManagerPipelineArgs pParams,
GenericInvoiceRequestInfo pInvoiceRequestInfo)
This method populates the
InvoiceRequestInfo object with
data. |
protected java.lang.Double |
computeBalanceDue(double pAmount,
PaymentGroup pPmt)
Compute the balance due on the invoice by looking at the payment group
original amount, subtracting anything that's already been debited, and
adding back in any credits applied to the payment group.
|
protected GenericInvoiceRequestInfo |
getInvoiceRequestInfo()
Factory method to create a new InvoiceRequestInfo object.
|
java.lang.String |
getInvoiceRequestInfoClass()
Return the class to instantiate when creating a new InvoiceRequestInfo
object.
|
int[] |
getRetCodes()
Return the possible return values for this processor.
|
int |
runProcess(java.lang.Object pParam,
PipelineResult pResult)
Generate an InvoiceRequestInfo object of the class specified by
invoiceRequestInfoClass , populate it with data from an
InvoiceRequest payment group by calling
addDataToInvoiceRequestInfo , and add it to the pipeline
argument dictionary so that downstream pipeline processors can access
it. |
void |
setInvoiceRequestInfoClass(java.lang.String pInvoiceRequestInfoClass)
Specify the class to instantiate when creating a new InvoiceRequestInfo
object.
|
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
public static final int SUCCESS
public void setInvoiceRequestInfoClass(java.lang.String pInvoiceRequestInfoClass)
GenericInvoiceRequestInfo
class is extended to
include more information, this property can be changed to reflect the
new class.public java.lang.String getInvoiceRequestInfoClass()
protected void addDataToInvoiceRequestInfo(Order pOrder, InvoiceRequest pPaymentGroup, double pAmount, PaymentManagerPipelineArgs pParams, GenericInvoiceRequestInfo pInvoiceRequestInfo)
InvoiceRequestInfo
object with
data. If the additional data is required, a subclass of
GenericInvoiceRequestInfo
can be created with additional
properties, the invoiceRequestInfoClass
property can be
changed to specify the new class, and this method can be overridden to
add data for the new properties (or another pipeline processor could be
added after this processor to populate the additional properties).pOrder
- The order being paid for.pPaymentGroup
- The payment group being processed.pAmount
- The amount being authorized, debited, or creditedpParams
- The parameter dictionary passed to this pipeline processorpInvoiceRequestInfo
- An object that holds information understood by the invoice
request payment processor.protected java.lang.Double computeBalanceDue(double pAmount, PaymentGroup pPmt)
The assumption here is that credits don't reduce the total amount billed to the payment group, they only affect the outstanding balance. If one wants to reduce the total amount billed, one would presumably change the amount field in the payment group. If this assumption is incorrect and a different balance due behavior is desired, applications can subclass this class and replace the computeBalanceDue method to return a different value.
pAmount
- The amount value passed by the payment manager as the amount to
authorize, debit, or credit. This value is not used by the default
implementation of computeBalanceDue but is included in the method
signature in case subclassed versions of the method require it.pPmt
- The payment group for which an InvoiceRequestInfo object is
being created.protected GenericInvoiceRequestInfo getInvoiceRequestInfo() throws java.lang.Exception
invoiceRequestInfoClass
property, and must be a subclass
of atg.payment.invoice.GenericInvoiceRequestInfo
.invoiceRequestInfoClass
java.lang.Exception
- if any instantiation error occurs when creating the info objectpublic int runProcess(java.lang.Object pParam, PipelineResult pResult) throws java.lang.Exception
invoiceRequestInfoClass
, populate it with data from an
InvoiceRequest
payment group by calling
addDataToInvoiceRequestInfo
, and add it to the pipeline
argument dictionary so that downstream pipeline processors can access
it.runProcess
in interface PipelineProcessor
pParam
- Parameter dictionary of type PaymentManagerPipelineArgs.pResult
- Pipeline result object, not used by this method.java.lang.Exception
- If any error occurs creating or populating the invoice request info object.public int[] getRetCodes()
getRetCodes
in interface PipelineProcessor