Interface VoucherFacade
-
- All Known Implementing Classes:
DefaultCouponFacade,DefaultVoucherFacade
public interface VoucherFacadeVoucher facade interface. Manages applying vouchers to cart and releasing it.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapplyVoucher(java.lang.String voucherCode)Apply voucher to current session cartbooleancheckVoucherCode(java.lang.String voucherCode)Check if voucher code is validVoucherDatagetVoucher(java.lang.String voucherCode)Get voucher base on its codejava.util.List<VoucherData>getVouchersForCart()Get vouchers applied for current session cartvoidreleaseVoucher(java.lang.String voucherCode)Remove voucher from current session cart
-
-
-
Method Detail
-
checkVoucherCode
boolean checkVoucherCode(java.lang.String voucherCode)
Check if voucher code is valid- Parameters:
voucherCode- voucher code- Returns:
- true when voucher code is valid, false when voucher code is invalid
-
getVoucher
VoucherData getVoucher(java.lang.String voucherCode) throws VoucherOperationException
Get voucher base on its code- Parameters:
voucherCode- voucher identifier- Returns:
- the
VoucherData - Throws:
VoucherOperationException- if no voucher with the specified code is foundjava.lang.IllegalArgumentException- if parameter code isnullor empty
-
applyVoucher
void applyVoucher(java.lang.String voucherCode) throws VoucherOperationExceptionApply voucher to current session cart- Parameters:
voucherCode- voucher identifier- Throws:
VoucherOperationException- if voucher wasn't applied due to some problemsjava.lang.IllegalArgumentException- if parameter code isnullor empty
-
releaseVoucher
void releaseVoucher(java.lang.String voucherCode) throws VoucherOperationExceptionRemove voucher from current session cart- Parameters:
voucherCode- voucher identifier- Throws:
VoucherOperationException- if voucher wasn't released due to some problemsjava.lang.IllegalArgumentException- if parameter code isnullor empty
-
getVouchersForCart
java.util.List<VoucherData> getVouchersForCart()
Get vouchers applied for current session cart- Returns:
- list of vouchers applied for current session cart
-
-