Package org.cyclos.impl.banking
Interface TransactionServiceLocal
-
- All Superinterfaces:
Service,TransactionService
- All Known Implementing Classes:
TransactionServiceImpl
public interface TransactionServiceLocal extends TransactionService
Local interface forTransactionService
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTR_AUTHORIZATION_LEVELScript bind variable: theAuthorizationLevel(if the payment would be authorized with a level)static StringATTR_AUTHORIZATION_TYPEScript bind variable: theTransactionAuthorizationType(if the payment would be authorized)static StringATTR_FROM_ACCOUNTScript bind variable: the fromAccountstatic StringATTR_FROM_OWNERScript bind variable: theInternalAccountOwnerfromstatic StringATTR_FROM_OWNER_RESULTScript bind variable: theLocateAccountOwnerResultof the fromstatic StringATTR_INSTALLMENTScript bind variable: theInstallmentstatic StringATTR_NEW_STATUSScript bind variable: the new statusstatic StringATTR_OLD_STATUSScript bind variable: the old statusstatic StringATTR_PAYMENT_TYPEScript bind variable: thePaymentTransferTypestatic StringATTR_PERFORM_TRANSACTIONScript bind variable: thePerformTransactionDTOstatic StringATTR_PREVIEWScript bind variable: thePaymentPreviewVOstatic StringATTR_TO_ACCOUNTScript bind variable: the toAccountstatic StringATTR_TO_OWNERScript bind variable: theAccountOwnertostatic StringATTR_TO_OWNER_RESULTScript bind variable: theLocateAccountOwnerResultof the tostatic StringATTR_TRANSACTIONScript bind variable: theTransaction(only available in theTransactionExtensionPointEvent.CONFIRMevent, on the validated phase)static StringFOR_POSBean attribute to indicate aPerformInternalTransactionDTOas used for POS
-
Method Summary
All Methods Instance Methods Abstract 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.<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 tt)Returns a map to be used as bindings on dynamic custom field validationTransactiongetGeneratedBy(Transaction transaction)Returns the transaction that generated the given transactionSet<TransactionNature>getVisibleNatures(InternalAccountOwner owner)Returns the visible transaction natures for the logged user over the given optional owner.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 ownersLocateAccountOwnerResultlocateForPayment(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.<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.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.ExtensionPointAccessorsetStatusAndGetExtensionPoint(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 statusvoidupdatePreviewAndPayment(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.-
Methods inherited from interface org.cyclos.services.banking.TransactionService
createDeviceConfirmationForReceive, deviceConfirmationBarcodeForReceive, exportInstallments, exportInstallmentsOverview, exportOverview, exportTransaction, exportTransactions, getData, getInstallmentsOverviewSearchData, getInstallmentsSearchData, getMaturityTable, getOverviewSearchData, getPaymentData, getPaymentToOwnerData, getPaymentTypeData, getReceivePaymentData, getReceivePaymentFromUserData, getReceivePaymentTypeData, getSearchData, load, loadByTransactionNumber, processInstallment, removeDeviceConfirmationForReceive, requestNewOTPForReceive, search, searchInstallments, searchInstallmentsOverview, searchOverview, settleInstallment, viewDeviceConfirmationForReceive
-
-
-
-
Field Detail
-
FOR_POS
static final String FOR_POS
Bean attribute to indicate aPerformInternalTransactionDTOas used for POS- See Also:
- Constant Field Values
-
ATTR_PERFORM_TRANSACTION
static final String ATTR_PERFORM_TRANSACTION
Script bind variable: thePerformTransactionDTO- See Also:
- Constant Field Values
-
ATTR_TRANSACTION
static final String ATTR_TRANSACTION
Script bind variable: theTransaction(only available in theTransactionExtensionPointEvent.CONFIRMevent, on the validated phase)- See Also:
- Constant Field Values
-
ATTR_INSTALLMENT
static final String ATTR_INSTALLMENT
Script bind variable: theInstallment- See Also:
- Constant Field Values
-
ATTR_PREVIEW
static final String ATTR_PREVIEW
Script bind variable: thePaymentPreviewVO- See Also:
- Constant Field Values
-
ATTR_PAYMENT_TYPE
static final String ATTR_PAYMENT_TYPE
Script bind variable: thePaymentTransferType- See Also:
- Constant Field Values
-
ATTR_FROM_ACCOUNT
static final String ATTR_FROM_ACCOUNT
Script bind variable: the fromAccount- See Also:
- Constant Field Values
-
ATTR_TO_ACCOUNT
static final String ATTR_TO_ACCOUNT
Script bind variable: the toAccount- See Also:
- Constant Field Values
-
ATTR_FROM_OWNER
static final String ATTR_FROM_OWNER
Script bind variable: theInternalAccountOwnerfrom- See Also:
- Constant Field Values
-
ATTR_TO_OWNER
static final String ATTR_TO_OWNER
Script bind variable: theAccountOwnerto- See Also:
- Constant Field Values
-
ATTR_FROM_OWNER_RESULT
static final String ATTR_FROM_OWNER_RESULT
Script bind variable: theLocateAccountOwnerResultof the from- See Also:
- Constant Field Values
-
ATTR_TO_OWNER_RESULT
static final String ATTR_TO_OWNER_RESULT
Script bind variable: theLocateAccountOwnerResultof the to- See Also:
- Constant Field Values
-
ATTR_AUTHORIZATION_TYPE
static final String ATTR_AUTHORIZATION_TYPE
Script bind variable: theTransactionAuthorizationType(if the payment would be authorized)- See Also:
- Constant Field Values
-
ATTR_AUTHORIZATION_LEVEL
static final String ATTR_AUTHORIZATION_LEVEL
Script bind variable: theAuthorizationLevel(if the payment would be authorized with a level)- See Also:
- Constant Field Values
-
ATTR_OLD_STATUS
static final String ATTR_OLD_STATUS
Script bind variable: the old status- See Also:
- Constant Field Values
-
ATTR_NEW_STATUS
static final String ATTR_NEW_STATUS
Script bind variable: the new status- See Also:
- Constant Field Values
-
-
Method Detail
-
check
void check(LocateAccountOwnerResult from, LocateAccountOwnerResult to)
Performs security checks for the given transaction parameters
-
check
void check(LocateAccountOwnerResult from, LocateAccountOwnerResult to, TransferType transferType)
Performs security checks for the given transaction parameters, taking into account the current session data channel and principal type
-
check
void check(PerformInternalTransactionDTO parameters)
Performs security checks for the given transaction parameters
-
checkIgnoringSessionData
void checkIgnoringSessionData(LocateAccountOwnerResult from, LocateAccountOwnerResult to, TransferType transferType)
Performs security checks for the given transaction parameters, ignoring the current session data channel and principal type
-
checkPaymentParameters
void checkPaymentParameters(LocateAccountOwnerResult from, LocateAccountOwnerResult to, PaymentCreationType creationType, PaymentTransferType paymentType)
Checks that a payment can be performed from / to the given owners, with the given payment type
-
convertToOperatorVO
OperatorVO convertToOperatorVO(Operator operator)
If 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.
-
fill
PaymentTransferType fill(AbstractPaymentTypeData data, LocateAccountOwnerResult from, LocateAccountOwnerResult to, PaymentTransferType paymentType)
Fills in the given payment type data from / to the given owners, using the given payment type
-
fill
<D extends TransactionData> D fill(D data, Transaction transaction)
Fills a data instance with basic data
-
fill
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)
Fills data in a transaction
-
findByTransactionNumber
Transaction findByTransactionNumber(String transactionNumber)
Returns a transaction by transaction number, or throwsEntityNotFoundExceptionif not found
-
getCustomFieldValidationBindings
Map<String,Object> getCustomFieldValidationBindings(LocateAccountOwnerResult from, LocateAccountOwnerResult to, PaymentTransferType tt)
Returns a map to be used as bindings on dynamic custom field validation
-
getGeneratedBy
Transaction getGeneratedBy(Transaction transaction)
Returns the transaction that generated the given transaction
-
getVisibleNatures
Set<TransactionNature> getVisibleNatures(InternalAccountOwner owner)
Returns 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.
-
isAccessible
boolean isAccessible(InternalAccountOwner owner, TransactionNature nature)
Returns 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.
-
isCheckConfirmationPassword
boolean isCheckConfirmationPassword(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. This method always check the maximum per transaction and (optionally) the maximum per day.- Parameters:
paymentType- the type used for the payment.the- payerdate- 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
boolean isVisible(InternalAccountOwner owner, TransactionNature nature)
Returns 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.
-
listPaymentTypes
List<PaymentTransferType> listPaymentTypes(LocateAccountOwnerResult from, LocateAccountOwnerResult to, Currency currency, boolean receive)
Returns the possible payment, optionally in a currency, types between the given owners
-
locateForPayment
LocateAccountOwnerResult locateForPayment(InternalAccountOwner owner)
Locate the receiver when performing a payment using the principal types allowed to perform a payment.
-
locateForReceiving
LocateAccountOwnerResult locateForReceiving(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.
-
newData
<D extends TransactionData> D newData(Transaction transaction)
Returns a new instance of the Data for the specific transaction, filled-in with basic data
-
persist
void persist(Transaction transaction)
Persists the given transaction and immediately performs additional actions, such as calling theCustomFieldValueHandler.processAfterSave(org.cyclos.entities.system.EntityWithCustomValues)method.
-
prepareValidation
org.cyclos.impl.banking.TransactionValidationData prepareValidation(PrepareValidationParameter parameter)
Returns a validator filled with all common validations, plus some other data which was already loaded.
-
receive
<T> T receive(InternalAccountOwner from, Callable<T> action)
Sets up the session data for receiving a transaction from the given user, invoking the given Callable in it.
-
resolvePaymentType
PaymentTransferType resolvePaymentType(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. If none or more than one exists, returns null.
-
setStatusAndGetExtensionPoint
ExtensionPointAccessor setStatusAndGetExtensionPoint(Installment installment, InstallmentStatus newStatus)
Creates aExtensionPointAccessorfor a status change, fires the validated event and sets new status
-
setStatusAndGetExtensionPoint
<T extends Transaction & HasTransactionStatus<S>,S extends TransactionStatus> ExtensionPointAccessor setStatusAndGetExtensionPoint(T transaction, S newStatus)
Creates aExtensionPointAccessorfor a status change, fires the validated event and sets new status
-
updatePreviewAndPayment
void updatePreviewAndPayment(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 preview
-
validateMinTimeBetweenPayments
void validateMinTimeBetweenPayments(LocateAccountOwnerResult owner, PaymentTransferType paymentType)
Validates the minimum time between payments
-
validatePaymentAmount
void validatePaymentAmount(LocateAccountOwnerResult from, LocateAccountOwnerResult to, PaymentTransferType paymentType, BigDecimal amount, Date date)
Validates an amount to be paid from the given account.
-
-