|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.commerce.claimable.ClaimableManager
public class ClaimableManager
This class is intended to encapsulate all of the business logic needed to interact with the claimable repository. For example, this knows how to create, initialize and delete items that exist in the repository. Right now, the two types of claimable items that it can deal with are:
This class uses the ClaimableTools package to interact with the claimable repository on a lower level.
ClaimableTools
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
protected static java.lang.String |
INVALID_GIFTCERT_ID_PARAMETER
|
protected static java.lang.String |
INVALID_INITIAL_GIFTCERTIFICATE_PARAMETER
|
protected static java.lang.String |
INVALID_INITIAL_PROMOTION_PARAMETER
|
protected static java.lang.String |
INVALID_STORECREDIT_ID_PARAMETER
|
protected static java.lang.String |
MAX_COUPON_REMOVE_LRU
|
protected static java.lang.String |
MAX_COUPON_REMOVE_MRU
|
protected static java.lang.String |
MAX_COUPON_THROW_EX
|
protected static java.lang.String |
MSG_INSUFFICIENT_AUTH
|
protected static java.lang.String |
MSG_INSUFFICIENT_AUTH_FOR_DEBIT
|
protected static java.lang.String |
MSG_INSUFFICIENT_CRED
|
protected static java.lang.String |
MSG_INSUFFICIENT_EXP_AMT
|
protected static java.lang.String |
MSG_INSUFFICIENT_FUNDS
|
protected static java.lang.String |
MSG_INSUFFICIENT_SC_AUTH
|
protected static java.lang.String |
MSG_INSUFFICIENT_SC_AUTH_FOR_DEBIT
|
protected static java.lang.String |
MSG_INSUFFICIENT_SC_CRED
|
protected static java.lang.String |
MSG_INSUFFICIENT_SC_EXP_AMT
|
protected static java.lang.String |
MSG_INSUFFICIENT_SC_FUNDS
|
protected static java.lang.String |
MSG_UNABLE_TO_CLAIM
|
protected static java.util.ResourceBundle |
sPromotionResourceBundle
Promotion Resource Bundle Used in claimCoupon for backwards
compatibility |
protected static java.util.ResourceBundle |
sResourceBundle
Resource Bundle |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
ClaimableManager()
Empty Constructor |
Method Summary | |
---|---|
void |
authorizeClaimableGiftCertificate(java.lang.String pClaimableGiftCertificateId,
double pAmount)
This method will authorize a gift certificate for the amount identified by the parameter pAmount. |
void |
authorizeClaimableGiftCertificate(java.lang.String pClaimableGiftCertificateId,
java.lang.Double pAmount)
Deprecated. use authorizeClaimableGiftCertificate(String, double) instead |
void |
authorizeClaimableStoreCredit(java.lang.String pClaimableStoreCreditId,
double pAmount)
This method will authorize a store credit for the amount identified by the parameter pAmount. |
boolean |
canClaim(java.lang.String pId)
Checks to see if the item with the specified repository id can be claimed. |
boolean |
canClaimCoupon(java.lang.String pProfileId,
java.lang.String pCouponId)
Checks to see if the user with the specified profile id can claim the coupon with the specified coupon id. |
boolean |
canClaimCoupon(java.lang.String pProfileId,
java.lang.String pCouponId,
boolean pCheckCouponLimits)
Checks to see if the user with the specified profile id can claim the coupon with the specified coupon id. |
boolean |
checkBeforeStartDate(RepositoryItem pClaimableItem)
Check whether the ClaimableItem is before the start date, it is expected that the passed in pClaimableItem is not null. |
boolean |
checkClaimableDates(RepositoryItem pClaimableItem)
Check whether the ClaimableItem is valid for the current date, it is expected that the passed in pClaimableItem is not null. |
boolean |
checkClaimableUses(RepositoryItem pClaimableItem)
Check whether the ClaimableItem has remaining uses or not |
boolean |
checkCouponSite(RepositoryItem pCoupon)
Checks to see if the coupon is valid for the current site. |
boolean |
checkExpireDate(RepositoryItem pClaimableItem)
Check whether the ClaimableItem is expired or not, it is expected that the passed in pClaimableItem is not null. |
boolean |
checkMaxCouponLimit(java.util.Map<RepositoryItem,java.util.Set<RepositoryItem>> pCouponPromoStatuses,
RepositoryItem pProfile)
This method assumes a coupon is attempting to be claimed. |
boolean |
checkPromotionType(RepositoryItem pCoupon)
Checks to see if the type of the promotion is valid. |
void |
claimCoupon(java.lang.String pProfileId,
java.lang.String pCouponClaimCode)
This method will attempt to claim the given coupon for the given user. |
RepositoryItem |
claimItem(RepositoryItem pClaimedItem)
Takes a claimed item and adjusts its status to Claimed if the promotion type is valid and the coupon can be claimed on the current site. |
RepositoryItem |
claimItem(java.lang.String pId)
This method will claim an item from the repository. |
RepositoryItem[] |
claimItems(java.lang.String[] pIds)
Same as the claimItem method except can take an array argument. |
RepositoryItem |
createBatchPromotionClaimable(java.lang.String pCouponCode,
RepositoryItem pCouponBatch)
Creates a new batchPromotionClaimable item given the coupon claim code and the batch coupon. |
RepositoryItem |
createClaimableGiftCertificate()
Will create a gift certificate in the claimable repository. |
RepositoryItem |
createClaimablePromotion()
Will create a coupon in the claimable repository. |
RepositoryItem |
createClaimableStoreCredit()
Will create a store credit in the claimable repository. |
RepositoryItem |
createCoupon(java.util.Set<RepositoryItem> pPromotionList,
java.lang.String pDisplayName,
java.lang.Boolean pUsePromotionSiteConstraint)
Creates a new coupon. |
RepositoryItem |
createTransientClaimableStoreCredit()
This method will create a transient store credit in the claimable repository. |
void |
creditClaimableGiftCertificate(java.lang.String pClaimableGiftCertificateId,
double pAmount)
This method will credit a gift certificate for the amount identified by the parameter pAmount. |
void |
creditClaimableGiftCertificate(java.lang.String pClaimableGiftCertificateId,
java.lang.Double pAmount)
Deprecated. use creditClaimableGiftCertificate(String, double) instead |
void |
creditClaimableStoreCredit(java.lang.String pClaimableStoreCreditId,
double pAmount)
This method will credit a store credit for the amount identified by the parameter pAmount. |
void |
debitClaimableGiftCertificate(java.lang.String pClaimableGiftCertificateId,
double pAmount)
This method will debit a gift certificate for the amount identified by the parameter pAmount. |
void |
debitClaimableGiftCertificate(java.lang.String pClaimableGiftCertificateId,
java.lang.Double pAmount)
Deprecated. use debitClaimableGiftCertificate(String, double) instead |
void |
debitClaimableStoreCredit(java.lang.String pClaimableStoreCreditId,
double pAmount)
This method will debit a store credit for the amount identified by the parameter pAmount. |
void |
decreaseAuthorizationForClaimableGiftCertificate(java.lang.String pClaimableGiftCertificateId,
double pAmount)
Decreases the authorized amount for the gift certificate by the given amount |
void |
decreaseAuthorizationForClaimableStoreCredit(java.lang.String pClaimableStoreCreditId,
double pAmount)
Decreases the authorized amount for the store credit by the given amount |
void |
expireGiftCertificateAuthorization(java.lang.String pClaimableGiftCertificateId,
double pAmount)
This method will expire a gift certificate authorization for the amount identified by the parameter pAmount. |
void |
expireStoreCreditAuthorization(java.lang.String pClaimableStoreCreditId,
double pAmount)
This method will expire a store credit authorization for the amount identified by the parameter pAmount. |
RepositoryItem |
findAndClaimCoupon(java.lang.String pCouponClaimCode)
Claims a coupon and returns it. |
RepositoryItem |
findAndClaimCouponBatch(java.lang.String pCouponClaimCode)
Claims a batch coupon and returns it. |
ClaimableTools |
getClaimableTools()
Return the claimableTools property. |
atg.commerce.claimable.CouponBatchTools |
getCouponBatchTools()
Return the couponBatchTools property. |
CurrentDate |
getCurrentDate()
Get the current date |
protected RepositoryItem |
getFirstCouponInStatus(java.util.Map<RepositoryItem,java.util.Set<RepositoryItem>> pCouponPromoStatuses,
RepositoryItem pProfile)
This method gets the first coupon in the promoStatuses |
java.util.List |
getGiftCertificatesForProfile(java.lang.String pProfileId)
Returns a List of gift certificate repository items which belong to the user with the profile id in pProfileId. |
java.util.List |
getGiftCertificatesForProfile(java.lang.String pProfileId,
boolean pReturnAll)
Returns a List of gift certificate repository items which belong to the user with the profile id in pProfileId. |
java.lang.String |
getMaxCouponLimitReachedAction()
Get the action when a coupon claim limit has been reached |
int |
getMaxCouponsPerProfile()
Get the number of coupons allowed per Profile |
PricingTools |
getPricingTools()
The PricingTools class is used to round intermediate values |
PromotionTools |
getPromotionTools()
Return the PromotionTools property. |
java.util.List |
getStoreCreditsForProfile(java.lang.String pProfileId)
Returns a List of store credit repository items which belong to the user with the profile id in pProfileId. |
java.util.List |
getStoreCreditsForProfile(java.lang.String pProfileId,
boolean pReturnAll)
Returns a List of store credit repository items which belong to the user with the profile id in pProfileId. |
javax.transaction.TransactionManager |
getTransactionManager()
The TransactionManager |
java.lang.String[] |
getValidCouponItemTypes()
The list of acceptable item types for promotions when claiming a coupon. |
java.lang.String[] |
getValidMaxCouponLimitReachedActions()
Get the list of acceptable actions when a coupon claim limit has been reached |
void |
handleMaxCouponLimitReached(java.util.Map<RepositoryItem,java.util.Set<RepositoryItem>> pCouponPromoStatuses,
MutableRepositoryItem pProfile)
This method will handle the various ways to handle when a maximum coupon per order limit has been reached. |
void |
initializeClaimableGiftCertificate(RepositoryItem pClaimableGiftCertificate,
double pAmount,
double pAmountRemaining,
java.lang.String pPurchaserId,
java.util.Date pPurchaseDate)
This will initialize a gift certificates values to be the parameters passed in. |
void |
initializeClaimableGiftCertificate(RepositoryItem pClaimableGiftCertificate,
java.lang.Double pAmount,
java.lang.Double pAmountRemaining,
java.lang.String pPurchaserId,
java.util.Date pPurchaseDate)
Deprecated. use initializeClaimableGiftCertificate(RepositoryItem, double, double, String, Date) instead |
void |
initializeClaimablePromotion(RepositoryItem pClaimablePromotion,
RepositoryItem pPromotion)
This will initialize a claimable promotion (coupon) by setting the promotion property of the coupon to be the parameter pPromotion. |
void |
initializeClaimablePromotion(RepositoryItem pClaimablePromotion,
java.util.Set<RepositoryItem> pPromotionList)
This will initialize a claimable promotion (coupon) by setting the promotion property of the coupon to be the parameter pPromotion. |
void |
initializeClaimablePromotion(RepositoryItem pClaimablePromotion,
java.util.Set<RepositoryItem> pPromotionList,
java.lang.String pDisplayName,
java.lang.Boolean pRedeemableOnPromotionSites)
This will initialize a claimable promotion (coupon) by setting the promotion property of the coupon to be the parameter pPromotion. |
void |
initializeClaimableStoreCredit(RepositoryItem pClaimableStoreCredit,
double pAmount,
double pAmountRemaining,
java.lang.String pOwnerId,
java.util.Date pExpirationDate)
This will initialize store credit values to be the parameters passed in. |
boolean |
isMaxCouponLimitReachedThrowException()
This checks both to see of the limit has been reached and if it is configured to throw an exception |
void |
persistTransientClaimableItem(RepositoryItem pClaimableItem)
This method calls the claimable tools component to persist the claimable item into the repository. |
void |
setClaimableTools(ClaimableTools pClaimableTools)
Set the claimableTools property. |
void |
setCouponBatchTools(atg.commerce.claimable.CouponBatchTools pCouponBatchTools)
Set the couponBatchTools property. |
void |
setCurrentDate(CurrentDate pCurrentDate)
Set current date |
void |
setMaxCouponLimitReachedAction(java.lang.String pMaxCouponLimitReachedAction)
Set the action when a coupon claim limit has been reached |
void |
setMaxCouponsPerProfile(int pMaxCouponsPerProfile)
Set the maximum number of coupons allowed per Profile |
void |
setPricingTools(PricingTools pPricingTools)
|
void |
setPromotionTools(PromotionTools pPromotionTools)
Set the PromotionTools property. |
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Set the TransactionManager property. |
void |
setValidCouponItemTypes(java.lang.String[] pValidCouponItemTypes)
|
void |
setValidMaxCouponLimitReachedActions(java.lang.String[] pValidMaxCouponLimitReachedActions)
Set the list of acceptable actions when a coupon claim limit has been reached |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
protected static java.util.ResourceBundle sResourceBundle
protected static java.util.ResourceBundle sPromotionResourceBundle
claimCoupon
for backwards
compatibility
protected static final java.lang.String INVALID_GIFTCERT_ID_PARAMETER
protected static final java.lang.String INVALID_STORECREDIT_ID_PARAMETER
protected static final java.lang.String INVALID_INITIAL_PROMOTION_PARAMETER
protected static final java.lang.String INVALID_INITIAL_GIFTCERTIFICATE_PARAMETER
protected static final java.lang.String MSG_UNABLE_TO_CLAIM
protected static final java.lang.String MSG_INSUFFICIENT_FUNDS
protected static final java.lang.String MSG_INSUFFICIENT_AUTH
protected static final java.lang.String MSG_INSUFFICIENT_CRED
protected static final java.lang.String MSG_INSUFFICIENT_EXP_AMT
protected static final java.lang.String MSG_INSUFFICIENT_AUTH_FOR_DEBIT
protected static final java.lang.String MSG_INSUFFICIENT_SC_FUNDS
protected static final java.lang.String MSG_INSUFFICIENT_SC_AUTH
protected static final java.lang.String MSG_INSUFFICIENT_SC_CRED
protected static final java.lang.String MSG_INSUFFICIENT_SC_EXP_AMT
protected static final java.lang.String MSG_INSUFFICIENT_SC_AUTH_FOR_DEBIT
protected static final java.lang.String MAX_COUPON_THROW_EX
protected static final java.lang.String MAX_COUPON_REMOVE_LRU
protected static final java.lang.String MAX_COUPON_REMOVE_MRU
Constructor Detail |
---|
public ClaimableManager()
Method Detail |
---|
public int getMaxCouponsPerProfile()
public void setMaxCouponsPerProfile(int pMaxCouponsPerProfile)
pMaxCouponsPerProfile
- public void setClaimableTools(ClaimableTools pClaimableTools)
public ClaimableTools getClaimableTools()
public void setCouponBatchTools(atg.commerce.claimable.CouponBatchTools pCouponBatchTools)
public atg.commerce.claimable.CouponBatchTools getCouponBatchTools()
public void setPricingTools(PricingTools pPricingTools)
public PricingTools getPricingTools()
public void setPromotionTools(PromotionTools pPromotionTools)
public PromotionTools getPromotionTools()
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public javax.transaction.TransactionManager getTransactionManager()
public void setValidCouponItemTypes(java.lang.String[] pValidCouponItemTypes)
public java.lang.String[] getValidCouponItemTypes()
handleClaimCoupon
public void setValidMaxCouponLimitReachedActions(java.lang.String[] pValidMaxCouponLimitReachedActions)
pValidMaxCouponLimitReachedActions
- list of acceptable actions when a coupon claim limit has been reachedpublic java.lang.String[] getValidMaxCouponLimitReachedActions()
public void setMaxCouponLimitReachedAction(java.lang.String pMaxCouponLimitReachedAction)
pMaxCouponLimitReachedAction
- action when a coupon claim limit has been reachedpublic java.lang.String getMaxCouponLimitReachedAction()
public void setCurrentDate(CurrentDate pCurrentDate)
pCurrentDate
- the nucleus date componentpublic CurrentDate getCurrentDate()
public boolean canClaim(java.lang.String pId) throws ClaimableException
pId
- the repository id of the item to be claimed.
ClaimableException
- if an error occurspublic boolean canClaimCoupon(java.lang.String pProfileId, java.lang.String pCouponId, boolean pCheckCouponLimits) throws ClaimableException
pProfileId
- the profile id of the user claiming the couponpCouponId
- the coupon id of the coupon to be claimed
ClaimableException
- if an error occurspublic boolean canClaimCoupon(java.lang.String pProfileId, java.lang.String pCouponId) throws ClaimableException
pProfileId
- the profile id of the user claiming the couponpCouponId
- the coupon id of the coupon to be claimed
ClaimableException
- if an error occurspublic RepositoryItem claimItem(java.lang.String pId) throws ClaimableException
To claim the item, the methods provided by the ClaimableTools package will be used.
pId
- the repository id of the item to be claimed.
ClaimableException
- if an error occurspublic RepositoryItem claimItem(RepositoryItem pClaimedItem) throws ClaimableException
To adjust the status, the methods provided by the ClaimableTools package will be used.
pClaimedItem
- the item to be claimed.
ClaimableException
- if an error occurspublic RepositoryItem[] claimItems(java.lang.String[] pIds) throws ClaimableException
pIds
- a value of type 'String[]'
ClaimableException
- if an error occurspublic RepositoryItem createClaimableGiftCertificate() throws ClaimableException
ClaimableException
- if an error occurspublic RepositoryItem createClaimablePromotion() throws ClaimableException
ClaimableException
- if an error occurspublic RepositoryItem createClaimableStoreCredit() throws ClaimableException
ClaimableException
- if an error occurspublic RepositoryItem createTransientClaimableStoreCredit() throws ClaimableException
ClaimableException
- if an error occurspublic void initializeClaimablePromotion(RepositoryItem pClaimablePromotion, RepositoryItem pPromotion) throws CommerceException
The promotion property of the ClaimablePromotion is identified by by the getPromotionPropertyName method of ClaimableTools.
pClaimablePromotion
- the coupon to be updatedpPromotion
- the promotion that will be associated witht he coupon
CommerceException
- if an error occurspublic void initializeClaimablePromotion(RepositoryItem pClaimablePromotion, java.util.Set<RepositoryItem> pPromotionList, java.lang.String pDisplayName, java.lang.Boolean pRedeemableOnPromotionSites) throws CommerceException
The promotion property of the ClaimablePromotion is identified by by the getPromotionPropertyName method of ClaimableTools.
pClaimablePromotion
- the coupon to be updatedpPromotionList
- the list of promotion that will be associated with the couponpDisplayName
- the display name for the couponpRedeemableOnPromotionSites
-
CommerceException
- if an error occurspublic void initializeClaimablePromotion(RepositoryItem pClaimablePromotion, java.util.Set<RepositoryItem> pPromotionList) throws CommerceException
The promotion property of the ClaimablePromotion is identified by by the getPromotionPropertyName method of ClaimableTools.
pClaimablePromotion
- the coupon to be updatedpPromotionList
- the list of promotions that will be associated with the coupon
CommerceException
CommerceException
- if an error occurspublic void initializeClaimableGiftCertificate(RepositoryItem pClaimableGiftCertificate, java.lang.Double pAmount, java.lang.Double pAmountRemaining, java.lang.String pPurchaserId, java.util.Date pPurchaseDate) throws CommerceException
pClaimableGiftCertificate
- the giftCertificate whose properties will be updatedpAmount
- the amount that the gift certificate will be set topAmountRemaining
- the amount remaining on the gift certificatepPurchaserId
- id of the person purchasing the gift certificatepPurchaseDate
- the date that the gift certificate was purchased on
CommerceException
- if an error occurspublic void initializeClaimableGiftCertificate(RepositoryItem pClaimableGiftCertificate, double pAmount, double pAmountRemaining, java.lang.String pPurchaserId, java.util.Date pPurchaseDate) throws CommerceException
pClaimableGiftCertificate
- the giftCertificate whose properties will be updatedpAmount
- the amount that the gift certificate will be set topAmountRemaining
- the amount remaining on the gift certificatepPurchaserId
- id of the person purchasing the gift certificatepPurchaseDate
- the date that the gift certificate was purchased on
CommerceException
- if an error occurspublic void initializeClaimableStoreCredit(RepositoryItem pClaimableStoreCredit, double pAmount, double pAmountRemaining, java.lang.String pOwnerId, java.util.Date pExpirationDate) throws CommerceException
pClaimableStoreCredit
- the store credit whose properties will be updatedpAmount
- the amount that the store credit will be set topAmountRemaining
- the amount remaining on the store creditpOwnerId
- id of the person the store credit belongs topExpirationDate
- the expiration date of the store credit, can be null which means
the credit never expires
CommerceException
- if an error occurspublic java.util.List getStoreCreditsForProfile(java.lang.String pProfileId) throws CommerceException
pProfileId
- the profile id of the user to retrieve the StoreCredits for
if
- an exception occurs while executing the query
CommerceException
public java.util.List getStoreCreditsForProfile(java.lang.String pProfileId, boolean pReturnAll) throws CommerceException
pProfileId
- the profile id of the user to retrieve the StoreCredits forpReturnAll
- return all store credits vs the store credits which still have
money left on them
if
- an exception occurs while executing the query
CommerceException
public java.util.List getGiftCertificatesForProfile(java.lang.String pProfileId) throws CommerceException
pProfileId
- the profile id of the user to retrieve the GiftCertificates for
if
- an exception occurs while executing the query
CommerceException
public java.util.List getGiftCertificatesForProfile(java.lang.String pProfileId, boolean pReturnAll) throws CommerceException
pProfileId
- the profile id of the user to retrieve the GiftCertificates forpReturnAll
- return all gift certificates vs the gift certificates which still
have money left on them
if
- an exception occurs while executing the query
CommerceException
public void authorizeClaimableGiftCertificate(java.lang.String pClaimableGiftCertificateId, java.lang.Double pAmount) throws InvalidParameterException, ClaimableException, RepositoryException
If the giftCertificate parameter is either null, or can't be claimed then a InvalidParameterException will be thrown.
pClaimableGiftCertificateId
- the id of the gift certificate to adjustpAmount
- the amount to credit to the gift certificate
InvalidParameterException
- if an error occurs
ClaimableException
- if an error occurs
RepositoryException
- if an error occurspublic void authorizeClaimableGiftCertificate(java.lang.String pClaimableGiftCertificateId, double pAmount) throws InvalidParameterException, ClaimableException, RepositoryException
If the giftCertificate parameter is either null, or can't be claimed then a InvalidParameterException will be thrown.
pClaimableGiftCertificateId
- the id of the gift certificate to adjustpAmount
- the amount to authorize to the gift certificate
InvalidParameterException
- if an error occurs
ClaimableException
- if an error occurs
RepositoryException
- if an error occurspublic void decreaseAuthorizationForClaimableGiftCertificate(java.lang.String pClaimableGiftCertificateId, double pAmount) throws InvalidParameterException, ClaimableException, RepositoryException
pClaimableGiftCertificateId
- pAmount
-
InvalidParameterException
ClaimableException
RepositoryException
public void decreaseAuthorizationForClaimableStoreCredit(java.lang.String pClaimableStoreCreditId, double pAmount) throws InvalidParameterException, ClaimableException, RepositoryException
pClaimableStoreCreditId
- pAmount
-
InvalidParameterException
ClaimableException
RepositoryException
public void authorizeClaimableStoreCredit(java.lang.String pClaimableStoreCreditId, double pAmount) throws InvalidParameterException, ClaimableException, RepositoryException
If the store credit parameter is either null, or can't be claimed then a InvalidParameterException will be thrown.
pClaimableStoreCreditId
- the id of the store credit to adjustpAmount
- the amount to authorize to the store credit
InvalidParameterException
- if an error occurs
ClaimableException
- if an error occurs
RepositoryException
- if an error occurspublic void expireGiftCertificateAuthorization(java.lang.String pClaimableGiftCertificateId, double pAmount) throws InvalidParameterException, ClaimableException, InsufficientFundsException, RepositoryException
If the giftCertificate parameter is either null, or can't be claimed then a InvalidParameterException will be thrown.
pClaimableGiftCertificateId
- the id of the gift certificate to adjustpAmount
- the amount to debit to the gift certificate
InvalidParameterException
- if an error occurs
ClaimableException
- if an error occurs
RepositoryException
- if an error occurs
InsufficientFundsException
- if the amount remaing is less then the pAmount.public void expireStoreCreditAuthorization(java.lang.String pClaimableStoreCreditId, double pAmount) throws InvalidParameterException, ClaimableException, InsufficientFundsException, RepositoryException
If the storeCredit parameter is either null, or can't be claimed then a InvalidParameterException will be thrown.
pClaimableStoreCreditId
- the id of the store credit to adjustpAmount
- the amount to expire from the store credit authorization
InvalidParameterException
- if an error occurs
ClaimableException
- if an error occurs
RepositoryException
- if an error occurs
InsufficientFundsException
- if the amount remaining is less then the pAmount.public void creditClaimableGiftCertificate(java.lang.String pClaimableGiftCertificateId, java.lang.Double pAmount) throws InvalidParameterException, ClaimableException, InsufficientFundsException, RepositoryException
If the giftCertificate parameter is either null, or can't be claimed then a InvalidParameterException will be thrown.
pClaimableGiftCertificateId
- the id of the gift certificate to adjustpAmount
- the amount to credit to the gift certificate
InvalidParameterException
- if an error occurs
ClaimableException
- if an error occurs
RepositoryException
- if an error occurs
InsufficientFundsException
public void creditClaimableGiftCertificate(java.lang.String pClaimableGiftCertificateId, double pAmount) throws InvalidParameterException, ClaimableException, InsufficientFundsException, RepositoryException
If the giftCertificate parameter is either null, or can't be claimed then a InvalidParameterException will be thrown.
pClaimableGiftCertificateId
- the id of the gift certificate to adjustpAmount
- the amount to credit to the gift certificate
InvalidParameterException
- if an error occurs
ClaimableException
- if an error occurs
RepositoryException
- if an error occurs
InsufficientFundsException
public void creditClaimableStoreCredit(java.lang.String pClaimableStoreCreditId, double pAmount) throws InvalidParameterException, ClaimableException, InsufficientFundsException, RepositoryException
If the storeCredit parameter is either null, or can't be claimed then a InvalidParameterException will be thrown.
pClaimableStoreCreditId
- the id of the store credit to adjustpAmount
- the amount to credit to the store credit
InvalidParameterException
- if an error occurs
ClaimableException
- if an error occurs
RepositoryException
- if an error occurs
InsufficientFundsException
public void debitClaimableGiftCertificate(java.lang.String pClaimableGiftCertificateId, java.lang.Double pAmount) throws InvalidParameterException, ClaimableException, InsufficientFundsException, RepositoryException
If the giftCertificate parameter is either null, or can't be claimed then a InvalidParameterException will be thrown.
pClaimableGiftCertificateId
- the id of the gift certificate to adjustpAmount
- the amount to debit to the gift certificate
InvalidParameterException
- if an error occurs
ClaimableException
- if an error occurs
RepositoryException
- if an error occurs
InsufficientFundsException
- if the amount remaing is less then the pAmount.public void debitClaimableGiftCertificate(java.lang.String pClaimableGiftCertificateId, double pAmount) throws InvalidParameterException, ClaimableException, InsufficientFundsException, RepositoryException
If the giftCertificate parameter is either null, or can't be claimed then a InvalidParameterException will be thrown.
pClaimableGiftCertificateId
- the id of the gift certificate to adjustpAmount
- the amount to debit to the gift certificate
InvalidParameterException
- if an error occurs
ClaimableException
- if an error occurs
RepositoryException
- if an error occurs
InsufficientFundsException
- if the amount remaing is less then the pAmount.public void debitClaimableStoreCredit(java.lang.String pClaimableStoreCreditId, double pAmount) throws InvalidParameterException, ClaimableException, InsufficientFundsException, RepositoryException
If the storeCredit parameter is either null, or can't be claimed then a InvalidParameterException will be thrown.
pClaimableStoreCreditId
- the id of the store credit to adjustpAmount
- the amount to debit to the store credit
InvalidParameterException
- if an error occurs
ClaimableException
- if an error occurs
RepositoryException
- if an error occurs
InsufficientFundsException
- if the amount remaing is less then the pAmount.public boolean checkExpireDate(RepositoryItem pClaimableItem)
pClaimableItem
- the item to be claimed.
public boolean checkBeforeStartDate(RepositoryItem pClaimableItem)
pClaimableItem
- the item to be claimed
public boolean checkClaimableDates(RepositoryItem pClaimableItem)
pClaimableItem
- the item to be claimed
public boolean checkClaimableUses(RepositoryItem pClaimableItem)
pClaimableItem
- the item to be claimed
public boolean checkPromotionType(RepositoryItem pCoupon)
validCouponItemTypes
pCoupon
-
validCouponItemTypes
list.public boolean checkCouponSite(RepositoryItem pCoupon)
pCoupon
-
public void claimCoupon(java.lang.String pProfileId, java.lang.String pCouponClaimCode) throws ClaimableException
findAndClaimCoupon
, then, if necessary,
updates the given profile's active promotions and initializes the pricing
model holder.
pProfileId
- The profile making the claimpCouponClaimCode
- The claim code of the coupon
ClaimableException
- Thrown on any problemsfindAndClaimCoupon(String)
,
PromotionTools.addPromotion(MutableRepositoryItem, RepositoryItem,
String)
,
PromotionTools.initializePricingModels()
public RepositoryItem findAndClaimCoupon(java.lang.String pCouponClaimCode) throws ClaimableException
If the coupon has expired or is not for the current site, a ClaimableException is thrown
pCouponClaimCode
-
ClaimableException
RepositoryException
atg.commerce.promotion.PromotionException
claimItem(String)
,
checkExpireDate(RepositoryItem)
public RepositoryItem findAndClaimCouponBatch(java.lang.String pCouponClaimCode) throws ClaimableException
pCouponClaimCode
- the coupon's claim code
ClaimableException
protected RepositoryItem getFirstCouponInStatus(java.util.Map<RepositoryItem,java.util.Set<RepositoryItem>> pCouponPromoStatuses, RepositoryItem pProfile) throws RepositoryException
pCouponPromoStatuses
- pProfile
-
RepositoryException
public boolean checkMaxCouponLimit(java.util.Map<RepositoryItem,java.util.Set<RepositoryItem>> pCouponPromoStatuses, RepositoryItem pProfile) throws RepositoryException
pProfile
- the profile of the user that is claiming the coupon
ClaimableException
RepositoryException
atg.commerce.promotion.PromotionException
public RepositoryItem createBatchPromotionClaimable(java.lang.String pCouponCode, RepositoryItem pCouponBatch) throws CommerceException
pCouponCode
- The coupon claim codepCouponBatch
- The batch coupon item this coupon claim code is for
CommerceException
public boolean isMaxCouponLimitReachedThrowException()
ClaimableException
public void handleMaxCouponLimitReached(java.util.Map<RepositoryItem,java.util.Set<RepositoryItem>> pCouponPromoStatuses, MutableRepositoryItem pProfile) throws ClaimableException
pCouponPromoStatuses
- pProfile
-
ClaimableException
public void persistTransientClaimableItem(RepositoryItem pClaimableItem) throws ClaimableException
pClaimableItem
-
ClaimableException
public RepositoryItem createCoupon(java.util.Set<RepositoryItem> pPromotionList, java.lang.String pDisplayName, java.lang.Boolean pUsePromotionSiteConstraint) throws ClaimableException
pPromotionList
- the list of promotion objectspDisplayName
- the display name for the couponpUsePromotionSiteConstraint
-
CommerceException
- if an error occurs
ClaimableException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |