|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.commerce.payment.commands.PaymentHelper
This class defines several helper methods used by the Order Subsystem classes.
Constructor Summary | |
PaymentHelper()
PaymentHelper default constructor. |
Method Summary | |
boolean |
checkAccountAndCreditLineAreActive_AB(AccountAccessBean abAccount,
CreditLineAccessBean abCreditLine)
Checks if both the specified Account and CreditLine are active. |
boolean |
checkAccountAndCreditLineAreActive(java.lang.String sAccountId,
java.lang.String sCreditLineId)
Checks if both the specified Account and CreditLine are active. |
void |
checkCardExpiryYearAndMonth(TypedProperty requestProperties,
java.lang.String errorViewName,
CommandContext cmdCtx)
Checks the cardExpiryMonth and cardExpiryYear parameters if present. |
void |
checkCardNumberAndBrand(TypedProperty requestProperties,
java.lang.String errorViewName,
CommandContext cmdCtx)
Checks the cardNumber and cardBrand parameters if present. |
java.lang.Long |
checkFromOrdPayMthdIfAllCreditLineAreActive(java.lang.Long nOrderId)
Checks if the Account & Creditline associated with the OrdPayMthd entries of the specified OrderId are all active. |
void |
checkPaymentInfoForDelayedProcess(TypedProperty requestProperties,
OrderAccessBean abOrder,
java.lang.String errorViewName,
CommandContext cmdCtx)
Checks several payment related parameters before scheduling an Order or holding the Order for Approval by the Buyer Approver. |
java.lang.Long[] |
findTAsWithCompatiblePaymentTC(java.lang.Long[] nTAIds,
OrderAccessBean abOrder,
CommandContext cmdCtx)
From the array of input TradingIds find all the Trading Agreements that have compatible PaymentTC with the existing Trading Agreements specified by the OrderItems of the Order. |
java.util.Set |
findTAsWithCompatiblePaymentTC(java.lang.Long nMemberId,
java.util.List lstTAIds,
CommandContext cmdCtx)
Find the biggest set of Trading Agreement IDs from the List of Trading Agreement IDs that have compatible Payment Terms and Conditions. |
java.lang.Long[] |
findTAsWithCompatiblePaymentTC(java.lang.Long nMemberId,
java.lang.Long[] nTAIds,
java.util.Set setOfExistingTAIds,
CommandContext cmdCtx)
From the array of input TradingIds find all the Trading Agreements that have compatible PaymentTC that the specified customer is entiyled to and with the existing Trading Agreements identified by the Set of TradingIds. |
java.lang.Long |
getBillToAddressIdFromTC(TypedProperty requestProperties)
Checks if a tcId parameter is specified in the input TypedProperty object and returns the billToAddress ID specified by the Payment TC if a billToAddress is included in the TC. |
static PaymentHelper |
getInstance()
Returns the PaymentHelper instance that can be used to invoke the instance helper methods. |
boolean |
isCardExpiryDateValid(int expiryMonth,
int expiryYear)
Checks if the specified expiry date (expiryMonth and expiryYear) is valid. |
boolean |
isPaymentPolicyValid(OrderAccessBean abOrder,
java.lang.String strPolicyId,
java.lang.String strTCId,
CommandContext commandContext)
Checks if the Payment Policy ID specified is valid for the Order. |
java.lang.String |
removeSpaceAndHyphenFromString(java.lang.String aCardNumber)
Returns a new string that is free of any spaces and hyphenated characters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PaymentHelper()
Method Detail |
public boolean checkAccountAndCreditLineAreActive_AB(AccountAccessBean abAccount, CreditLineAccessBean abCreditLine) throws javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException, java.rmi.RemoteException
public boolean checkAccountAndCreditLineAreActive(java.lang.String sAccountId, java.lang.String sCreditLineId) throws javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException, java.rmi.RemoteException
public void checkCardExpiryYearAndMonth(TypedProperty requestProperties, java.lang.String errorViewName, CommandContext cmdCtx) throws ECException
requestProperties
- the TypedProperty object that may contain the cardExpiryMonth and cardExpiryYear parameters.errorViewName
- the name of the ErrorView.cmdCtx
- the CommandContext.ECException
- this helper method throws ECApplicationException if the cardExpiryYear or cardExpiryMonth
is specified and is invalid. Note that if one of the parameters is specified, the other must be specified as well.
It is considered an error if only one of the two is specified.public void checkCardNumberAndBrand(TypedProperty requestProperties, java.lang.String errorViewName, CommandContext cmdCtx) throws ECException
This helper method calls the CheckCCNumber
Task Command to do the actual checking.
requestProperties
- the TypedProperty object that may contain the cardNumber and cardBrand parameters.errorViewName
- the name of the ErrorView.cmdCtx
- the CommandContext.ECException
- this helper method throws ECApplicationException if the cardNumber
is specified and is invalid. Note that if one of the parameters is specified, the other must be specified as well.
It is considered an error if only one of the two parameters is present.public java.lang.Long checkFromOrdPayMthdIfAllCreditLineAreActive(java.lang.Long nOrderId) throws javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException, java.rmi.RemoteException
public void checkPaymentInfoForDelayedProcess(TypedProperty requestProperties, OrderAccessBean abOrder, java.lang.String errorViewName, CommandContext cmdCtx) throws ECException
This helper method may call other Task Commands to do the actual checking of the parameters. The
Task Commands that may be called include ValidatePONumber
,
CheckCCNumber
and DoLuhnCheck
.
requestProperties
- the TypedProperty object containing the name-value pairs from the URL.abOrder
- the OrderAccessBean.errorViewName
- the name of the ErrorView. If null, use "DoPaymentErrorView".cmdCtx
- the CommandContext.ECException
- throws ECApplicationException for user correctable errors and ECSystemException
for system type errors related to the site or the JSP or the coinfiguration of the Store that the user
has no direct control.public java.lang.Long[] findTAsWithCompatiblePaymentTC(java.lang.Long[] nTAIds, OrderAccessBean abOrder, CommandContext cmdCtx) throws ECException
nTAIds
- an input array containing the TradingIds to check.abOrder
- the OrderAccessBeancmdCtx
- the CommandContext.ECException
- public java.util.Set findTAsWithCompatiblePaymentTC(java.lang.Long nMemberId, java.util.List lstTAIds, CommandContext cmdCtx) throws ECException
nMemberId
- the member ID that identifies the customer.nTAIds
- list of Trading Agreement IDs to check.cmdCtx
- the CommandContextECException
- public java.lang.Long[] findTAsWithCompatiblePaymentTC(java.lang.Long nMemberId, java.lang.Long[] nTAIds, java.util.Set setOfExistingTAIds, CommandContext cmdCtx) throws ECException
nMemberId
- java.lang.Long MemeberId that identidies the customer.nTAIds
- java.lang.Long[] input array of TradingIds to check.setOfExistingTAIds
- java.util.Set TradingIds of the existing Trading Agreements.
The TradingIds are of type java.lang.Long.cmdCtx
- com.ibm.commerce.command.CommandContextECException
- The exception description.public java.lang.Long getBillToAddressIdFromTC(TypedProperty requestProperties) throws ECException
requestProperties
- the TypedProperty object containing the name-value pairs from the URL.ECException
- public static PaymentHelper getInstance()
public boolean isCardExpiryDateValid(int expiryMonth, int expiryYear)
expiryMonth
- the calender month of the expiry date (1 for January, 2 for February, and so on.)expiryYear
- the calender year of the expiry datepublic boolean isPaymentPolicyValid(OrderAccessBean abOrder, java.lang.String strPolicyId, java.lang.String strTCId, CommandContext commandContext) throws ECException
abOrder
- the OrderAccessBean representing the Order.strPolicyId
- the String representing the Payment Policy ID.strTCId
- the String representing the ID of the Payment Terms and Conditions to use for the purchase.
This String could be an empty String but cannot be null.ECException
- public java.lang.String removeSpaceAndHyphenFromString(java.lang.String aCardNumber)
aCardNumber
- the card number to be examined and stripped
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |