Package de.hybris.platform.voucher
Interface VoucherService
- All Known Implementing Classes:
CouponVoucherService,DefaultVoucherService
public interface VoucherService
The service for vouchers.
-
Method Summary
Modifier and TypeMethodDescriptionvoidafterOrderCreation(OrderModel order, CartModel cart) Transfers vouchers form cart to newly created order.booleancreateVoucherInvalidation(String voucherCode, OrderModel order) CreatesVoucherInvalidationafter the voucher is redeemed for the ordervoiddelete(VoucherModel voucher) Searches for all applied vouchers for the specific cartgetAppliedVoucherCodes(OrderModel order) Given the order get a list of applied vouchersgetPromotionVouchers(String voucherCode) given the voucher code get a collection of related promotion vouchersgetSerialVouchers(String voucherCode) given the voucher code get a collection of related serial vouchersgetVoucher(String voucherCode) Get a voucher for a given voucher codebooleanredeemVoucher(String voucherCode, CartModel cart) redeemVoucher(String voucherCode, OrderModel order) voidreleaseVoucher(String voucherCode, CartModel cart) Releases the voucher for the cartvoidreleaseVoucher(String voucherCode, OrderModel order) reserveVoucher(String voucherCode, OrderModel order) voidsave(VoucherModel voucher)
-
Method Details
-
afterOrderCreation
Transfers vouchers form cart to newly created order. Please make sure to call this always afterOrderManager.createOrder(de.hybris.platform.jalo.order.AbstractOrder).- Parameters:
order- the newly created ordercart- the cart which this order has been created from
-
getAllVouchers
Collection<VoucherModel> getAllVouchers()- Returns:
- a Collection with all found
Vouchers
-
getAppliedVoucherCodes
Searches for all applied vouchers for the specific cart- Parameters:
cart- cart for which the vouchers are applied- Returns:
- all applied voucher codes
-
getAppliedVoucherCodes
-
getAppliedVouchers
Given the order get a list of applied vouchers- Parameters:
order- the given order- Returns:
- a Collection with all applied
Vouchers for this order
-
getVoucher
Get a voucher for a given voucher code- Parameters:
voucherCode- the code- Returns:
- the first
Voucherfor the given code. This includesPromotionVoucherandSerialVoucher.
-
getPromotionVouchers
given the voucher code get a collection of related promotion vouchers- Parameters:
voucherCode- the code- Returns:
- a Collection of
PromotionVouchers
-
getSerialVouchers
given the voucher code get a collection of related serial vouchers- Parameters:
voucherCode- the code- Returns:
- a Collection of
SerialVouchers
-
redeemVoucher
- Parameters:
voucherCode- code of the Vouchercart- the cart- Returns:
- true if the redemption was successful
- Throws:
JaloPriceFactoryException- in the case of exception on Jalo layer
-
redeemVoucher
-
createVoucherInvalidation
CreatesVoucherInvalidationafter the voucher is redeemed for the order- Parameters:
voucherCode- voucher code to be redeemedorder- order for which the voucher will be redeemed- Returns:
- true if the voucher has been redeemed for the given order
-
releaseVoucher
Releases the voucher for the cart- Parameters:
voucherCode- voucher code to be releasedcart- cart for which the voucher will be released- Throws:
JaloPriceFactoryException- in the case of exception on jalo layer
-
releaseVoucher
- Throws:
ConsistencyCheckException
-
reserveVoucher
-
save
-
delete
-