Package org.cyclos.services.banking
Interface VoucherService
-
- All Superinterfaces:
Service
- All Known Subinterfaces:
VoucherServiceLocal
public interface VoucherService extends Service
Service used to manage vouchers
-
-
Method Summary
All Methods Instance Methods Abstract 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(@NotNull VoucherBarcodeParams params)Returns a barcode image of the token of the given voucherVoucherPackWithIdsVObuy(@NotNull BuyVouchersDTO params)Buys one or more vouchersvoidcancel(@NotNull CancelVoucherDTO params)Cancels one or more vouchersvoidchangeExpirationDate(@NotNull ChangeVoucherExpirationDateDTO params)Changes the voucher expiration date according to the given information.voidchangeInfoNotificationSettings(@NotNull String token, @NotNull 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 settings)Change the voucher notifications settings using the voucher information page.voidchangePin(ChangeVoucherPinDTO changeVoucherPin)Changes the voucher PINFileInfoexportTransaction(@NotNull ExportFormatVO format, @NotNull VoucherTransactionVO vo)Generates a file with the voucher.FileInfoexportVoucher(@NotNull ExportFormatVO format, @NotNull VoucherVO voucher, boolean markAsPrinted)Generates a file with the voucher.FileInfoexportVouchers(@NotNull ExportFormatVO format, @NotNull BasicVoucherQuery query, boolean markAsPrinted)Generates a file with the query result.List<VouchersSummaryVO>generalSearchSummary(@NotNull GeneralVoucherQuery params)Returns the summary for a general vouchers search according to the given filtersVoucherPackWithIdsVOgenerate(@NotNull GenerateVouchersDTO params)Generates vouchersBuyVoucherDatagetBuyData(@NotNull CreateVoucherDataParams params)Returns data used to buy a voucherVoucherDatagetData(@NotNull Long id)Returns data about a specific voucherGeneralVouchersSearchDatagetGeneralSearchData()Returns data for a general vouchers searchGenerateVouchersDatagetGenerateData(@NotNull 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(@NotNull VoucherTransactionDataParams params)Returns data used to redeem a voucherInitialVoucherUserDatagetRedeemInitialData(UserLocatorVO user)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 user)Returns data for starting a voucher top-upVoucherTransactionDatagetTransactionData(Long id)Returns details of a voucher transactionVoucherTransactionsSearchDatagetUserTransactionsSearchData(UserLocatorVO user)Returns data for a searching redeemed vouchers of the given userUserVouchersSearchDatagetUserVouchersSearchData(UserLocatorVO user)Returns data for a searching vouchers of the given userVoucherVOloadByToken(@NotNull String token)Returns a voucher by tokenBuyVoucherPreviewVOpreviewBuy(@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(@NotNull RedeemVoucherDTO params)Redeems a voucher, returning the generated voucher idvoidresendEmail(@NotNull VoucherVO voucher)Re-sends the e-mail for a sent voucherList<String>resendPin(@NotNull String token, CaptchaResponseDTO captcha)Re-send the voucher pin to the mediums (email/mobile phone) associated to the voucher (if any)List<String>resendPinForRedeem(@NotNull String token, UserLocatorVO user)Re-send the voucher pin to the mediums (email/mobile phone) associated to the voucher (if any) before redeem.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 addressVoucherTransactionResultVOtopUp(@NotNull TopUpVoucherDTO params)Performs a top-up of a voucher.voidunblock(@NotNull UnblockVoucherParams params)Unblocks a voucher in theVoucherStatus.BLOCKEDstatusvoidunblockPin(@NotNull VoucherVO voucher)Manually unblocks a voucher PIN that was blocked by exceeding tries
-
-
-
Method Detail
-
activateGiftVoucher
VoucherInfoVO activateGiftVoucher(@NotNull @NotNull String token, ActivateGiftVoucherDTO params) throws FrameworkException
Changes the voucher PIN using the voucher information page.- Throws:
FrameworkException
-
assign
void assign(@NotNull @NotNull AssignVoucherDTO params) throws FrameworkExceptionAssigns an unassigned, open generated voucher to a user- Throws:
FrameworkException
-
barcode
SerializableInputStream barcode(@NotNull @NotNull VoucherBarcodeParams params) throws FrameworkException
Returns a barcode image of the token of the given voucher- Throws:
FrameworkException
-
buy
VoucherPackWithIdsVO buy(@NotNull @NotNull BuyVouchersDTO params) throws FrameworkException, VoucherBuyingException, MaxTotalOpenAmountException, TransferException
Buys one or more vouchers- 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
-
cancel
void cancel(@NotNull @NotNull CancelVoucherDTO params) throws FrameworkExceptionCancels one or more vouchers- Throws:
FrameworkException
-
changeExpirationDate
void changeExpirationDate(@NotNull @NotNull ChangeVoucherExpirationDateDTO params) throws FrameworkExceptionChanges the voucher expiration date according to the given information.- Throws:
FrameworkException
-
changeInfoNotificationSettings
void changeInfoNotificationSettings(@NotNull @NotNull String token, @NotNull @NotNull String pin, SimpleChangeVoucherNotificationSettingsDTO settings) throws FrameworkExceptionChange the voucher notifications settings using the voucher information page.- Throws:
FrameworkException
-
changeInfoPin
void changeInfoPin(@NotNull @NotNull String token, SimpleChangeVoucherPinDTO changeVoucherPin) throws FrameworkExceptionChanges the voucher PIN using the voucher information page.- Throws:
FrameworkException
-
changeNotificationSettings
void changeNotificationSettings(ChangeVoucherNotificationSettingsDTO settings) throws FrameworkException
Change the voucher notifications settings using the voucher information page.- Throws:
FrameworkException
-
changePin
void changePin(ChangeVoucherPinDTO changeVoucherPin) throws FrameworkException
Changes the voucher PIN- Throws:
FrameworkException
-
exportTransaction
FileInfo exportTransaction(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull VoucherTransactionVO vo) throws FrameworkException
Generates a file with the voucher.- Throws:
FrameworkException
-
exportVoucher
FileInfo exportVoucher(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull VoucherVO voucher, boolean markAsPrinted) throws FrameworkException
Generates a file with the voucher. This operation is read/write because it can update the voucher printed flag.- Throws:
FrameworkException
-
exportVouchers
FileInfo exportVouchers(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull BasicVoucherQuery query, boolean markAsPrinted) throws FrameworkException
Generates a file with the query result. This operation is read/write because it can update the each voucher printed flag.- Throws:
FrameworkException
-
generalSearchSummary
List<VouchersSummaryVO> generalSearchSummary(@NotNull @NotNull GeneralVoucherQuery params) throws FrameworkException
Returns the summary for a general vouchers search according to the given filters- Throws:
FrameworkException
-
generate
VoucherPackWithIdsVO generate(@NotNull @NotNull GenerateVouchersDTO params) throws FrameworkException, MaxTotalOpenAmountException, TransferException
Generates vouchers- Throws:
MaxTotalOpenAmountException- When the total amount of all open vouchers of this type would be exceededTransferException- When there is an error on the paymentFrameworkException
-
getBuyData
BuyVoucherData getBuyData(@NotNull @NotNull CreateVoucherDataParams params) throws FrameworkException
Returns data used to buy a voucher- Throws:
FrameworkException
-
getData
VoucherData getData(@NotNull @NotNull Long id) throws FrameworkException
Returns data about a specific voucher- Throws:
FrameworkException
-
getGeneralSearchData
GeneralVouchersSearchData getGeneralSearchData() throws FrameworkException
Returns data for a general vouchers search- Throws:
FrameworkException
-
getGenerateData
GenerateVouchersData getGenerateData(@NotNull @NotNull CreateVoucherDataParams params) throws FrameworkException
Returns data which is needed for generating vouchers- Throws:
FrameworkException
-
getInfo
VoucherInfoVO getInfo(@NotNull @NotNull String token, String pin) throws FrameworkException
Returns 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.- Throws:
FrameworkException
-
getInfoData
VoucherInfoData getInfoData() throws FrameworkException
Returns common data for displaying the voucher info application- Throws:
FrameworkException
-
getRedeemData
RedeemVoucherData getRedeemData(@NotNull @NotNull VoucherTransactionDataParams params) throws FrameworkException, VoucherRedeemingException
Returns data used to redeem a voucher- Throws:
FrameworkExceptionVoucherRedeemingException- See Also:
redeem(RedeemVoucherDTO)
-
getRedeemInitialData
InitialVoucherUserData getRedeemInitialData(UserLocatorVO user) throws FrameworkException
Returns data for starting a voucher redeeming- Throws:
FrameworkException
-
getSendData
BuyVoucherData getSendData(@NotNull @NotNull CreateVoucherDataParams params) throws FrameworkException
Returns data used to send a voucher- Throws:
FrameworkException
-
getTopUpData
TopUpVoucherData getTopUpData(@NotNull @NotNull VoucherTransactionDataParams params) throws FrameworkException, VoucherTopUpException
Returns data used to top-up a voucher- Throws:
FrameworkExceptionVoucherTopUpException- See Also:
topUp(TopUpVoucherDTO)
-
getTopUpInitialData
InitialVoucherUserData getTopUpInitialData(UserLocatorVO user) throws FrameworkException
Returns data for starting a voucher top-up- Throws:
FrameworkException
-
getTransactionData
VoucherTransactionData getTransactionData(Long id) throws FrameworkException
Returns details of a voucher transaction- Throws:
FrameworkException
-
getUserTransactionsSearchData
VoucherTransactionsSearchData getUserTransactionsSearchData(UserLocatorVO user) throws FrameworkException
Returns data for a searching redeemed vouchers of the given user- Throws:
FrameworkException
-
getUserVouchersSearchData
UserVouchersSearchData getUserVouchersSearchData(UserLocatorVO user) throws FrameworkException
Returns data for a searching vouchers of the given user- Throws:
FrameworkException
-
loadByToken
VoucherVO loadByToken(@NotNull @NotNull String token) throws FrameworkException
Returns a voucher by token- Throws:
FrameworkException
-
previewBuy
BuyVoucherPreviewVO previewBuy(@NotNull @NotNull BuyVouchersDTO params) throws FrameworkException, VoucherBuyingException, MaxTotalOpenAmountException, TransferException
Previews a voucher buying
-
previewRedeem
RedeemVoucherPreviewVO previewRedeem(@NotNull @NotNull RedeemVoucherDTO params) throws FrameworkException, VoucherRedeemingException
Previews the redeeming of a voucher
-
previewSend
BuyVoucherPreviewVO previewSend(@NotNull @NotNull SendVoucherDTO params) throws FrameworkException, VoucherBuyingException, MaxTotalOpenAmountException, TransferException
Preview a voucher sending to an e-mail address
-
previewTopUp
TopUpVoucherPreviewVO previewTopUp(@NotNull @NotNull TopUpVoucherDTO params) throws FrameworkException, VoucherTopUpException
Previews the top-up of a voucher
-
redeem
VoucherTransactionResultVO redeem(@NotNull @NotNull RedeemVoucherDTO params) throws FrameworkException, VoucherRedeemingException
Redeems a voucher, returning the generated voucher id- Throws:
RedeemingNotAllowedForVoucherException- When the voucher is no longer openRedeemingNotAllowedForUserException- When the given user cannot redeem this voucherRedeemingNotAllowedYetException- When attempting to redeem a voucher before the redeem start dateRedeemingNotAllowedTodayException- When attempting to redeem a voucher in a day it is not allowedFrameworkExceptionVoucherRedeemingException
-
resendEmail
void resendEmail(@NotNull @NotNull VoucherVO voucher) throws FrameworkExceptionRe-sends the e-mail for a sent voucher- Throws:
FrameworkException
-
resendPin
List<String> resendPin(@NotNull @NotNull String token, CaptchaResponseDTO captcha) throws FrameworkException
Re-send the voucher pin to the mediums (email/mobile phone) associated to the voucher (if any)- Throws:
FrameworkException
-
resendPinForRedeem
List<String> resendPinForRedeem(@NotNull @NotNull String token, UserLocatorVO user) throws FrameworkException
Re-send the voucher pin to the mediums (email/mobile phone) associated to the voucher (if any) before redeem. The user is where the voucher is being redeemed. When null assumes the logged user.- Throws:
FrameworkException
-
searchGeneral
Page<VoucherVO> searchGeneral(@NotNull @NotNull GeneralVoucherQuery params) throws FrameworkException
Performs a general vouchers search according to the given filters- Throws:
FrameworkException
-
searchInfoTransactions
Page<VoucherTransactionVO> searchInfoTransactions(@NotNull @NotNull VoucherInfoTransactionsQuery params, String pin) throws FrameworkException
Searches for voucher transactions according to the given filters- Throws:
FrameworkException
-
searchTransactions
Page<VoucherTransactionResultVO> searchTransactions(@NotNull @NotNull VoucherTransactionsQuery params) throws FrameworkException
Searches for voucher transactions according to the given filters- Throws:
FrameworkException
-
searchUser
Page<VoucherVO> searchUser(@NotNull @NotNull UserVoucherQuery params) throws FrameworkException
Searches for user vouchers according to the given filters- Throws:
FrameworkException
-
send
VoucherPackWithIdsVO send(@NotNull @NotNull SendVoucherDTO params) throws FrameworkException, VoucherBuyingException, MaxTotalOpenAmountException, TransferException
Sends a voucher to an e-mail address- 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
-
topUp
VoucherTransactionResultVO topUp(@NotNull @NotNull TopUpVoucherDTO params) throws FrameworkException, VoucherTopUpException, TransferException
Performs a top-up of a voucher. If the voucher is inactive, activates it.- Throws:
VoucherTopUpException- When there was a problem with the voucher top-upTransferException- When there was a problem when performing the top-up paymentFrameworkException
-
unblock
void unblock(@NotNull @NotNull UnblockVoucherParams params) throws FrameworkException, VoucherTopUpExceptionUnblocks a voucher in theVoucherStatus.BLOCKEDstatus
-
unblockPin
void unblockPin(@NotNull @NotNull VoucherVO voucher) throws FrameworkExceptionManually unblocks a voucher PIN that was blocked by exceeding tries- Throws:
FrameworkException
-
-