com.ibm.commerce.payment.commands
Interface CheckTASpendingLimitCmd
- All Superinterfaces:
- 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.
Default Error View Name:
- CheckTASpendingLimitErrorView (This is the default ErrorViewName if none is passed into the command.)
ErrorCodes:
Field Summary |
static java.lang.String |
COPYRIGHT
IBM copyright notice field. |
static java.lang.String |
defaultCommandClassName
The default implementation class. |
static java.lang.String |
ERRTASK_NAME
Name of the default error view for this command. |
static java.lang.String |
NAME
The name of this command. |
COPYRIGHT
public static final java.lang.String COPYRIGHT
- IBM copyright notice field.
- See Also:
- Constant Field Values
NAME
public static final java.lang.String NAME
- The name of this command.
- See Also:
- Constant Field Values
defaultCommandClassName
public static final java.lang.String defaultCommandClassName
- The default implementation class.
- See Also:
- Constant Field Values
ERRTASK_NAME
public static final java.lang.String ERRTASK_NAME
- Name of the default error view for this command. The constant value of this field is "CheckSpendingLimitErrorView".
- See Also:
- Constant Field Values
setErrorViewName
public void setErrorViewName(java.lang.String sEVN)
- Sets the error view to be used to report error.
-
- Parameters:
- sEVN - the Error View name
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 totalAmount property of the command.
-
- Parameters:
- nTotalAmount - the amount to be checked
Feedback
(C) Copyright IBM Corporation 1996, 2005. All Rights Reserved.