public class PrimePaymentCmdImpl extends AEDPStoreTaskCmdImpl implements PrimePaymentCmd
orderId | A Long that indicates the id of the current order. |
inTotalAmount | An int that indicates the total order amount. |
inInitialAmount | An int that indicates the initial amount. |
itpPaymentAttributes | A TypedProperty that the represents the paymentAttributes property of the command. |
commandContext | The command context. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
The IBM Copyright notice field.
|
Constructor and Description |
---|
PrimePaymentCmdImpl() |
Modifier and Type | Method and Description |
---|---|
protected void | calculatePrimePaymentActions(com.ibm.commerce.edp.model.EDPOrderData edpOrder, java.math.BigDecimal initialAmount)
This method calculates the actions for PrimePayment business event through reading the Payment Rules Configuration.
|
void | executePrimePaymentTCs()
Do nothing
|
AccountAccessBean | getAccount()
This method returns the AccountAccessBean representing the account if an account ID is present.
|
java.lang.Long | getAccountId()
This method returns the common account ID if one is specified by the trading agreements used by the order items of the order being processed.
|
protected com.ibm.commerce.edp.activitylog.ActivityLoggerLocal | getActivityLoggerFacade()
This method gets the local interface of activity logger, which will store the history of payment/refund actions in database.
|
java.lang.Long | getBuyerPOId()
This method returns the internal ID of the BuyerPO record if a buyer purchase order number is specified.
|
java.lang.String | getEDPWarning()
This method returns the payment rule warning information.
|
java.math.BigDecimal | getInitialAmount()
This method returns the initial amount.
|
protected java.util.Collection | getNeverPersistedSensitiveInformationOfPI(PaymentInstruction paymentInstructionVO)
This method gets name of the extended data configured as neverPersist=true in
|
OrderAccessBean | getOrderAccessBean()
This method returns a reference to the order access bean.
|
TypedProperty | getPaymentAttributes()
This method returns the payment attributes, which are sometimes referred to as payment protocol data.
|
java.lang.String | getPaymentMethodId()
This method returns the payment method ID to be used for the payment of the order.
|
java.lang.String | getPONumber()
This method just returns null.
|
java.math.BigDecimal | getTotalAmount()
This method returns the total order amount.
|
boolean | isReadyToCallExecute()
This method is called by the Command Framework to check if all basic mandatory parameters have been set for this command.
|
void | performExecute()
This method executes the business logic of this command implementation.
|
void | processFG()
This method processes the foreground tasks.
|
protected void | removeSensitiveInfoFromOrdPayInfo(java.lang.Long orderId)
This method removes the sensitive information from the table ORDPAYINFO.
|
void | reset()
This method resets the command fields.
|
protected java.util.Map | resolvePaymentSensitiveInformation(TypedProperty localRequestProperties)
This method resolves the payment sensitive information of the payment instruction(s) of this order from the request properties.
|
void | setAccountId(java.lang.Long n)
This method sets the account ID.
|
void | setBuyerPOId(java.lang.Long n)
This method sets the buyerPO ID.
|
void | setEDPWarning(java.lang.String warning)
This method sets the payment rule warning information.
|
protected void | setIdempotentForDuplicateRequestWithZeroInitialAmount(com.ibm.commerce.edp.model.EDPOrderData edpOrderData, java.math.BigDecimal initialAmt)
If this request is again with a zero value of initial amount, then this method marks this request as idempotent.
|
void | setInitialAmount(java.math.BigDecimal initialAmount)
This method sets the initial amount.
|
void | setOrderAccessBean(OrderAccessBean abOrder)
This method sets a reference to the order access bean.
|
void | setPaymentAttributes(TypedProperty paymentAttributes)
This method sets the paymentAttributes property of the command.
|
void | setPaymentMethodId(java.lang.String nPayMthdId)
This method sets the payment method ID to be used with the payments rules subcomponent.
|
protected void | setPONumber(java.lang.String sPONumber)
This method sets the purchase order number.
|
void | setTotalAmount(java.math.BigDecimal totalAmount)
This method sets the total order amount.
|
void | validateParameters()
This method extracts and validates the input parameters of this command implementation.
|
public static final java.lang.String COPYRIGHT
public AccountAccessBean getAccount()
This method returns the AccountAccessBean representing the account if an account ID is present.
If no account ID is set, null is returned.
This method will first check if the local variable iabAccount is set. If not, it will attempt to retrieve the AccountAccessBean using the specified account ID.
public void setAccountId(java.lang.Long n)
public java.lang.Long getAccountId()
public void setBuyerPOId(java.lang.Long n)
public java.lang.Long getBuyerPOId()
public void setEDPWarning(java.lang.String warning)
public java.lang.String getEDPWarning()
public void setInitialAmount(java.math.BigDecimal initialAmount)
public java.math.BigDecimal getInitialAmount()
public void setOrderAccessBean(OrderAccessBean abOrder)
public OrderAccessBean getOrderAccessBean()
public java.lang.String getPONumber()
public void setPaymentAttributes(TypedProperty paymentAttributes)
public TypedProperty getPaymentAttributes()
public void setPaymentMethodId(java.lang.String nPayMthdId)
This method sets the payment method ID to be used with the payments rules subcomponent.
This method is to be used when there is only a single payment method for the entire order.
public java.lang.String getPaymentMethodId()
public boolean isReadyToCallExecute()
public void setTotalAmount(java.math.BigDecimal totalAmount)
public java.math.BigDecimal getTotalAmount()
public void executePrimePaymentTCs() throws ECException
public void performExecute() throws ECException
public void reset()
This method resets the command fields.
After this method is invoked, and proper attributes are set, the command can be executed again.
public void validateParameters() throws ECException
protected void setPONumber(java.lang.String sPONumber)
public void processFG() throws EDPException, ECException
This method firstly updates the initial amount of the edp order. If current initial amount of the edp order is zero, we just set the request initial amount to it. And if current initial amount of the edp order is not zero, we should check if it is equal to the request initial amount.
Then it calculates the actions for PrimePayment business event through reading the Payment Rules Configuration.
protected void calculatePrimePaymentActions(com.ibm.commerce.edp.model.EDPOrderData edpOrder, java.math.BigDecimal initialAmount) throws EDPException, InternalException, J2EEException, InputException, ECException
protected void removeSensitiveInfoFromOrdPayInfo(java.lang.Long orderId) throws ECException
Out-of-the-box it removes only CVC code.
protected java.util.Map resolvePaymentSensitiveInformation(TypedProperty localRequestProperties) throws ECApplicationException
For identifying which protocol data belongs to the sensitive information, you need configure neverPersist="true" of the corresponding protocol data in <WC_InstallDir>\xml\config\payments\ppc\plugins\PaymentSystemPluginMapping.xml. For example, for VISA credit card, you need cc_cvc is never persisted, then you need configure it like follows:
<Keyword name="cc_cvc" mask ="-" plain="0" removeAfterApproval ="true" neverPersist="true"/>
Also, name of these protocol data passed in from URL should begin with the prefix "pay_data_". For example, if the name you are using in the business logic is "cc_cvc" , it should be passed in form URL with name "pay_data_cc_cvc".
Since WebSphere Commerce supports multiple payment instructions per order, this method accepts the parameter with enumeration group. Each payment instruction corresponds to the payment instruction ID (with name paymentInstructionId) and the sensitive protocol data.
Note that if there is a payment instruction added inside OrderProcess, the parameter of this payment instruction should be with explicit enumeration group 0. For example, there have been two payment instructions. They have been added in previous transactions, but both of them need cc_cvc that cannot be persisted in the first payment authorization. Also, there is a new payment instruction with ID 10003 added in current transaction inside OrderProcess. The corresponding parameters in the URL look like: paymentInstructionId_1=10001&pay_data_cc_cvc_1=1111&paymentInstructionId_2=10002&pay_data_cc_cvc_2=2222&paymentInstructionId_0=10003&&pay_data_cc_cvc_0=3333
This method puts this information into a HashMap with the payment instruction ID as the key and another HashMap as the value. In the value, key is the name of the protocol data, and value is the value of the protocol data.
For example, the preceding parameters will be put into the HashMap as {{10001,{cc_cvc=1111}}, {10002,{cc_cvc=2222}}, {10003,{cc_cvc=3333}}}.
protected java.util.Collection getNeverPersistedSensitiveInformationOfPI(PaymentInstruction paymentInstructionVO) throws EDPException, ECException
\xml\config\payments\ppc\plugins\PaymentSystemPluginMapping.xml. Note that if the payment instruction is using a classic payment system, it is not allowed to call this method. This is because the compatible payment does not have the relevant PPC configuration.
protected void setIdempotentForDuplicateRequestWithZeroInitialAmount(com.ibm.commerce.edp.model.EDPOrderData edpOrderData, java.math.BigDecimal initialAmt) throws EDPException
protected com.ibm.commerce.edp.activitylog.ActivityLoggerLocal getActivityLoggerFacade() throws J2EEException