public class CSRPaymentGroupRemainingAmount
extends atg.servlet.DynamoServlet
This droplet is used in the billing, order view, order review pages and email display the remaining amount.
Also this droplet is used to enforce a maximum allowed amount limitation in the billing page.
The max allowed amount is served as parameter to serve a special need in the billing page. In the billing page
For a payment group, the user can enter any amount. But for the PaymentGroup backed by the claimable item,
the user can't enter more than the remaining or max allowed amount item.
Let us assume that user created an order for $1000.00 and used a store credit $200.00 (but the total amount on the store
credit is $500.00). Out of the $500.00, for this order the user used up $200.00 and paid the remaining with a
credit card. After assigning right amount for the order, the user submitted the order. Then after submitting the order, the user wanted
to edit the same order, added more items and to pay with the store credit. Technically the remaining amount on this store credit is
$300.00, but the maximum allowed amount that the user can enter in the text box could be up to $500.00. This parameter is to satisfy both use
cases such as new order and order modification.
This droplet could be customized to return the remaining and maximum allowed amount for additional payment group types.
Currently this droplet is used to get the remaining and maximum allowed amount for Store Credit and Gift Certificate.
This droplet takes in payment group and order as input parameters.
The parameters to the PaymentGroupRemainingAmount droplet are:
PaymentGroup
remaining amount that is backedgetRemainingAmount(PaymentGroup, Order)
.
getMaxAllowedAmount(double, PaymentGroup, Order)
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION |
static java.lang.String |
MAX_ALLOWED_AMOUNT |
protected atg.commerce.claimable.ClaimableManager |
mClaimableManager |
protected CSRAgentTools |
mCSRAgentTools |
static java.lang.String |
MY_RESOURCE_NAME |
static double |
NO_LIMIT |
static atg.nucleus.naming.ParameterName |
ORDER |
static atg.nucleus.naming.ParameterName |
OUTPUT |
static atg.nucleus.naming.ParameterName |
PAYMENT_GROUP |
static java.lang.String |
REMAINING_AMOUNT |
Constructor and Description |
---|
CSRPaymentGroupRemainingAmount() |
Modifier and Type | Method and Description |
---|---|
atg.commerce.claimable.ClaimableManager |
getClaimableManager()
Returns the claimableManager
|
CSRAgentTools |
getCSRAgentTools()
Returns the CSRAgentTools
|
protected double |
getMaxAllowedAmount(double pRemainingAmount,
atg.commerce.order.PaymentGroup pPaymentGroup,
atg.commerce.order.Order pOrder)
This method returns the maximum allowed amount for a payment group.
|
protected atg.commerce.order.Order |
getOrder(atg.servlet.DynamoHttpServletRequest pRequest)
This method gets the
Order from the request. |
protected atg.commerce.order.PaymentGroup |
getPaymentGroup(atg.servlet.DynamoHttpServletRequest pRequest)
This method gets the
PaymentGroup from the request. |
double |
getRemainingAmount(atg.commerce.order.PaymentGroup pPaymentGroup,
atg.commerce.order.Order pOrder)
This method only returns the remaining amount for the Store Credit and Gift Certificate.
|
void |
service(atg.servlet.DynamoHttpServletRequest pRequest,
atg.servlet.DynamoHttpServletResponse pResponse)
This method first calls
getRemainingAmount(PaymentGroup, Order) to determine the payment group's remaining amountand then it calls the getMaxAllowedAmount(double, PaymentGroup, Order) to compute the maximum allowed amount. |
void |
setClaimableManager(atg.commerce.claimable.ClaimableManager pClaimableManager)
Sets the claimableManager
|
void |
setCSRAgentTools(CSRAgentTools pAgentTools)
Sets the CSRAgentTools
|
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, init, service, service, setParameter
destroy, getServletConfig, getServletInfo, setServletInfo
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static java.lang.String CLASS_VERSION
public static final java.lang.String MY_RESOURCE_NAME
public static final atg.nucleus.naming.ParameterName PAYMENT_GROUP
public static final atg.nucleus.naming.ParameterName ORDER
public static final atg.nucleus.naming.ParameterName OUTPUT
public static final java.lang.String REMAINING_AMOUNT
public static final java.lang.String MAX_ALLOWED_AMOUNT
public static final double NO_LIMIT
protected atg.commerce.claimable.ClaimableManager mClaimableManager
protected CSRAgentTools mCSRAgentTools
public atg.commerce.claimable.ClaimableManager getClaimableManager()
public void setClaimableManager(atg.commerce.claimable.ClaimableManager pClaimableManager)
pClaimableManager
- the claimableManager to setpublic CSRAgentTools getCSRAgentTools()
public void setCSRAgentTools(CSRAgentTools pAgentTools)
pAgentTools
- the CSRAgentTools to setpublic void service(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
getRemainingAmount(PaymentGroup, Order)
to determine the payment group's remaining amountgetMaxAllowedAmount(double, PaymentGroup, Order)
to compute the maximum allowed amount.
After computing the remaining and maximum allowed amount, both parameters are served with the output
oparam.
service
in class atg.servlet.DynamoServlet
pRequest
- the HTTP requestpResponse
- the HTTP responsejavax.servlet.ServletException
java.io.IOException
protected double getMaxAllowedAmount(double pRemainingAmount, atg.commerce.order.PaymentGroup pPaymentGroup, atg.commerce.order.Order pOrder) throws atg.commerce.CommerceException
The maximum allowed amount is used in the billing page. In the billing page the user
can enter the maximum allowed amount for any payment group. This amount is used to restrict the
user not to enter more than the maximum allowed amount in the text box.
Currently the max allowed amount is used only in the billing page.
The maximum amount is computed as follows:
false
), pRemainingAmount
- the remaining amount of a payment grouppPaymentGroup
- the payment group which is used to calculated the maximum allowed amount.pOrder
- This is provided as an optional parameter. if there is any future need, you may make use this parameter.atg.commerce.CommerceException
public double getRemainingAmount(atg.commerce.order.PaymentGroup pPaymentGroup, atg.commerce.order.Order pOrder) throws atg.commerce.CommerceException
For other payment group type, this method returns -1 (which is considered as no limit).
First this method gets the store credit and gift certificate numbers from the payment group and gets the claimable item,
then method calls CSRAgentTools.getRemainingAmount(RepositoryItem)
to get the
amount for store credits and gift certificate.
pPaymentGroup
- The payment group which is used get the remaining amount. In case of store credit and gift certificatepOrder
- This is provided as an optional parameter. if there is any future need, you may make use this parameter.atg.commerce.CommerceException
CSRAgentTools#getRemainingAmount(RepositoryItem)}
This method is called to get the remaining amount for the claimables.
protected atg.commerce.order.PaymentGroup getPaymentGroup(atg.servlet.DynamoHttpServletRequest pRequest)
PaymentGroup
from the request.PaymentGroup
valueprotected atg.commerce.order.Order getOrder(atg.servlet.DynamoHttpServletRequest pRequest)
Order
from the request.Order
value