Package org.cyclos.impl.banking
Class PaymentRequestServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.banking.PaymentRequestServiceImpl
-
- All Implemented Interfaces:
PaymentRequestServiceLocal,PaymentRequestService,Service
@Service public class PaymentRequestServiceImpl extends BaseServiceImpl implements PaymentRequestServiceLocal
Implementation forPaymentRequestService
-
-
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 PaymentRequestServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PaymentRequestVOaccept(AcceptPaymentRequestDTO params)Accepts a payment request.protected PaymentRequestVOacceptOrReschedule(AcceptPaymentRequestDTO params, PaymentRequest paymentRequest)voidcancel(PaymentRequestActionDTO params)Cancels a payment request (as payee)intcancelAll(UserAccount account)Cancels all payment requests from or to the given accountvoidchangeExpirationDate(ChangePaymentRequestExpirationDateDTO params)Changes the payment request's expiration date as payee, admin or broker only if permissions are granted.voiddeny(PaymentRequestActionDTO params)Denies a payment request (as payer)voidexpire(PaymentRequest paymentRequest)Marks the given payment request as expired and notifies the PR senderPaymentRequestgetBySmsCode(String smsCode, User payer)Returns the payment request that has the given sms code and the given user as payer.PaymentRequestDatagetData(Long id)Returns data about a payment requestRequestPaymentDatagetRequestData(InternalAccountOwner payee, InternalAccountOwner payer, TransferTypeVO paymentTypeVO)Returns data used to request a paymentRequestPaymentPayerDatagetRequestPaymentPayerData(InternalAccountOwner payee, InternalAccountOwner payer)Returns data used to request a payment from a specific ownerRequestPaymentTypeDatagetRequestPaymentTypeData(InternalAccountOwner payee, InternalAccountOwner payer, TransferTypeVO transferTypeVO)Returns the data for a specific payment type on a payment request from / to the given ownersvoidnotifyRequestSend(PaymentRequest paymentRequest)Send all notifications derived from a payment request sent E.g notifies the payer of the request (i.e if the request was made from A to B then the payer is B)AcceptPaymentRequestPreviewVOpreviewAccept(PaymentRequestVO paymentRequestVO)Previews the payment which would be performed when accepting the given payment requestprotected voidprocessNow(PaymentRequest paymentRequest)voidprocessScheduling(PaymentRequest paymentRequest)Inserts either the payment or scheduled payment for this payment requestprotected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidreopenFailed(PaymentRequest paymentRequest)Marks the given scheduled payment request which failed processing as open and notifies the PR receiverPaymentRequestVOreschedule(AcceptPaymentRequestDTO params)Reschedules a payment request.PaymentRequestVOsend(SendPaymentRequestDTO parameters)Sends a payment request-
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
-
accept
public PaymentRequestVO accept(AcceptPaymentRequestDTO params) throws FrameworkException
Description copied from interface:PaymentRequestServiceAccepts a payment request. May process immediately or schedule for processing in a future date. Returns the updated payment request information.- Specified by:
acceptin interfacePaymentRequestService- Throws:
FrameworkException- See Also:
PaymentService.perform(org.cyclos.model.banking.transactions.PerformPaymentDTO)
-
cancel
public void cancel(PaymentRequestActionDTO params) throws FrameworkException
Description copied from interface:PaymentRequestServiceCancels a payment request (as payee)- Specified by:
cancelin interfacePaymentRequestService- Throws:
FrameworkException
-
cancelAll
public int cancelAll(UserAccount account)
Description copied from interface:PaymentRequestServiceLocalCancels all payment requests from or to the given account- Specified by:
cancelAllin interfacePaymentRequestServiceLocal
-
changeExpirationDate
public void changeExpirationDate(ChangePaymentRequestExpirationDateDTO params) throws FrameworkException
Description copied from interface:PaymentRequestServiceChanges the payment request's expiration date as payee, admin or broker only if permissions are granted.- Specified by:
changeExpirationDatein interfacePaymentRequestService- Throws:
FrameworkException
-
deny
public void deny(PaymentRequestActionDTO params) throws FrameworkException
Description copied from interface:PaymentRequestServiceDenies a payment request (as payer)- Specified by:
denyin interfacePaymentRequestService- Throws:
FrameworkException
-
expire
public void expire(PaymentRequest paymentRequest)
Description copied from interface:PaymentRequestServiceLocalMarks the given payment request as expired and notifies the PR sender- Specified by:
expirein interfacePaymentRequestServiceLocal
-
getBySmsCode
public PaymentRequest getBySmsCode(String smsCode, User payer)
Description copied from interface:PaymentRequestServiceLocalReturns the payment request that has the given sms code and the given user as payer.- Specified by:
getBySmsCodein interfacePaymentRequestServiceLocal
-
getData
public PaymentRequestData getData(Long id) throws FrameworkException
Description copied from interface:PaymentRequestServiceReturns data about a payment request- Specified by:
getDatain interfacePaymentRequestService- Throws:
FrameworkException
-
getRequestData
public RequestPaymentData getRequestData(InternalAccountOwner payee, InternalAccountOwner payer, TransferTypeVO paymentTypeVO) throws FrameworkException
Description copied from interface:PaymentRequestServiceReturns data used to request a payment- Specified by:
getRequestDatain interfacePaymentRequestService- Throws:
FrameworkException
-
getRequestPaymentPayerData
public RequestPaymentPayerData getRequestPaymentPayerData(InternalAccountOwner payee, InternalAccountOwner payer) throws FrameworkException
Description copied from interface:PaymentRequestServiceReturns data used to request a payment from a specific owner- Specified by:
getRequestPaymentPayerDatain interfacePaymentRequestService- Throws:
FrameworkException
-
getRequestPaymentTypeData
public RequestPaymentTypeData getRequestPaymentTypeData(InternalAccountOwner payee, InternalAccountOwner payer, TransferTypeVO transferTypeVO) throws FrameworkException
Description copied from interface:PaymentRequestServiceReturns the data for a specific payment type on a payment request from / to the given owners- Specified by:
getRequestPaymentTypeDatain interfacePaymentRequestService- Throws:
FrameworkException
-
notifyRequestSend
public void notifyRequestSend(PaymentRequest paymentRequest)
Description copied from interface:PaymentRequestServiceLocalSend all notifications derived from a payment request sent E.g notifies the payer of the request (i.e if the request was made from A to B then the payer is B)- Specified by:
notifyRequestSendin interfacePaymentRequestServiceLocal
-
previewAccept
public AcceptPaymentRequestPreviewVO previewAccept(PaymentRequestVO paymentRequestVO) throws FrameworkException
Description copied from interface:PaymentRequestServicePreviews the payment which would be performed when accepting the given payment request- Specified by:
previewAcceptin interfacePaymentRequestService- Throws:
FrameworkException
-
processScheduling
public void processScheduling(PaymentRequest paymentRequest)
Description copied from interface:PaymentRequestServiceLocalInserts either the payment or scheduled payment for this payment request- Specified by:
processSchedulingin interfacePaymentRequestServiceLocal
-
reopenFailed
public void reopenFailed(PaymentRequest paymentRequest)
Description copied from interface:PaymentRequestServiceLocalMarks the given scheduled payment request which failed processing as open and notifies the PR receiver- Specified by:
reopenFailedin interfacePaymentRequestServiceLocal
-
reschedule
public PaymentRequestVO reschedule(AcceptPaymentRequestDTO params) throws FrameworkException
Description copied from interface:PaymentRequestServiceReschedules a payment request. If the new processing date is null, will process the payment request immediately. Otherwise, changes the processing date for the given one.- Specified by:
reschedulein interfacePaymentRequestService- Throws:
FrameworkException
-
send
public PaymentRequestVO send(SendPaymentRequestDTO parameters) throws FrameworkException
Description copied from interface:PaymentRequestServiceSends a payment request- Specified by:
sendin interfacePaymentRequestService- Throws:
FrameworkException
-
acceptOrReschedule
protected PaymentRequestVO acceptOrReschedule(AcceptPaymentRequestDTO params, PaymentRequest paymentRequest)
-
processNow
protected void processNow(PaymentRequest paymentRequest)
-
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
-
-