Package org.cyclos.impl.banking
Interface VoucherServiceLocal
-
- All Superinterfaces:
Service,VoucherService
- All Known Implementing Classes:
VoucherServiceImpl
public interface VoucherServiceLocal extends VoucherService
Local interface forVoucherService
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTR_VOUCHERScript bind variable: theVoucherstatic StringATTR_VOUCHER_TYPEScript bind variable: theVoucherTypestatic intMASKED_TOKEN_LENGTH
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidblock(Voucher voucher)Sets the voucher status as blocked.VoucherChargebackchargeback(Chargeback chargeback)Creates a voucher chargeback for the given chargeback transaction.intcountTotalOpenVouchers()Returns the number of open vouchers for all networksvoidexpire(Voucher voucher)Expires the given vouchervoidexpireActivation(Voucher voucher)Expires the activation of the given vouchervoidfill(AccountHistoryEntryVO entry, Long boughtTypeId, List<String> boughtTokens, String boughtSentTo, VoucherTransactionNature transcationNature, Long transactionTypeId)Fills the account history entry object with details of a voucher operationVoucherfindByToken(String token, Collection<VoucherConfiguration> possibleConfigurations)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.VoucherDetailsOnPaymentgetDetailsOnPayment(Payment payment)Returns details that should be displayed on a paymentVoucherTransactionsVisibilitygetTransactionVisibility(Voucher voucher)Returns how transactions of the given voucher should be visible by the logged userbooleanisOnlyOwnTransactions()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 packvoidnotifyAboutToExpire(Voucher voucher)Notifies that a voucher is about to expirebooleanshouldMaskToken(Voucher voucher)Returns whether the voucher token should be masked to display to the logged userbooleanshowPinOnDetails(Voucher v)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)-
Methods inherited from interface org.cyclos.services.banking.VoucherService
activateGiftVoucher, assign, barcode, buy, cancel, changeExpirationDate, changeInfoNotificationSettings, changeInfoPin, changeNotificationSettings, changePin, exportTransaction, exportVoucher, exportVouchers, generalSearchSummary, generate, getBuyData, getData, getGeneralSearchData, getGenerateData, getInfo, getInfoData, getRedeemData, getRedeemInitialData, getSendData, getTopUpData, getTopUpInitialData, getTransactionData, getUserTransactionsSearchData, getUserVouchersSearchData, loadByToken, previewBuy, previewRedeem, previewSend, previewTopUp, redeem, resendEmail, resendPin, searchGeneral, searchInfoTransactions, searchTransactions, searchUser, send, topUp, unblock, unblockPin
-
-
-
-
Field Detail
-
MASKED_TOKEN_LENGTH
static final int MASKED_TOKEN_LENGTH
- See Also:
- Constant Field Values
-
ATTR_VOUCHER_TYPE
static final String ATTR_VOUCHER_TYPE
Script bind variable: theVoucherType- See Also:
- Constant Field Values
-
ATTR_VOUCHER
static final String ATTR_VOUCHER
Script bind variable: theVoucher- See Also:
- Constant Field Values
-
-
Method Detail
-
block
void block(Voucher voucher)
Sets 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.
-
showQrCode
boolean showQrCode(Voucher voucher)
Returns if the QrCode of the voucher can be shown (e.g for printing or in the details page)
-
chargeback
VoucherChargeback chargeback(Chargeback chargeback)
Creates 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
-
countTotalOpenVouchers
int countTotalOpenVouchers()
Returns the number of open vouchers for all networks
-
expire
void expire(Voucher voucher)
Expires the given voucher
-
expireActivation
void expireActivation(Voucher voucher)
Expires the activation of the given voucher
-
fill
void fill(AccountHistoryEntryVO entry, Long boughtTypeId, List<String> boughtTokens, String boughtSentTo, VoucherTransactionNature transcationNature, Long transactionTypeId)
Fills the account history entry object with details of a voucher operation
-
findByToken
Voucher findByToken(String token, Collection<VoucherConfiguration> possibleConfigurations)
Returns a voucher by token code in one of the given configurations
-
formatMobilePhone
String formatMobilePhone(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. If the resolved user still is null then the default configuration will be used.
-
formatToken
String formatToken(Voucher voucher)
Formats 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.- See Also:
shouldMaskToken(Voucher)
-
getDetailsOnPayment
VoucherDetailsOnPayment getDetailsOnPayment(Payment payment)
Returns details that should be displayed on a payment
-
getTransactionVisibility
VoucherTransactionsVisibility getTransactionVisibility(Voucher voucher)
Returns how transactions of the given voucher should be visible by the logged user
-
isOnlyOwnTransactions
boolean isOnlyOwnTransactions()
Returns 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.
-
isVisible
boolean isVisible(Voucher voucher)
-
iterateVouchers
com.mysema.commons.lang.CloseableIterator<Voucher> iterateVouchers(VoucherPack voucherPack)
Iterates all voucher of a voucher pack
-
notifyAboutToExpire
void notifyAboutToExpire(Voucher voucher)
Notifies that a voucher is about to expire
-
shouldMaskToken
boolean shouldMaskToken(Voucher voucher)
Returns whether the voucher token should be masked to display to the logged user
-
showPinOnDetails
boolean showPinOnDetails(Voucher v)
Indicates whether the PIN should be shown in the voucher details
-
-