Package org.cyclos.impl.banking
Interface TransactionServiceLocal
-
- All Superinterfaces:
Service,TransactionService
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-
Fields inherited from interface org.cyclos.services.banking.TransactionService
MAX_TRANSACTION_AMOUNT_EXCLUSIVE, MAX_TRANSACTION_AMOUNT_INTEGERS
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OperatorVOconvertToOperatorVO(Operator operator)If it's a user trying to viewing another user operator returns the display of the operator and the user.Pair<Integer,PaymentTransferType>countPaymentTypes(PaymentCreationType creationType, PaymentTransferTypeQuery query)Returns a pair with the payment types count and ONLY if there is only one then the payment type as the second component.<D extends TransactionData>
Dfill(D data, Transaction transaction, boolean isRoot)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 validationTransactionDatagetData(Transaction transaction, boolean includeTransfer)TransactiongetGeneratedBy(Transaction transaction)Returns the transaction that generated the given transactionbooleanisCheckConfirmation(PaymentTransferType paymentType, InternalAccountOwner owner, BigDecimal amount, Date date)It returns true if a confirmation is required required because the payment's amount is greater than or equals to the maximum for a pin-less payment.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, boolean isRoot)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.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
-
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.
-
countPaymentTypes
Pair<Integer,PaymentTransferType> countPaymentTypes(PaymentCreationType creationType, PaymentTransferTypeQuery query)
Returns a pair with the payment types count and ONLY if there is only one then the payment type as the second component.
-
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, boolean isRoot)
Fills a data instance with basic data- Parameters:
isRoot- true means this data is not part of a "parent" data (i.e is not an inner data) E.g: it should be false if the data being filled will be contained aTransferData
-
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
-
getData
TransactionData getData(Transaction transaction, boolean includeTransfer)
-
getGeneratedBy
Transaction getGeneratedBy(Transaction transaction)
Returns the transaction that generated the given transaction
-
isCheckConfirmation
boolean isCheckConfirmation(PaymentTransferType paymentType, InternalAccountOwner owner, BigDecimal amount, Date date)
It returns true if a confirmation is required 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.
-
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, boolean isRoot)
Returns a new instance of the Data for the specific transaction, filled-in with basic data- Parameters:
isRoot- true means this data is not part of a "parent" data (i.e is not an inner data) E.g: it should be false if the data being created will be contained aTransferData
-
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
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.
-
-