public interface CouponCodeGenerationService
| Modifier and Type | Method and Description |
|---|---|
String |
extractCouponPrefix(String couponCode)
tries to find the prefix substring of the given coupon code.
|
String |
generateCouponAlphabet()
generates the alphabet used for a coupon.
|
String |
generateCouponCode(MultiCodeCouponModel coupon)
Generates a code for the given multi code coupon.
|
Optional<MediaModel> |
generateCouponCodes(MultiCodeCouponModel multiCodeCoupon,
int quantity)
Generates codes for the given multi-code coupon.
|
String |
generateCouponSignature()
generates a base64 encoded String representing the signature of the multi code coupon.
|
boolean |
isValidCodeSeparator(String codeSeparator)
verifies if the given string is a valid code separator
|
boolean |
verifyCouponCode(MultiCodeCouponModel coupon,
String couponCode)
verifies if the given
couponCode is valid for the given coupon. |
String generateCouponSignature()
String generateCouponAlphabet()
String generateCouponCode(MultiCodeCouponModel coupon) throws CouponCodeGenerationException
couponCodeNumber attribute)coupon - multi code couponCouponCodeGenerationException - if the code cannot be generated (e.g. if the maximum number of coupon codes has been exceeded)String extractCouponPrefix(String couponCode)
couponCode - coupon code to extract prefix substringboolean verifyCouponCode(MultiCodeCouponModel coupon, String couponCode)
couponCode is valid for the given coupon.coupon - couponCode - boolean isValidCodeSeparator(String codeSeparator)
codeSeparator - Optional<MediaModel> generateCouponCodes(MultiCodeCouponModel multiCodeCoupon, int quantity)
quantity coupon codes or less. It contains less codes if the
requested quantity cannot be generated (e.g. if the limit of codes has been reached). If no coupon codes could be
generated an Optional.empty() is returned.multiCodeCoupon - quantity - number of coupon codes to be generatedOptional.empty() is returned.Copyright © 2017 SAP SE. All Rights Reserved.