Package org.cyclos.impl.banking
Class RecurringPaymentServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.banking.RecurringPaymentServiceImpl
-
- All Implemented Interfaces:
RecurringPaymentServiceLocal,RecurringPaymentService,Service
@Service public class RecurringPaymentServiceImpl extends BaseServiceImpl implements RecurringPaymentServiceLocal
Implementation forRecurringPaymentService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description RecurringPaymentServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RecurringPaymentacceptPaymentRequest(PaymentRequest paymentRequest)Generates the recurring payment for accepting a payment request, which must be open and recurringvoidblock(RecurringPaymentActionDTO params)Blocks the given recurring payment, so installments won't be processed on their respective due datesvoidcancel(RecurringPaymentActionDTO params)Permanently cancels the given recurring payment, so installments will never be processedintcancelAll(UserAccount account)Cancels all recurring payments to or from the given accountRecurringPaymentDatagetData(Long id)Returns data about a recurring paymentRecurringPaymentEditDatagetEditData(@NotNull RecurringPaymentVO vo)Returns data for edition about a recurring paymentvoidinitialize()voidmarkAsFailed(RecurringPaymentOccurrence occurrence)Marks the given occurrence as failed, notifying the involved partiesvoidmodify(RecurringPaymentDTO dto, String confirmationPassword)Modifies the given recurring paymentvoidnotifyPaymentPerformed(RecurringPayment recurringPayment)Send all notifications derived from to a recurring payment creation E.g notifies the receiving user if the recurring payment is visible, and not generated from a payment request (as it is already notified)RecurringPaymentVOperform(PerformRecurringPaymentDTO parameters)Performs an recurring payment, returning its dataRecurringPaymentPreviewVOpreview(PerformRecurringPaymentDTO parameters)Previews a recurring payment to be performedRecurringPaymentPreviewVOpreviewAcceptPaymentRequest(PaymentRequest paymentRequest)Previews accepting the given payment request, which must be open and recurringRecurringPaymentPreviewVOpreviewReceive(PerformRecurringPaymentDTO parameters)Previews a recurring payment to be receivedTransferVOprocessFailure(@NotNull InstallmentActionDTO params)Processes a failed occurrenceInstallmentTransferprocessFailure(RecurringPaymentOccurrence failure)Process the given failure, returning the root generated transferInstallmentTransferprocessOccurrence(RecurringPaymentOccurrence occurrence)Processes the recurring payment occurrence, generating a transferRecurringPaymentVOreceive(PerformRecurringPaymentDTO parameters)Receives a recurring payment, returning its dataprotected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidunblock(RecurringPaymentActionDTO params)Unlocks the given recurring payment, so installments will be processed on their respective due dates-
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
-
acceptPaymentRequest
public RecurringPayment acceptPaymentRequest(PaymentRequest paymentRequest)
Description copied from interface:RecurringPaymentServiceLocalGenerates the recurring payment for accepting a payment request, which must be open and recurring- Specified by:
acceptPaymentRequestin interfaceRecurringPaymentServiceLocal
-
block
public void block(RecurringPaymentActionDTO params) throws FrameworkException
Description copied from interface:RecurringPaymentServiceBlocks the given recurring payment, so installments won't be processed on their respective due dates- Specified by:
blockin interfaceRecurringPaymentService- Throws:
FrameworkException
-
cancel
public void cancel(RecurringPaymentActionDTO params) throws FrameworkException
Description copied from interface:RecurringPaymentServicePermanently cancels the given recurring payment, so installments will never be processed- Specified by:
cancelin interfaceRecurringPaymentService- Throws:
FrameworkException
-
cancelAll
public int cancelAll(UserAccount account)
Description copied from interface:RecurringPaymentServiceLocalCancels all recurring payments to or from the given account- Specified by:
cancelAllin interfaceRecurringPaymentServiceLocal
-
getData
public RecurringPaymentData getData(Long id) throws FrameworkException
Description copied from interface:RecurringPaymentServiceReturns data about a recurring payment- Specified by:
getDatain interfaceRecurringPaymentService- Throws:
FrameworkException
-
getEditData
public RecurringPaymentEditData getEditData(@NotNull @NotNull RecurringPaymentVO vo) throws FrameworkException
Description copied from interface:RecurringPaymentServiceReturns data for edition about a recurring payment- Specified by:
getEditDatain interfaceRecurringPaymentService- Throws:
FrameworkException
-
initialize
@PostConstruct public void initialize()
-
markAsFailed
public void markAsFailed(RecurringPaymentOccurrence occurrence)
Description copied from interface:RecurringPaymentServiceLocalMarks the given occurrence as failed, notifying the involved parties- Specified by:
markAsFailedin interfaceRecurringPaymentServiceLocal
-
modify
public void modify(RecurringPaymentDTO dto, String confirmationPassword) throws FrameworkException
Description copied from interface:RecurringPaymentServiceModifies the given recurring payment- Specified by:
modifyin interfaceRecurringPaymentService- Throws:
FrameworkException
-
notifyPaymentPerformed
public void notifyPaymentPerformed(RecurringPayment recurringPayment)
Description copied from interface:RecurringPaymentServiceLocalSend all notifications derived from to a recurring payment creation E.g notifies the receiving user if the recurring payment is visible, and not generated from a payment request (as it is already notified)- Specified by:
notifyPaymentPerformedin interfaceRecurringPaymentServiceLocal
-
perform
public RecurringPaymentVO perform(PerformRecurringPaymentDTO parameters) throws FrameworkException
Description copied from interface:RecurringPaymentServicePerforms an recurring payment, returning its data- Specified by:
performin interfaceRecurringPaymentService- Throws:
FrameworkException- See Also:
PaymentService.perform(org.cyclos.model.banking.transactions.PerformPaymentDTO)
-
preview
public RecurringPaymentPreviewVO preview(PerformRecurringPaymentDTO parameters) throws FrameworkException
Description copied from interface:RecurringPaymentServicePreviews a recurring payment to be performed- Specified by:
previewin interfaceRecurringPaymentService- Throws:
FrameworkException
-
previewAcceptPaymentRequest
public RecurringPaymentPreviewVO previewAcceptPaymentRequest(PaymentRequest paymentRequest)
Description copied from interface:RecurringPaymentServiceLocalPreviews accepting the given payment request, which must be open and recurring- Specified by:
previewAcceptPaymentRequestin interfaceRecurringPaymentServiceLocal
-
previewReceive
public RecurringPaymentPreviewVO previewReceive(PerformRecurringPaymentDTO parameters) throws FrameworkException, TransferException
Description copied from interface:RecurringPaymentServicePreviews a recurring payment to be received- Specified by:
previewReceivein interfaceRecurringPaymentService- Throws:
FrameworkExceptionTransferException
-
processFailure
public TransferVO processFailure(@NotNull @NotNull InstallmentActionDTO params) throws FrameworkException, TransferException
Description copied from interface:RecurringPaymentServiceProcesses a failed occurrence- Specified by:
processFailurein interfaceRecurringPaymentService- Throws:
FrameworkExceptionTransferException
-
processFailure
public InstallmentTransfer processFailure(RecurringPaymentOccurrence failure)
Description copied from interface:RecurringPaymentServiceLocalProcess the given failure, returning the root generated transfer- Specified by:
processFailurein interfaceRecurringPaymentServiceLocal
-
processOccurrence
public InstallmentTransfer processOccurrence(RecurringPaymentOccurrence occurrence)
Description copied from interface:RecurringPaymentServiceLocalProcesses the recurring payment occurrence, generating a transfer- Specified by:
processOccurrencein interfaceRecurringPaymentServiceLocal
-
receive
public RecurringPaymentVO receive(PerformRecurringPaymentDTO parameters) throws FrameworkException, TransferException
Description copied from interface:RecurringPaymentServiceReceives a recurring payment, returning its data- Specified by:
receivein interfaceRecurringPaymentService- Throws:
FrameworkExceptionTransferException- See Also:
PaymentService.perform(org.cyclos.model.banking.transactions.PerformPaymentDTO)
-
unblock
public void unblock(RecurringPaymentActionDTO params) throws FrameworkException
Description copied from interface:RecurringPaymentServiceUnlocks the given recurring payment, so installments will be processed on their respective due dates- Specified by:
unblockin interfaceRecurringPaymentService- Throws:
FrameworkException
-
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
-
-