Package org.cyclos.impl.banking
Class TransactionServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.banking.TransactionServiceImpl
-
- All Implemented Interfaces:
TransactionServiceLocal,TransactionService,Service
@Component public class TransactionServiceImpl extends BaseServiceImpl implements TransactionServiceLocal
Implementation forTransactionService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
Fields inherited from interface org.cyclos.impl.banking.TransactionServiceLocal
ATTR_AUTHORIZATION_LEVEL, ATTR_AUTHORIZATION_TYPE, ATTR_FROM_ACCOUNT, ATTR_FROM_OWNER, ATTR_FROM_OWNER_RESULT, ATTR_INSTALLMENT, ATTR_NEW_STATUS, ATTR_OLD_STATUS, ATTR_PAYMENT_TYPE, ATTR_PERFORM_TRANSACTION, ATTR_PREVIEW, ATTR_TO_ACCOUNT, ATTR_TO_OWNER, ATTR_TO_OWNER_RESULT, ATTR_TRANSACTION, FOR_POS
-
-
Constructor Summary
Constructors Constructor Description TransactionServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheck(LocateAccountOwnerResult from, LocateAccountOwnerResult to)Performs security checks for the given transaction parametersvoidcheck(LocateAccountOwnerResult from, LocateAccountOwnerResult to, TransferType transferType)Performs security checks for the given transaction parameters, taking into account the current session data channel and principal typevoidcheck(PerformInternalTransactionDTO parameters)Performs security checks for the given transaction parametersvoidcheckIgnoringSessionData(LocateAccountOwnerResult from, LocateAccountOwnerResult to, TransferType transferType)Performs security checks for the given transaction parameters, ignoring the current session data channel and principal typevoidcheckPaymentParameters(LocateAccountOwnerResult from, LocateAccountOwnerResult to, PaymentCreationType creationType, PaymentTransferType paymentType)Checks that a payment can be performed from / to the given owners, with the given payment typeOperatorVOconvertToOperatorVO(Operator operator)If it's a user trying to viewing another user operator returns the display of the operator and the user.DeviceConfirmationVOcreateDeviceConfirmationForReceive(@NotNull PerformInternalTransactionDTO parameters)Creates a new pending for approval device confirmation for the payer.SerializableInputStreamdeviceConfirmationBarcodeForReceive(InternalAccountOwner from, DeviceConfirmationBarcodeParams params)Generates a two-dimensional barcode (QR code), only if the confirmation was not already approved nor rejected for the given payer.protected com.mysema.commons.lang.CloseableIterator<Installment>doIterate(BaseInstallmentQuery params)protected com.mysema.commons.lang.CloseableIterator<Transaction>doIterate(BaseTransactionQuery params)FileInfoexportInstallments(@NotNull ExportFormatVO formatVO, @NotNull InstallmentQuery query)Exports a installments search results to fileFileInfoexportInstallmentsOverview(@NotNull ExportFormatVO formatVO, @NotNull InstallmentOverviewQuery query)Exports an installments overview search results to fileFileInfoexportOverview(@NotNull ExportFormatVO formatVO, @NotNull TransactionOverviewQuery query)Exports a transaction overview search results to fileFileInfoexportTransaction(@NotNull ExportFormatVO formatVO, @NotNull TransactionVO transactionVO)Exports the details of a given transaction to fileFileInfoexportTransactions(@NotNull ExportFormatVO formatVO, @NotNull TransactionQuery query)Exports a transactions search results to file<D extends TransactionData>
Dfill(D data, Transaction transaction)Fills a data instance with basic datavoidfill(Transaction transaction, TransferType type, PaymentCreationType creationType, Account from, Account to, BasicUser receiver, String fromName, String toName, BigDecimal amount, String description, Collection<CustomFieldValueDTO> customValues)Fills data in a transactionPaymentTransferTypefill(AbstractPaymentTypeData data, LocateAccountOwnerResult from, LocateAccountOwnerResult to, PaymentTransferType paymentType)Fills in the given payment type data from / to the given owners, using the given payment typeTransactionfindByTransactionNumber(String transactionNumber)Returns a transaction by transaction number, or throwsEntityNotFoundExceptionif not foundMap<String,Object>getCustomFieldValidationBindings(LocateAccountOwnerResult from, LocateAccountOwnerResult to, PaymentTransferType paymentType)Returns a map to be used as bindings on dynamic custom field validationTransactionDatagetData(TransactionVO vo)Returns data for a transactionTransactiongetGeneratedBy(Transaction transaction)Returns the transaction that generated the given transactionInstallmentOverviewSearchDatagetInstallmentsOverviewSearchData()Returns data for searching installments overviewInstallmentSearchDatagetInstallmentsSearchData(InternalAccountOwner owner)Returns data for searching installments from an account owner perspectivePage<MaturityTableItemData>getMaturityTable(MaturityTableQuery query)returns the maturity table which the user can view in case of paying with a zero d-rate of an earlier account state, when MaturityPolicy.HISTORY is valid.TransactionOverviewSearchDatagetOverviewSearchData(boolean pendingMyAuthorization)Returns data used to search for transaction overviewPerformPaymentDatagetPaymentData(InternalAccountOwner fromParam, InternalAccountOwner toParam, TransferTypeVO paymentTypeVO)Returns data used to prepare a payment matching the given from / to account owners.PerformPaymentToOwnerDatagetPaymentToOwnerData(InternalAccountOwner from, InternalAccountOwner to, TransferTypeVO transferTypeVO)Returns simplified data used to prepare a payment matching the given argumentsPerformPaymentTypeDatagetPaymentTypeData(InternalAccountOwner from, InternalAccountOwner to, TransferTypeVO transferTypeVO)Returns the data related to a payment type for a paymentReceivePaymentDatagetReceivePaymentData()Returns data used to receive a paymentReceivePaymentFromUserDatagetReceivePaymentFromUserData(UserLocatorVO locator, TransferTypeVO paymentTypeVO)Returns data used to receive a payment from a specific user.PerformPaymentTypeDatagetReceivePaymentTypeData(UserLocatorVO locator, TransferTypeVO transferTypeVO)Returns the data related to a payment type for receiving a payment from a specific user and payment typeTransactionSearchDatagetSearchData(InternalAccountOwner owner)Returns data used to search for transactions for the given ownerSet<TransactionNature>getVisibleNatures(InternalAccountOwner owner)Returns the visible transaction natures for the logged user over the given optional owner.voidinitialize()booleanisAccessible(InternalAccountOwner owner, TransactionNature nature)Returns whether the logged user has basic accessibility for transactions of the given nature for the given owner.booleanisCheckConfirmationPassword(PaymentTransferType paymentType, InternalAccountOwner owner, BigDecimal amount, Date date)It returns true if the confirmation password must be required because the payment's amount is greater than or equals to the maximum for a pin-less payment.booleanisVisible(InternalAccountOwner owner, TransactionNature nature)Returns whether the logged user can see transactions of the given nature for the given optional owner.List<PaymentTransferType>listPaymentTypes(LocateAccountOwnerResult from, LocateAccountOwnerResult to, Currency currency, boolean receive)Returns the possible payment, optionally in a currency, types between the given ownersTransactionVOload(Long id)Loads a transaction details by id, returning a proper detailed implementation (for example,PaymentVOorScheduledPaymentVO).TransactionVOloadByTransactionNumber(String transactionNumber)Returns a transfer by transaction number, or throwsEntityNotFoundExceptionif not foundLocateAccountOwnerResultlocateForPayment(InternalAccountOwner owner)Locate the receiver when performing a payment using the principal types allowed to perform a payment.LocateAccountOwnerResultlocateForReceiving(InternalAccountOwner owner)Locate the payer when receiving a payment using the principal types allowed to receive a payment.
Additionally, it checks if theBuiltInChannel.POSchannel is accessible for the located payer.<D extends TransactionData>
DnewData(Transaction transaction)Returns a new instance of the Data for the specific transaction, filled-in with basic datavoidpersist(Transaction transaction)Persists the given transaction and immediately performs additional actions, such as calling theCustomFieldValueHandler.processAfterSave(org.cyclos.entities.system.EntityWithCustomValues)method.org.cyclos.impl.banking.TransactionValidationDataprepareValidation(PrepareValidationParameter parameter)Returns a validator filled with all common validations, plus some other data which was already loaded.TransferVOprocessInstallment(InstallmentActionDTO action)Settles an installment.<T> Treceive(InternalAccountOwner from, Callable<T> action)Sets up the session data for receiving a transaction from the given user, invoking the given Callable in it.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidremoveDeviceConfirmationForReceive(String deviceConfirmationId, @NotNull PerformInternalTransactionDTO parameters)Removes a confirmation for the payer.voidrequestNewOTPForReceive(PerformInternalTransactionDTO parameters, SendMedium medium)Generates a new OTP (removing any previous password, if any) and sends it to the payer by the specified medium using the confirmation password type for theBuiltInChannel.POSchannel for the specified payer.
It has the same security controls as forPaymentService.receive(PerformPaymentDTO), that is the logged user must be allowed to receive payments from the specified payer.PaymentTransferTyperesolvePaymentType(InternalAccountOwner from, AccountOwner to, Currency currency, Channel channel, PrincipalType principalType, PaymentCreationType creationType)Returns the payment type matching the from, to, and optionally, currency according to the given payment operation.Page<TransactionResultVO>search(TransactionQuery params)Searches for transactions from the point-of-view of a given account owner, according to the given queryPage<InstallmentResultVO>searchInstallments(@NotNull InstallmentQuery params)Searches for installments from an account owner perspective, according to the given queryPage<InstallmentResultVO>searchInstallmentsOverview(@NotNull InstallmentOverviewQuery params)Searches for installments overview, according to the given queryPage<TransactionResultVO>searchOverview(@NotNull TransactionOverviewQuery params)Searches for transactions, according to the given queryExtensionPointAccessorsetStatusAndGetExtensionPoint(Installment installment, InstallmentStatus newStatus)Creates aExtensionPointAccessorfor a status change, fires the validated event and sets new status<T extends Transaction & HasTransactionStatus<S>,S extends TransactionStatus>
ExtensionPointAccessorsetStatusAndGetExtensionPoint(T transaction, S newStatus)Creates aExtensionPointAccessorfor a status change, fires the validated event and sets new statusvoidsettleInstallment(InstallmentActionDTO action)Settles an installment.voidupdatePreviewAndPayment(BasePaymentPreviewVO preview, PerformTransactionDTO dto, LocateAccountOwnerResult from, LocateAccountOwnerResult to, TransferType paymentType, SessionData receiverSessionData)Updates the given previewBasePaymentPreviewVOand set the given paymentDTOPerformTransactionDTOafter make it suitable to be returned again after a previewvoidvalidateMinTimeBetweenPayments(LocateAccountOwnerResult owner, PaymentTransferType paymentType)Validates the minimum time between paymentsvoidvalidatePaymentAmount(LocateAccountOwnerResult from, LocateAccountOwnerResult to, PaymentTransferType paymentType, BigDecimal amount, Date date)Validates an amount to be paid from the given account.DeviceConfirmationVOviewDeviceConfirmationForReceive(String deviceConfirmationId, @NotNull PerformInternalTransactionDTO parameters)Loads the details of a confirmation belonging to the payment payer.-
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
-
check
public void check(LocateAccountOwnerResult from, LocateAccountOwnerResult to)
Description copied from interface:TransactionServiceLocalPerforms security checks for the given transaction parameters- Specified by:
checkin interfaceTransactionServiceLocal
-
check
public void check(LocateAccountOwnerResult from, LocateAccountOwnerResult to, TransferType transferType)
Description copied from interface:TransactionServiceLocalPerforms security checks for the given transaction parameters, taking into account the current session data channel and principal type- Specified by:
checkin interfaceTransactionServiceLocal
-
check
public void check(PerformInternalTransactionDTO parameters)
Description copied from interface:TransactionServiceLocalPerforms security checks for the given transaction parameters- Specified by:
checkin interfaceTransactionServiceLocal
-
checkIgnoringSessionData
public void checkIgnoringSessionData(LocateAccountOwnerResult from, LocateAccountOwnerResult to, TransferType transferType)
Description copied from interface:TransactionServiceLocalPerforms security checks for the given transaction parameters, ignoring the current session data channel and principal type- Specified by:
checkIgnoringSessionDatain interfaceTransactionServiceLocal
-
checkPaymentParameters
public void checkPaymentParameters(LocateAccountOwnerResult from, LocateAccountOwnerResult to, PaymentCreationType creationType, PaymentTransferType paymentType)
Description copied from interface:TransactionServiceLocalChecks that a payment can be performed from / to the given owners, with the given payment type- Specified by:
checkPaymentParametersin interfaceTransactionServiceLocal
-
convertToOperatorVO
public OperatorVO convertToOperatorVO(Operator operator)
Description copied from interface:TransactionServiceLocalIf it's a user trying to viewing another user operator returns the display of the operator and the user. Otherwise it use BasicUserVOConverter. If the logged user is not related to the operator returns null; This code is relying in BasicUserVOConverter management for operators.- Specified by:
convertToOperatorVOin interfaceTransactionServiceLocal
-
createDeviceConfirmationForReceive
public DeviceConfirmationVO createDeviceConfirmationForReceive(@NotNull @NotNull PerformInternalTransactionDTO parameters) throws FrameworkException
Description copied from interface:TransactionServiceCreates a new pending for approval device confirmation for the payer. It has the same security controls as forPaymentService.receive(PerformPaymentDTO), that is the logged user must be allowed to receive payments from the specified payer.- Specified by:
createDeviceConfirmationForReceivein interfaceTransactionService- Throws:
FrameworkException
-
deviceConfirmationBarcodeForReceive
public SerializableInputStream deviceConfirmationBarcodeForReceive(InternalAccountOwner from, DeviceConfirmationBarcodeParams params) throws FrameworkException
Description copied from interface:TransactionServiceGenerates a two-dimensional barcode (QR code), only if the confirmation was not already approved nor rejected for the given payer. The logged use must be allowed to locate for receive the payer.- Specified by:
deviceConfirmationBarcodeForReceivein interfaceTransactionService- Throws:
FrameworkException
-
exportInstallments
public FileInfo exportInstallments(@NotNull @NotNull ExportFormatVO formatVO, @NotNull @NotNull InstallmentQuery query)
Description copied from interface:TransactionServiceExports a installments search results to file- Specified by:
exportInstallmentsin interfaceTransactionService
-
exportInstallmentsOverview
public FileInfo exportInstallmentsOverview(@NotNull @NotNull ExportFormatVO formatVO, @NotNull @NotNull InstallmentOverviewQuery query)
Description copied from interface:TransactionServiceExports an installments overview search results to file- Specified by:
exportInstallmentsOverviewin interfaceTransactionService
-
exportOverview
public FileInfo exportOverview(@NotNull @NotNull ExportFormatVO formatVO, @NotNull @NotNull TransactionOverviewQuery query)
Description copied from interface:TransactionServiceExports a transaction overview search results to file- Specified by:
exportOverviewin interfaceTransactionService
-
exportTransaction
public FileInfo exportTransaction(@NotNull @NotNull ExportFormatVO formatVO, @NotNull @NotNull TransactionVO transactionVO) throws FrameworkException
Description copied from interface:TransactionServiceExports the details of a given transaction to file- Specified by:
exportTransactionin interfaceTransactionService- Throws:
FrameworkException
-
exportTransactions
public FileInfo exportTransactions(@NotNull @NotNull ExportFormatVO formatVO, @NotNull @NotNull TransactionQuery query)
Description copied from interface:TransactionServiceExports a transactions search results to file- Specified by:
exportTransactionsin interfaceTransactionService
-
fill
public PaymentTransferType fill(AbstractPaymentTypeData data, LocateAccountOwnerResult from, LocateAccountOwnerResult to, PaymentTransferType paymentType)
Description copied from interface:TransactionServiceLocalFills in the given payment type data from / to the given owners, using the given payment type- Specified by:
fillin interfaceTransactionServiceLocal
-
fill
public <D extends TransactionData> D fill(D data, Transaction transaction)
Description copied from interface:TransactionServiceLocalFills a data instance with basic data- Specified by:
fillin interfaceTransactionServiceLocal
-
fill
public void fill(Transaction transaction, TransferType type, PaymentCreationType creationType, Account from, Account to, BasicUser receiver, String fromName, String toName, BigDecimal amount, String description, Collection<CustomFieldValueDTO> customValues)
Description copied from interface:TransactionServiceLocalFills data in a transaction- Specified by:
fillin interfaceTransactionServiceLocal
-
findByTransactionNumber
public Transaction findByTransactionNumber(String transactionNumber) throws FrameworkException
Description copied from interface:TransactionServiceLocalReturns a transaction by transaction number, or throwsEntityNotFoundExceptionif not found- Specified by:
findByTransactionNumberin interfaceTransactionServiceLocal- Throws:
FrameworkException
-
getCustomFieldValidationBindings
public Map<String,Object> getCustomFieldValidationBindings(LocateAccountOwnerResult from, LocateAccountOwnerResult to, PaymentTransferType paymentType)
Description copied from interface:TransactionServiceLocalReturns a map to be used as bindings on dynamic custom field validation- Specified by:
getCustomFieldValidationBindingsin interfaceTransactionServiceLocal
-
getData
public TransactionData getData(TransactionVO vo) throws FrameworkException
Description copied from interface:TransactionServiceReturns data for a transaction- Specified by:
getDatain interfaceTransactionService- Throws:
FrameworkException
-
getGeneratedBy
public Transaction getGeneratedBy(Transaction transaction)
Description copied from interface:TransactionServiceLocalReturns the transaction that generated the given transaction- Specified by:
getGeneratedByin interfaceTransactionServiceLocal
-
getInstallmentsOverviewSearchData
public InstallmentOverviewSearchData getInstallmentsOverviewSearchData() throws FrameworkException
Description copied from interface:TransactionServiceReturns data for searching installments overview- Specified by:
getInstallmentsOverviewSearchDatain interfaceTransactionService- Throws:
FrameworkException
-
getInstallmentsSearchData
public InstallmentSearchData getInstallmentsSearchData(InternalAccountOwner owner) throws FrameworkException
Description copied from interface:TransactionServiceReturns data for searching installments from an account owner perspective- Specified by:
getInstallmentsSearchDatain interfaceTransactionService- Throws:
FrameworkException
-
getMaturityTable
public Page<MaturityTableItemData> getMaturityTable(MaturityTableQuery query)
Description copied from interface:TransactionServicereturns the maturity table which the user can view in case of paying with a zero d-rate of an earlier account state, when MaturityPolicy.HISTORY is valid.- Specified by:
getMaturityTablein interfaceTransactionService
-
getOverviewSearchData
public TransactionOverviewSearchData getOverviewSearchData(boolean pendingMyAuthorization) throws FrameworkException
Description copied from interface:TransactionServiceReturns data used to search for transaction overview- Specified by:
getOverviewSearchDatain interfaceTransactionService- Throws:
FrameworkException
-
getPaymentData
public PerformPaymentData getPaymentData(InternalAccountOwner fromParam, InternalAccountOwner toParam, TransferTypeVO paymentTypeVO)
Description copied from interface:TransactionServiceReturns data used to prepare a payment matching the given from / to account owners. The given payment type is optional. If not passed in, will return detailed data for the first available payment type. If passed in, will return detailed data for that payment type, and must be valid.- Specified by:
getPaymentDatain interfaceTransactionService
-
getPaymentToOwnerData
public PerformPaymentToOwnerData getPaymentToOwnerData(InternalAccountOwner from, InternalAccountOwner to, TransferTypeVO transferTypeVO) throws FrameworkException
Description copied from interface:TransactionServiceReturns simplified data used to prepare a payment matching the given arguments- Specified by:
getPaymentToOwnerDatain interfaceTransactionService- Throws:
FrameworkException
-
getPaymentTypeData
public PerformPaymentTypeData getPaymentTypeData(InternalAccountOwner from, InternalAccountOwner to, TransferTypeVO transferTypeVO)
Description copied from interface:TransactionServiceReturns the data related to a payment type for a payment- Specified by:
getPaymentTypeDatain interfaceTransactionService
-
getReceivePaymentData
public ReceivePaymentData getReceivePaymentData() throws FrameworkException
Description copied from interface:TransactionServiceReturns data used to receive a payment- Specified by:
getReceivePaymentDatain interfaceTransactionService- Throws:
FrameworkException
-
getReceivePaymentFromUserData
public ReceivePaymentFromUserData getReceivePaymentFromUserData(UserLocatorVO locator, TransferTypeVO paymentTypeVO) throws FrameworkException
Description copied from interface:TransactionServiceReturns data used to receive a payment from a specific user. The given payment type is optional. If not passed in, will return detailed data for the first available payment type. If passed in, will return detailed data for that payment type, and must be valid.- Specified by:
getReceivePaymentFromUserDatain interfaceTransactionService- Throws:
FrameworkException
-
getReceivePaymentTypeData
public PerformPaymentTypeData getReceivePaymentTypeData(UserLocatorVO locator, TransferTypeVO transferTypeVO) throws FrameworkException
Description copied from interface:TransactionServiceReturns the data related to a payment type for receiving a payment from a specific user and payment type- Specified by:
getReceivePaymentTypeDatain interfaceTransactionService- Throws:
FrameworkException
-
getSearchData
public TransactionSearchData getSearchData(InternalAccountOwner owner) throws FrameworkException
Description copied from interface:TransactionServiceReturns data used to search for transactions for the given owner- Specified by:
getSearchDatain interfaceTransactionService- Throws:
FrameworkException
-
getVisibleNatures
public Set<TransactionNature> getVisibleNatures(InternalAccountOwner owner)
Description copied from interface:TransactionServiceLocalReturns the visible transaction natures for the logged user over the given optional owner. When no owner is given, returns whether can view transactions of that nature, regardless of the owner.- Specified by:
getVisibleNaturesin interfaceTransactionServiceLocal
-
initialize
@PostConstruct public void initialize()
-
isAccessible
public boolean isAccessible(InternalAccountOwner owner, TransactionNature nature)
Description copied from interface:TransactionServiceLocalReturns whether the logged user has basic accessibility for transactions of the given nature for the given owner. When no owner is given, assumes the current user's owner. The basic difference between view and access is that access doesn't check any view permission for own transactions.- Specified by:
isAccessiblein interfaceTransactionServiceLocal
-
isCheckConfirmationPassword
public boolean isCheckConfirmationPassword(PaymentTransferType paymentType, InternalAccountOwner owner, BigDecimal amount, Date date)
Description copied from interface:TransactionServiceLocalIt returns true if the confirmation password must be required because the payment's amount is greater than or equals to the maximum for a pin-less payment. This method always check the maximum per transaction and (optionally) the maximum per day.- Specified by:
isCheckConfirmationPasswordin interfaceTransactionServiceLocal- Parameters:
paymentType- the type used for the payment.date- if null then the method will only check the maximum per transaction for a pin-less payment.
Otherwise it will check both maximums: per transaction and per day (for the specified date).
Note: To check the maximum per day for the current day you can useDateHelper.now()as the last parameter.
-
isVisible
public boolean isVisible(InternalAccountOwner owner, TransactionNature nature)
Description copied from interface:TransactionServiceLocalReturns whether the logged user can see transactions of the given nature for the given optional owner. When no owner is given, returns whether can view transactions of that nature, regardless of the owner.- Specified by:
isVisiblein interfaceTransactionServiceLocal
-
listPaymentTypes
public List<PaymentTransferType> listPaymentTypes(LocateAccountOwnerResult from, LocateAccountOwnerResult to, Currency currency, boolean receive)
Description copied from interface:TransactionServiceLocalReturns the possible payment, optionally in a currency, types between the given owners- Specified by:
listPaymentTypesin interfaceTransactionServiceLocal
-
load
public TransactionVO load(Long id) throws FrameworkException
Description copied from interface:TransactionServiceLoads a transaction details by id, returning a proper detailed implementation (for example,PaymentVOorScheduledPaymentVO).- Specified by:
loadin interfaceTransactionService- Throws:
FrameworkException
-
loadByTransactionNumber
public TransactionVO loadByTransactionNumber(String transactionNumber) throws FrameworkException
Description copied from interface:TransactionServiceReturns a transfer by transaction number, or throwsEntityNotFoundExceptionif not found- Specified by:
loadByTransactionNumberin interfaceTransactionService- Throws:
FrameworkException
-
locateForPayment
public LocateAccountOwnerResult locateForPayment(InternalAccountOwner owner)
Description copied from interface:TransactionServiceLocalLocate the receiver when performing a payment using the principal types allowed to perform a payment.- Specified by:
locateForPaymentin interfaceTransactionServiceLocal
-
locateForReceiving
public LocateAccountOwnerResult locateForReceiving(InternalAccountOwner owner)
Description copied from interface:TransactionServiceLocalLocate the payer when receiving a payment using the principal types allowed to receive a payment.
Additionally, it checks if theBuiltInChannel.POSchannel is accessible for the located payer.- Specified by:
locateForReceivingin interfaceTransactionServiceLocal
-
newData
public <D extends TransactionData> D newData(Transaction transaction)
Description copied from interface:TransactionServiceLocalReturns a new instance of the Data for the specific transaction, filled-in with basic data- Specified by:
newDatain interfaceTransactionServiceLocal
-
persist
public void persist(Transaction transaction)
Description copied from interface:TransactionServiceLocalPersists the given transaction and immediately performs additional actions, such as calling theCustomFieldValueHandler.processAfterSave(org.cyclos.entities.system.EntityWithCustomValues)method.- Specified by:
persistin interfaceTransactionServiceLocal
-
prepareValidation
public org.cyclos.impl.banking.TransactionValidationData prepareValidation(PrepareValidationParameter parameter) throws FrameworkException
Description copied from interface:TransactionServiceLocalReturns a validator filled with all common validations, plus some other data which was already loaded.- Specified by:
prepareValidationin interfaceTransactionServiceLocal- Throws:
FrameworkException
-
processInstallment
public TransferVO processInstallment(InstallmentActionDTO action) throws FrameworkException
Description copied from interface:TransactionServiceSettles an installment. Currently only scheduled payment installments can be settled.- Specified by:
processInstallmentin interfaceTransactionService- Throws:
FrameworkException
-
receive
public <T> T receive(InternalAccountOwner from, Callable<T> action) throws FrameworkException
Description copied from interface:TransactionServiceLocalSets up the session data for receiving a transaction from the given user, invoking the given Callable in it.- Specified by:
receivein interfaceTransactionServiceLocal- Throws:
FrameworkException
-
removeDeviceConfirmationForReceive
public void removeDeviceConfirmationForReceive(String deviceConfirmationId, @NotNull @NotNull PerformInternalTransactionDTO parameters) throws FrameworkException
Description copied from interface:TransactionServiceRemoves a confirmation for the payer. It has the same security controls as forPaymentService.receive(PerformPaymentDTO), that is the logged user must be allowed to receive payments from the specified payer.- Specified by:
removeDeviceConfirmationForReceivein interfaceTransactionService- Throws:
FrameworkException
-
requestNewOTPForReceive
public void requestNewOTPForReceive(PerformInternalTransactionDTO parameters, SendMedium medium) throws FrameworkException, SmsSendingException
Description copied from interface:TransactionServiceGenerates a new OTP (removing any previous password, if any) and sends it to the payer by the specified medium using the confirmation password type for theBuiltInChannel.POSchannel for the specified payer.
It has the same security controls as forPaymentService.receive(PerformPaymentDTO), that is the logged user must be allowed to receive payments from the specified payer.- Specified by:
requestNewOTPForReceivein interfaceTransactionService- Parameters:
parameters- the payment to be received.medium- the medium used to send the OTP.- Throws:
SmsSendingException- only if medium isSendMedium.SMSand the OTP could not be sent to any enabled for sms phone.FrameworkException
-
resolvePaymentType
public PaymentTransferType resolvePaymentType(InternalAccountOwner from, AccountOwner to, Currency currency, Channel channel, PrincipalType principalType, PaymentCreationType creationType) throws FrameworkException
Description copied from interface:TransactionServiceLocalReturns the payment type matching the from, to, and optionally, currency according to the given payment operation. If none or more than one exists, returns null.- Specified by:
resolvePaymentTypein interfaceTransactionServiceLocal- Throws:
FrameworkException
-
search
public Page<TransactionResultVO> search(TransactionQuery params) throws FrameworkException
Description copied from interface:TransactionServiceSearches for transactions from the point-of-view of a given account owner, according to the given query- Specified by:
searchin interfaceTransactionService- Throws:
FrameworkException
-
searchInstallments
public Page<InstallmentResultVO> searchInstallments(@NotNull @NotNull InstallmentQuery params) throws FrameworkException
Description copied from interface:TransactionServiceSearches for installments from an account owner perspective, according to the given query- Specified by:
searchInstallmentsin interfaceTransactionService- Throws:
FrameworkException
-
searchInstallmentsOverview
public Page<InstallmentResultVO> searchInstallmentsOverview(@NotNull @NotNull InstallmentOverviewQuery params) throws FrameworkException
Description copied from interface:TransactionServiceSearches for installments overview, according to the given query- Specified by:
searchInstallmentsOverviewin interfaceTransactionService- Throws:
FrameworkException
-
searchOverview
public Page<TransactionResultVO> searchOverview(@NotNull @NotNull TransactionOverviewQuery params) throws FrameworkException
Description copied from interface:TransactionServiceSearches for transactions, according to the given query- Specified by:
searchOverviewin interfaceTransactionService- Throws:
FrameworkException
-
setStatusAndGetExtensionPoint
public ExtensionPointAccessor setStatusAndGetExtensionPoint(Installment installment, InstallmentStatus newStatus)
Description copied from interface:TransactionServiceLocalCreates aExtensionPointAccessorfor a status change, fires the validated event and sets new status- Specified by:
setStatusAndGetExtensionPointin interfaceTransactionServiceLocal
-
setStatusAndGetExtensionPoint
public <T extends Transaction & HasTransactionStatus<S>,S extends TransactionStatus> ExtensionPointAccessor setStatusAndGetExtensionPoint(T transaction, S newStatus)
Description copied from interface:TransactionServiceLocalCreates aExtensionPointAccessorfor a status change, fires the validated event and sets new status- Specified by:
setStatusAndGetExtensionPointin interfaceTransactionServiceLocal
-
settleInstallment
public void settleInstallment(InstallmentActionDTO action) throws FrameworkException
Description copied from interface:TransactionServiceSettles an installment. Currently only scheduled payment installments can be settled.- Specified by:
settleInstallmentin interfaceTransactionService- Throws:
FrameworkException
-
updatePreviewAndPayment
public void updatePreviewAndPayment(BasePaymentPreviewVO preview, PerformTransactionDTO dto, LocateAccountOwnerResult from, LocateAccountOwnerResult to, TransferType paymentType, SessionData receiverSessionData)
Description copied from interface:TransactionServiceLocalUpdates the given previewBasePaymentPreviewVOand set the given paymentDTOPerformTransactionDTOafter make it suitable to be returned again after a preview- Specified by:
updatePreviewAndPaymentin interfaceTransactionServiceLocal
-
validateMinTimeBetweenPayments
public void validateMinTimeBetweenPayments(LocateAccountOwnerResult owner, PaymentTransferType paymentType) throws FrameworkException, TransferException
Description copied from interface:TransactionServiceLocalValidates the minimum time between payments- Specified by:
validateMinTimeBetweenPaymentsin interfaceTransactionServiceLocal- Throws:
FrameworkExceptionTransferException
-
validatePaymentAmount
public void validatePaymentAmount(LocateAccountOwnerResult from, LocateAccountOwnerResult to, PaymentTransferType paymentType, BigDecimal amount, Date date) throws FrameworkException, TransferException
Description copied from interface:TransactionServiceLocalValidates an amount to be paid from the given account.- Specified by:
validatePaymentAmountin interfaceTransactionServiceLocal- Throws:
FrameworkExceptionTransferException
-
viewDeviceConfirmationForReceive
public DeviceConfirmationVO viewDeviceConfirmationForReceive(String deviceConfirmationId, @NotNull @NotNull PerformInternalTransactionDTO parameters) throws FrameworkException
Description copied from interface:TransactionServiceLoads the details of a confirmation belonging to the payment payer. It has the same security controls as forPaymentService.receive(PerformPaymentDTO), that is the logged user must be allowed to receive payments from the specified payer.- Specified by:
viewDeviceConfirmationForReceivein interfaceTransactionService- Throws:
FrameworkException
-
doIterate
protected com.mysema.commons.lang.CloseableIterator<Installment> doIterate(BaseInstallmentQuery params)
-
doIterate
protected com.mysema.commons.lang.CloseableIterator<Transaction> doIterate(BaseTransactionQuery params)
-
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
-
-