public class TargetStatesService
extends java.lang.Object
Constructor and Description |
---|
TargetStatesService(java.lang.String paymentGroupName,
java.lang.String ruleName)
This method is the constructor for this class.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFinalizeTargetState()
This method returns the target payment state after FinalizePayment.
|
java.lang.String |
getPrimeTargetState()
This method returns the target payment state after PrimePayment.
|
java.lang.String |
getReserveTargetState()
This method returns the target payment state after ReservePayment.
|
static java.lang.String |
getTargetState(java.lang.String paymentGrpId,
java.lang.String paymentRule,
int phase)
This method gets the target payment state in current configuration for
specified payment group name, payment rule, and business event phase.
|
public TargetStatesService(java.lang.String paymentGroupName, java.lang.String ruleName) throws RuleException
paymentGroupName
- The current payment group nameruleName
- The payment rule nameInvalidDataException
- In case of any invalid data errorRuleException
- In case of any rule related errorpublic java.lang.String getFinalizeTargetState()
public java.lang.String getPrimeTargetState()
public java.lang.String getReserveTargetState()
public static java.lang.String getTargetState(java.lang.String paymentGrpId, java.lang.String paymentRule, int phase) throws RuleException, InternalException
Firstly it gets a PaymentRule object by payment group id and payment rule, then it gets the target payment state by phase.
If phase=1, which means currently it is in PrimePayment phase, then the target payment state after PrimePayment is returned.
If phase=2, which means currently it is in ReservePayment phase, then the target payment state after ReservePayment is returned.
If phase=3, which means currently it is in FinalizePayment phase, then the target payment state after FinalizePayment is returned.
paymentGrpId
- The current payment group idpaymentRule
- The current payment rulephase
- The current business event phaseRuleException
- In case of any payment rule errorInternalException
- In case of any internal error