Package org.cyclos.impl.banking
Class VoucherServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.banking.VoucherServiceImpl
-
- All Implemented Interfaces:
VoucherServiceLocal,VoucherService,Service
@Service public class VoucherServiceImpl extends BaseServiceImpl implements VoucherServiceLocal
Implementation forVoucherService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, profileFieldHandler, transactionHandler, translationHandler
-
Fields inherited from interface org.cyclos.impl.banking.VoucherServiceLocal
ATTR_VOUCHER, ATTR_VOUCHER_TYPE, MASKED_TOKEN_LENGTH
-
-
Constructor Summary
Constructors Constructor Description VoucherServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VoucherInfoVOactivateGiftVoucher(@NotNull String token, ActivateGiftVoucherDTO params)Changes the voucher PIN using the voucher information page.voidassign(@NotNull AssignVoucherDTO params)Assigns an unassigned, open generated voucher to a userSerializableInputStreambarcode(VoucherBarcodeParams params)Returns a barcode image of the token of the given vouchervoidblock(Voucher voucher)Sets the voucher status as blocked.VoucherPackWithIdsVObuy(BuyVouchersDTO params)Buys one or more vouchersvoidcancel(CancelVoucherDTO params)Cancels one or more vouchersvoidchangeExpirationDate(ChangeVoucherExpirationDateDTO params)Changes the voucher expiration date according to the given information.voidchangeInfoNotificationSettings(String token, String pin, SimpleChangeVoucherNotificationSettingsDTO settings)Change the voucher notifications settings using the voucher information page.voidchangeInfoPin(@NotNull String token, SimpleChangeVoucherPinDTO changeVoucherPin)Changes the voucher PIN using the voucher information page.voidchangeNotificationSettings(ChangeVoucherNotificationSettingsDTO params)Change the voucher notifications settings using the voucher information page.voidchangePin(ChangeVoucherPinDTO params)Changes the voucher PINVoucherChargebackchargeback(Chargeback chargeback)Creates a voucher chargeback for the given chargeback transaction.intcountTotalOpenVouchers()Returns the number of open vouchers for all networksprotected VoucherInfoVOdoGetInfo(Voucher voucher, String pin)voidexpire(Voucher voucher)Expires the given vouchervoidexpireActivation(Voucher voucher)Expires the activation of the given voucherFileInfoexportTransaction(@NotNull ExportFormatVO formatVO, @NotNull VoucherTransactionVO vo)Generates a file with the voucher.FileInfoexportVoucher(@NotNull ExportFormatVO formatVO, @NotNull VoucherVO voucherVO, boolean markAsPrinted)Generates a file with the voucher.FileInfoexportVouchers(@NotNull ExportFormatVO formatVO, @NotNull BasicVoucherQuery query, boolean markAsPrinted)Generates a file with the query result.voidfill(AccountHistoryEntryVO entry, Long boughtTypeId, List<String> boughtTokens, String boughtSentTo, VoucherTransactionNature transactionNature, Long voucherTransactionTypeId)Fills the account history entry object with details of a voucher operationVoucherfindByToken(String rawToken, Collection<VoucherConfiguration> configurations)Returns a voucher by token code in one of the given configurationsStringformatMobilePhone(Voucher voucher)Formats the voucher's mobile phone according to the configuration of the owner/buyer first or, if null, from the user who activated the voucher.StringformatToken(Voucher voucher)Formats the voucher token with the mask from configuration.List<VouchersSummaryVO>generalSearchSummary(GeneralVoucherQuery params)Returns the summary for a general vouchers search according to the given filtersVoucherPackWithIdsVOgenerate(GenerateVouchersDTO params)Generates vouchersBuyVoucherDatagetBuyData(CreateVoucherDataParams params)Returns data used to buy a voucherVoucherDatagetData(Long id)Returns data about a specific voucherVoucherDetailsOnPaymentgetDetailsOnPayment(Payment payment)Returns details that should be displayed on a paymentGeneralVouchersSearchDatagetGeneralSearchData()Returns data for a general vouchers searchGenerateVouchersDatagetGenerateData(CreateVoucherDataParams params)Returns data which is needed for generating vouchersVoucherInfoVOgetInfo(@NotNull String token, String pin)Returns information about a voucher which is accessible as guest.VoucherInfoDatagetInfoData()Returns common data for displaying the voucher info applicationRedeemVoucherDatagetRedeemData(VoucherTransactionDataParams params)Returns data used to redeem a voucherInitialVoucherUserDatagetRedeemInitialData(UserLocatorVO userVO)Returns data for starting a voucher redeemingBuyVoucherDatagetSendData(@NotNull CreateVoucherDataParams params)Returns data used to send a voucherTopUpVoucherDatagetTopUpData(@NotNull VoucherTransactionDataParams params)Returns data used to top-up a voucherInitialVoucherUserDatagetTopUpInitialData(UserLocatorVO userVO)Returns data for starting a voucher top-upVoucherTransactionDatagetTransactionData(Long id)Returns details of a voucher transactionVoucherTransactionsVisibilitygetTransactionVisibility(Voucher voucher)Returns how transactions of the given voucher should be visible by the logged userVoucherTransactionsSearchDatagetUserTransactionsSearchData(UserLocatorVO userVO)Returns data for a searching redeemed vouchers of the given userUserVouchersSearchDatagetUserVouchersSearchData(UserLocatorVO userVO)Returns data for a searching vouchers of the given uservoidinitialize()booleanisOnlyOwnTransactions()Returns whether the logged user is a restricted operator that can only see vouchers redeemed by himself.booleanisVisible(Voucher voucher)com.mysema.commons.lang.CloseableIterator<Voucher>iterateVouchers(VoucherPack voucherPack)Iterates all voucher of a voucher packVoucherVOloadByToken(String token)Returns a voucher by tokenvoidnotifyAboutToExpire(Voucher voucher)Notifies that a voucher is about to expireBuyVoucherPreviewVOpreviewBuy(@NotNull BuyVouchersDTO params)Previews a voucher buyingRedeemVoucherPreviewVOpreviewRedeem(@NotNull RedeemVoucherDTO params)Previews the redeeming of a voucherBuyVoucherPreviewVOpreviewSend(@NotNull SendVoucherDTO params)Preview a voucher sending to an e-mail addressTopUpVoucherPreviewVOpreviewTopUp(@NotNull TopUpVoucherDTO params)Previews the top-up of a voucherVoucherTransactionResultVOredeem(RedeemVoucherDTO params)Redeems a voucher, returning the generated voucher idprotected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidresendEmail(@NotNull VoucherVO voucherVO)Re-sends the e-mail for a sent voucherList<String>resendPin(@NotNull String token, CaptchaResponseDTO captchaResponse)Re-send the voucher pin to the mediums (email/mobile phone) associated to the voucher (if any)Page<VoucherVO>searchGeneral(@NotNull GeneralVoucherQuery params)Performs a general vouchers search according to the given filtersPage<VoucherTransactionVO>searchInfoTransactions(@NotNull VoucherInfoTransactionsQuery params, String pin)Searches for voucher transactions according to the given filtersPage<VoucherTransactionResultVO>searchTransactions(@NotNull VoucherTransactionsQuery params)Searches for voucher transactions according to the given filtersPage<VoucherVO>searchUser(@NotNull UserVoucherQuery params)Searches for user vouchers according to the given filtersVoucherPackWithIdsVOsend(@NotNull SendVoucherDTO params)Sends a voucher to an e-mail addressbooleanshouldMaskToken(Voucher voucher)Returns whether the voucher token should be masked to display to the logged userbooleanshowPinOnDetails(Voucher voucher)Indicates whether the PIN should be shown in the voucher detailsbooleanshowQrCode(Voucher voucher)Returns if the QrCode of the voucher can be shown (e.g for printing or in the details page)VoucherTransactionResultVOtopUp(@NotNull TopUpVoucherDTO params)Performs a top-up of a voucher.voidunblock(@NotNull UnblockVoucherParams params)Unblocks a voucher in theVoucherStatus.BLOCKEDstatusvoidunblockPin(@NotNull VoucherVO voucherVO)Manually unblocks a voucher PIN that was blocked by exceeding tries-
Methods inherited from class org.cyclos.impl.BaseServiceImpl
initializeNetworkMappings
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, setAlreadyValidated, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
activateGiftVoucher
public VoucherInfoVO activateGiftVoucher(@NotNull @NotNull String token, ActivateGiftVoucherDTO params) throws FrameworkException
Description copied from interface:VoucherServiceChanges the voucher PIN using the voucher information page.- Specified by:
activateGiftVoucherin interfaceVoucherService- Throws:
FrameworkException
-
assign
public void assign(@NotNull @NotNull AssignVoucherDTO params) throws FrameworkExceptionDescription copied from interface:VoucherServiceAssigns an unassigned, open generated voucher to a user- Specified by:
assignin interfaceVoucherService- Throws:
FrameworkException
-
barcode
public SerializableInputStream barcode(VoucherBarcodeParams params) throws FrameworkException
Description copied from interface:VoucherServiceReturns a barcode image of the token of the given voucher- Specified by:
barcodein interfaceVoucherService- Throws:
FrameworkException
-
block
public void block(Voucher voucher)
Description copied from interface:VoucherServiceLocalSets the voucher status as blocked. The voucher needs to be open. It will be needed to be unblocked in the /voucher app. WARNING: this method is used by scripts only. There's no use case for having it in the public API.- Specified by:
blockin interfaceVoucherServiceLocal
-
buy
public VoucherPackWithIdsVO buy(BuyVouchersDTO params) throws FrameworkException
Description copied from interface:VoucherServiceBuys one or more vouchers- Specified by:
buyin interfaceVoucherService- Throws:
FrameworkException
-
cancel
public void cancel(CancelVoucherDTO params) throws FrameworkException
Description copied from interface:VoucherServiceCancels one or more vouchers- Specified by:
cancelin interfaceVoucherService- Throws:
FrameworkException
-
changeExpirationDate
public void changeExpirationDate(ChangeVoucherExpirationDateDTO params)
Description copied from interface:VoucherServiceChanges the voucher expiration date according to the given information.- Specified by:
changeExpirationDatein interfaceVoucherService
-
changeInfoNotificationSettings
public void changeInfoNotificationSettings(String token, String pin, SimpleChangeVoucherNotificationSettingsDTO settings) throws FrameworkException
Description copied from interface:VoucherServiceChange the voucher notifications settings using the voucher information page.- Specified by:
changeInfoNotificationSettingsin interfaceVoucherService- Throws:
FrameworkException
-
changeInfoPin
public void changeInfoPin(@NotNull @NotNull String token, SimpleChangeVoucherPinDTO changeVoucherPin) throws FrameworkExceptionDescription copied from interface:VoucherServiceChanges the voucher PIN using the voucher information page.- Specified by:
changeInfoPinin interfaceVoucherService- Throws:
FrameworkException
-
changeNotificationSettings
public void changeNotificationSettings(ChangeVoucherNotificationSettingsDTO params) throws FrameworkException
Description copied from interface:VoucherServiceChange the voucher notifications settings using the voucher information page.- Specified by:
changeNotificationSettingsin interfaceVoucherService- Throws:
FrameworkException
-
changePin
public void changePin(ChangeVoucherPinDTO params) throws FrameworkException
Description copied from interface:VoucherServiceChanges the voucher PIN- Specified by:
changePinin interfaceVoucherService- Throws:
FrameworkException
-
chargeback
public VoucherChargeback chargeback(Chargeback chargeback)
Description copied from interface:VoucherServiceLocalCreates a voucher chargeback for the given chargeback transaction. Returns the voucher chargeback if it was generated, or null if there's no chargeback to perform- Specified by:
chargebackin interfaceVoucherServiceLocal
-
countTotalOpenVouchers
public int countTotalOpenVouchers()
Description copied from interface:VoucherServiceLocalReturns the number of open vouchers for all networks- Specified by:
countTotalOpenVouchersin interfaceVoucherServiceLocal
-
expire
public void expire(Voucher voucher) throws FrameworkException
Description copied from interface:VoucherServiceLocalExpires the given voucher- Specified by:
expirein interfaceVoucherServiceLocal- Throws:
FrameworkException
-
expireActivation
public void expireActivation(Voucher voucher) throws FrameworkException
Description copied from interface:VoucherServiceLocalExpires the activation of the given voucher- Specified by:
expireActivationin interfaceVoucherServiceLocal- Throws:
FrameworkException
-
exportTransaction
public FileInfo exportTransaction(@NotNull @NotNull ExportFormatVO formatVO, @NotNull @NotNull VoucherTransactionVO vo) throws FrameworkException
Description copied from interface:VoucherServiceGenerates a file with the voucher.- Specified by:
exportTransactionin interfaceVoucherService- Throws:
FrameworkException
-
exportVoucher
public FileInfo exportVoucher(@NotNull @NotNull ExportFormatVO formatVO, @NotNull @NotNull VoucherVO voucherVO, boolean markAsPrinted) throws FrameworkException
Description copied from interface:VoucherServiceGenerates a file with the voucher. This operation is read/write because it can update the voucher printed flag.- Specified by:
exportVoucherin interfaceVoucherService- Throws:
FrameworkException
-
exportVouchers
public FileInfo exportVouchers(@NotNull @NotNull ExportFormatVO formatVO, @NotNull @NotNull BasicVoucherQuery query, boolean markAsPrinted)
Description copied from interface:VoucherServiceGenerates a file with the query result. This operation is read/write because it can update the each voucher printed flag.- Specified by:
exportVouchersin interfaceVoucherService
-
fill
public void fill(AccountHistoryEntryVO entry, Long boughtTypeId, List<String> boughtTokens, String boughtSentTo, VoucherTransactionNature transactionNature, Long voucherTransactionTypeId)
Description copied from interface:VoucherServiceLocalFills the account history entry object with details of a voucher operation- Specified by:
fillin interfaceVoucherServiceLocal
-
findByToken
public Voucher findByToken(String rawToken, Collection<VoucherConfiguration> configurations)
Description copied from interface:VoucherServiceLocalReturns a voucher by token code in one of the given configurations- Specified by:
findByTokenin interfaceVoucherServiceLocal
-
formatMobilePhone
public String formatMobilePhone(Voucher voucher)
Description copied from interface:VoucherServiceLocalFormats the voucher's mobile phone according to the configuration of the owner/buyer first or, if null, from the user who activated the voucher. If the resolved user still is null then the default configuration will be used.- Specified by:
formatMobilePhonein interfaceVoucherServiceLocal
-
formatToken
public String formatToken(Voucher voucher)
Description copied from interface:VoucherServiceLocalFormats the voucher token with the mask from configuration. IfVoucherConfiguration.isShowPlainToken()is false, returns null. If the token should be masked, it will be returned masked.- Specified by:
formatTokenin interfaceVoucherServiceLocal- See Also:
VoucherServiceLocal.shouldMaskToken(Voucher)
-
generalSearchSummary
public List<VouchersSummaryVO> generalSearchSummary(GeneralVoucherQuery params) throws FrameworkException
Description copied from interface:VoucherServiceReturns the summary for a general vouchers search according to the given filters- Specified by:
generalSearchSummaryin interfaceVoucherService- Throws:
FrameworkException
-
generate
public VoucherPackWithIdsVO generate(GenerateVouchersDTO params) throws FrameworkException
Description copied from interface:VoucherServiceGenerates vouchers- Specified by:
generatein interfaceVoucherService- Throws:
FrameworkException
-
getBuyData
public BuyVoucherData getBuyData(CreateVoucherDataParams params) throws FrameworkException
Description copied from interface:VoucherServiceReturns data used to buy a voucher- Specified by:
getBuyDatain interfaceVoucherService- Throws:
FrameworkException
-
getData
public VoucherData getData(Long id) throws FrameworkException
Description copied from interface:VoucherServiceReturns data about a specific voucher- Specified by:
getDatain interfaceVoucherService- Throws:
FrameworkException
-
getDetailsOnPayment
public VoucherDetailsOnPayment getDetailsOnPayment(Payment payment)
Description copied from interface:VoucherServiceLocalReturns details that should be displayed on a payment- Specified by:
getDetailsOnPaymentin interfaceVoucherServiceLocal
-
getGeneralSearchData
public GeneralVouchersSearchData getGeneralSearchData() throws FrameworkException
Description copied from interface:VoucherServiceReturns data for a general vouchers search- Specified by:
getGeneralSearchDatain interfaceVoucherService- Throws:
FrameworkException
-
getGenerateData
public GenerateVouchersData getGenerateData(CreateVoucherDataParams params) throws FrameworkException
Description copied from interface:VoucherServiceReturns data which is needed for generating vouchers- Specified by:
getGenerateDatain interfaceVoucherService- Throws:
FrameworkException
-
getInfo
public VoucherInfoVO getInfo(@NotNull @NotNull String token, String pin) throws FrameworkException
Description copied from interface:VoucherServiceReturns information about a voucher which is accessible as guest. If a PIN is required, the object will be returned only with the token (echoing the input token) and the pinInput field.- Specified by:
getInfoin interfaceVoucherService- Throws:
FrameworkException
-
getInfoData
public VoucherInfoData getInfoData() throws FrameworkException
Description copied from interface:VoucherServiceReturns common data for displaying the voucher info application- Specified by:
getInfoDatain interfaceVoucherService- Throws:
FrameworkException
-
getRedeemData
public RedeemVoucherData getRedeemData(VoucherTransactionDataParams params) throws FrameworkException
Description copied from interface:VoucherServiceReturns data used to redeem a voucher- Specified by:
getRedeemDatain interfaceVoucherService- Throws:
FrameworkException- See Also:
VoucherService.redeem(RedeemVoucherDTO)
-
getRedeemInitialData
public InitialVoucherUserData getRedeemInitialData(UserLocatorVO userVO) throws FrameworkException
Description copied from interface:VoucherServiceReturns data for starting a voucher redeeming- Specified by:
getRedeemInitialDatain interfaceVoucherService- Throws:
FrameworkException
-
getSendData
public BuyVoucherData getSendData(@NotNull @NotNull CreateVoucherDataParams params) throws FrameworkException
Description copied from interface:VoucherServiceReturns data used to send a voucher- Specified by:
getSendDatain interfaceVoucherService- Throws:
FrameworkException
-
getTopUpData
public TopUpVoucherData getTopUpData(@NotNull @NotNull VoucherTransactionDataParams params) throws FrameworkException, VoucherTopUpException
Description copied from interface:VoucherServiceReturns data used to top-up a voucher- Specified by:
getTopUpDatain interfaceVoucherService- Throws:
FrameworkExceptionVoucherTopUpException- See Also:
VoucherService.topUp(TopUpVoucherDTO)
-
getTopUpInitialData
public InitialVoucherUserData getTopUpInitialData(UserLocatorVO userVO) throws FrameworkException
Description copied from interface:VoucherServiceReturns data for starting a voucher top-up- Specified by:
getTopUpInitialDatain interfaceVoucherService- Throws:
FrameworkException
-
getTransactionData
public VoucherTransactionData getTransactionData(Long id) throws FrameworkException
Description copied from interface:VoucherServiceReturns details of a voucher transaction- Specified by:
getTransactionDatain interfaceVoucherService- Throws:
FrameworkException
-
getTransactionVisibility
public VoucherTransactionsVisibility getTransactionVisibility(Voucher voucher)
Description copied from interface:VoucherServiceLocalReturns how transactions of the given voucher should be visible by the logged user- Specified by:
getTransactionVisibilityin interfaceVoucherServiceLocal
-
getUserTransactionsSearchData
public VoucherTransactionsSearchData getUserTransactionsSearchData(UserLocatorVO userVO) throws FrameworkException
Description copied from interface:VoucherServiceReturns data for a searching redeemed vouchers of the given user- Specified by:
getUserTransactionsSearchDatain interfaceVoucherService- Throws:
FrameworkException
-
getUserVouchersSearchData
public UserVouchersSearchData getUserVouchersSearchData(UserLocatorVO userVO) throws FrameworkException
Description copied from interface:VoucherServiceReturns data for a searching vouchers of the given user- Specified by:
getUserVouchersSearchDatain interfaceVoucherService- Throws:
FrameworkException
-
initialize
@PostConstruct public void initialize()
-
isOnlyOwnTransactions
public boolean isOnlyOwnTransactions()
Description copied from interface:VoucherServiceLocalReturns whether the logged user is a restricted operator that can only see vouchers redeemed by himself. Note that returning false doesn't mean the logged user can see all redeemed vouchers, but a check on the permissionPermission.MY_VOUCHERS_VIEW_TRANSACTIONSis still needed.- Specified by:
isOnlyOwnTransactionsin interfaceVoucherServiceLocal
-
isVisible
public boolean isVisible(Voucher voucher)
- Specified by:
isVisiblein interfaceVoucherServiceLocal
-
iterateVouchers
public com.mysema.commons.lang.CloseableIterator<Voucher> iterateVouchers(VoucherPack voucherPack)
Description copied from interface:VoucherServiceLocalIterates all voucher of a voucher pack- Specified by:
iterateVouchersin interfaceVoucherServiceLocal
-
loadByToken
public VoucherVO loadByToken(String token) throws FrameworkException
Description copied from interface:VoucherServiceReturns a voucher by token- Specified by:
loadByTokenin interfaceVoucherService- Throws:
FrameworkException
-
notifyAboutToExpire
public void notifyAboutToExpire(Voucher voucher) throws FrameworkException
Description copied from interface:VoucherServiceLocalNotifies that a voucher is about to expire- Specified by:
notifyAboutToExpirein interfaceVoucherServiceLocal- Throws:
FrameworkException
-
previewBuy
public BuyVoucherPreviewVO previewBuy(@NotNull @NotNull BuyVouchersDTO params) throws FrameworkException, VoucherBuyingException, MaxTotalOpenAmountException, TransferException
Description copied from interface:VoucherServicePreviews a voucher buying- Specified by:
previewBuyin interfaceVoucherService- Throws:
FrameworkExceptionVoucherBuyingExceptionMaxTotalOpenAmountExceptionTransferException- See Also:
VoucherService.buy(BuyVouchersDTO)
-
previewRedeem
public RedeemVoucherPreviewVO previewRedeem(@NotNull @NotNull RedeemVoucherDTO params) throws FrameworkException, VoucherRedeemingException
Description copied from interface:VoucherServicePreviews the redeeming of a voucher- Specified by:
previewRedeemin interfaceVoucherService- Throws:
FrameworkExceptionVoucherRedeemingException
-
previewSend
public BuyVoucherPreviewVO previewSend(@NotNull @NotNull SendVoucherDTO params) throws FrameworkException, VoucherBuyingException, MaxTotalOpenAmountException, TransferException
Description copied from interface:VoucherServicePreview a voucher sending to an e-mail address- Specified by:
previewSendin interfaceVoucherService- Throws:
FrameworkExceptionVoucherBuyingExceptionMaxTotalOpenAmountExceptionTransferException- See Also:
VoucherService.send(SendVoucherDTO)
-
previewTopUp
public TopUpVoucherPreviewVO previewTopUp(@NotNull @NotNull TopUpVoucherDTO params) throws FrameworkException, VoucherTopUpException
Description copied from interface:VoucherServicePreviews the top-up of a voucher- Specified by:
previewTopUpin interfaceVoucherService- Throws:
FrameworkExceptionVoucherTopUpException
-
redeem
public VoucherTransactionResultVO redeem(RedeemVoucherDTO params) throws FrameworkException
Description copied from interface:VoucherServiceRedeems a voucher, returning the generated voucher id- Specified by:
redeemin interfaceVoucherService- Throws:
FrameworkException
-
resendEmail
public void resendEmail(@NotNull @NotNull VoucherVO voucherVO) throws FrameworkExceptionDescription copied from interface:VoucherServiceRe-sends the e-mail for a sent voucher- Specified by:
resendEmailin interfaceVoucherService- Throws:
FrameworkException
-
resendPin
public List<String> resendPin(@NotNull @NotNull String token, CaptchaResponseDTO captchaResponse)
Description copied from interface:VoucherServiceRe-send the voucher pin to the mediums (email/mobile phone) associated to the voucher (if any)- Specified by:
resendPinin interfaceVoucherService
-
searchGeneral
public Page<VoucherVO> searchGeneral(@NotNull @NotNull GeneralVoucherQuery params) throws FrameworkException
Description copied from interface:VoucherServicePerforms a general vouchers search according to the given filters- Specified by:
searchGeneralin interfaceVoucherService- Throws:
FrameworkException
-
searchInfoTransactions
public Page<VoucherTransactionVO> searchInfoTransactions(@NotNull @NotNull VoucherInfoTransactionsQuery params, String pin) throws FrameworkException
Description copied from interface:VoucherServiceSearches for voucher transactions according to the given filters- Specified by:
searchInfoTransactionsin interfaceVoucherService- Throws:
FrameworkException
-
searchTransactions
public Page<VoucherTransactionResultVO> searchTransactions(@NotNull @NotNull VoucherTransactionsQuery params) throws FrameworkException
Description copied from interface:VoucherServiceSearches for voucher transactions according to the given filters- Specified by:
searchTransactionsin interfaceVoucherService- Throws:
FrameworkException
-
searchUser
public Page<VoucherVO> searchUser(@NotNull @NotNull UserVoucherQuery params) throws FrameworkException
Description copied from interface:VoucherServiceSearches for user vouchers according to the given filters- Specified by:
searchUserin interfaceVoucherService- Throws:
FrameworkException
-
send
public VoucherPackWithIdsVO send(@NotNull @NotNull SendVoucherDTO params) throws FrameworkException, VoucherBuyingException, MaxTotalOpenAmountException, TransferException
Description copied from interface:VoucherServiceSends a voucher to an e-mail address- Specified by:
sendin interfaceVoucherService- Throws:
BuyingNotAllowedForUserException- When the user is not in a group allowed to buy this typeBuyingMaxOpenAmountException- When the max open amount for the given user is exceededMaxTotalOpenAmountException- When the total amount of all open vouchers of this type would be exceededTransferException- When there is an error on the paymentFrameworkExceptionVoucherBuyingException
-
shouldMaskToken
public boolean shouldMaskToken(Voucher voucher)
Description copied from interface:VoucherServiceLocalReturns whether the voucher token should be masked to display to the logged user- Specified by:
shouldMaskTokenin interfaceVoucherServiceLocal
-
showPinOnDetails
public boolean showPinOnDetails(Voucher voucher)
Description copied from interface:VoucherServiceLocalIndicates whether the PIN should be shown in the voucher details- Specified by:
showPinOnDetailsin interfaceVoucherServiceLocal
-
showQrCode
public boolean showQrCode(Voucher voucher)
Description copied from interface:VoucherServiceLocalReturns if the QrCode of the voucher can be shown (e.g for printing or in the details page)- Specified by:
showQrCodein interfaceVoucherServiceLocal
-
topUp
public VoucherTransactionResultVO topUp(@NotNull @NotNull TopUpVoucherDTO params) throws FrameworkException, VoucherTopUpException, TransferException
Description copied from interface:VoucherServicePerforms a top-up of a voucher. If the voucher is inactive, activates it.- Specified by:
topUpin interfaceVoucherService- Throws:
VoucherTopUpException- When there was a problem with the voucher top-upTransferException- When there was a problem when performing the top-up paymentFrameworkException
-
unblock
public void unblock(@NotNull @NotNull UnblockVoucherParams params) throws FrameworkException, VoucherTopUpExceptionDescription copied from interface:VoucherServiceUnblocks a voucher in theVoucherStatus.BLOCKEDstatus- Specified by:
unblockin interfaceVoucherService- Throws:
FrameworkExceptionVoucherTopUpException
-
unblockPin
public void unblockPin(@NotNull @NotNull VoucherVO voucherVO) throws FrameworkExceptionDescription copied from interface:VoucherServiceManually unblocks a voucher PIN that was blocked by exceeding tries- Specified by:
unblockPinin interfaceVoucherService- Throws:
FrameworkException
-
doGetInfo
protected VoucherInfoVO doGetInfo(Voucher voucher, String pin)
-
registerNetworkMappings
protected void registerNetworkMappings(NetworkPathRegistry networkPathRegistry)
Description copied from class:BaseServiceImplNeeds to be overridden by subclasses to register the path up to the network- Specified by:
registerNetworkMappingsin classBaseServiceImpl
-
-