com.ibm.commerce.payment.commands
Interface CheckTASpendingLimitCmd
- All Superinterfaces:
- ECCommand, TaskCommand
- All Known Implementing Classes:
- CheckTASpendingLimitCmdImpl
- public interface CheckTASpendingLimitCmd
- extends TaskCommand
Check Trading Agreement's Spending Limit of the specified by given order.
Parameter:
Parameter Name |
Type |
Descriptions |
order |
OrderAccessBean |
The Order Access Bean |
orderItems |
Vector of OrderItemAccess |
Vector of OrderItem Access Beans representing the OrderItems that make up the Order. |
totalAmount |
BigDecimal |
The Total Amount to be checked. This amount is in the Currency of the Order. |
errorViewName |
String |
Optional error view name passed in by the Caller. |
Behavior:
- An order may include orderItems that are purchased under different TradingAgreement and
different TradingAgreement may have different Spending limits.
- Checks if Spending Limit of the TradingAgreement would be exceeded with this purchase
if the TradingAgreement includes a RightToBuyTC by Amount.
- Records for the Purchase Amount and Refund Amount for purchases and refunds against a
Trading Agreement with RightToBuyTC by Amount are kept in the same currency specified
for the RightToBuyTCByAmount.
These records are kept in separate Tables, TRDPURAMT and TRDREFAMT respectively.
Note that the currency of this RightToBuy TC must not change once the Trading Agreement
has been activated and purchases have been made against the Trading Agreement.
- Purchases can be made using a currency that is different from the currency specified for
the RightToBuyTC by Amount. For each unique Trading Agreement specified in the OrderItems
that includes a RightToBuy TC by Amount, this default implementation converts the sum of
the purchase amounts of the OrderItems to the currency specified for the RightToBuy TC.
If the resulting amount and the sum of all Purchase Amounts for the TradingAgreement in
the TRDPURAMT Table exceeds the RightToBuy Amount in the TC plus the sum of all Refund
Amounts in the TRDREFAMT Table for the same Trading_id, the Task Command throws an
ECApplicationException.
- The purchase amount of an OrderItem is the sum of the
ORDERITEMS.TOTALPRODUCT + ORDERITEMS.TAXAMOUNT + ORDERITEMS.SHIPCHARGE + ORDERITEMS.SHIPTAXAMOUNT minus ORDERITEMS.TOTALADJUSTMENT.
(Similarly, the purchase amount for the whole Order consists of the sum of
ORDERS.TOTALPRODUCT + ORDERS.TOTALTAX + ORDERS.TOTALSHIPPING + ORDERS.TOTALTAXSHIPPING minus ORDERS.TOTALADJUSTMENT.
This is the same as the totalAmount passed by the caller.)
Note that CheckTASpendingLimit
may be called several
times by various commands during Order Flow. (for example, from Order Capture commands, the
OrderProcess command, and so on.). The actual update of the Trading Agreement Spending Amount
is made during ReleaseToFulfillment by the
CheckPaymentAcceptCmdImpl
Task Command Implementation class
when bReleaseToFulfillment is set to true.
Error View Name:
- CheckTASpendingLimitErrorView (This is the default ErrorViewName if none is passed into the command.)
ErrorCodes:
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, performExecute, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters |
COPYRIGHT
public static final java.lang.String COPYRIGHT
defaultCommandClassName
public static final java.lang.String defaultCommandClassName
- The default implementation class.
ERRTASK_NAME
public static final java.lang.String ERRTASK_NAME
- Name of the Error View for this command.
The constant value of this field is "CheckSpendingLimitErrorView".
NAME
public static final java.lang.String NAME
setErrorViewName
public void setErrorViewName(java.lang.String sEVN)
- Optional error view name passed in by the Caller.
setOrder
public void setOrder(OrderAccessBean abOrder)
- Sets the order property of the command.
- Parameters:
abOrder
- the OrderAccessBean of the Order
setOrderItems
public void setOrderItems(OrderItemAccessBean[] aOrderItems)
- Sets the aOrderItems property of the command.
- Parameters:
aOrderItems
- the Array of the OrderItemAccessBean of the Order
setTotalAmount
public void setTotalAmount(java.math.BigDecimal nTotalAmount)
- Sets the nTotalAmount property of the command.
- Parameters:
nTotalAmount
- the amount to be checked with.