@Security public class TicketServiceSecurity extends BaseServiceSecurity implements TicketService
| Constructor and Description |
|---|
TicketServiceSecurity() |
| Modifier and Type | Method and Description |
|---|---|
TicketVO |
approve(ApproveTicketDTO params)
Approves a ticket, as a payer, only if status is
TicketStatus.OPEN.If there is no "success URL" defined then it generates a new direct payment and the ticket goes to TicketStatus.PROCESSED. |
SerializableInputStream |
barcode(TicketBarcodeParams params)
Generates a two-dimensional barcode (aka QR code) only if status is
TicketStatus.OPEN containing a URL of
the form: .../pay/ticket_id (e.g
https://www.cyclos.org/pay/1234567890123456789). |
void |
cancel(TicketVO ticketVO)
Cancels the ticket only if status is
TicketStatus.OPEN and the logged user is the ticket's receiver
or a manger of him. |
TicketVO |
create(CreateTicketDTO params)
Creates a new ticket with status
TicketStatus.OPEN for the logged user (i.e setting it as the receiver). |
CreateTicketData |
getCreateData(UserLocatorVO payer)
Returns data used to crate a new ticket, optionally with a fixed payer.
|
TicketData |
getData(TicketVO vo)
Returns data to view the ticket's details.
|
EasyInvoiceData |
getEasyInvoiceData(PerformPaymentDTO params)
Returns data for an easy invoice after logging in.
|
TicketPaymentTypeData |
getTicketPaymentTypeData(TransferTypeVO transferType)
Returns the data for a specific payment type used to create a new ticket
|
boolean |
hasViewPermission(InternalAccountOwner owner) |
boolean |
isAccessible(Ticket ticket) |
PrepareEasyInvoiceData |
prepareEasyInvoice(PrepareEasyInvoiceParams params)
Returns data for displaying details of an easy invoice while still as guest.
|
ApproveTicketPreviewVO |
previewApprove(TicketVO ticketVO)
Previews the payment which would be performed when approving the given ticket as the payer.
|
TicketProcessResult |
process(ProcessTicketDTO params)
Processes a ticket as the receiver of the payment (i.e the ticket creator).
Only if the ticket status is TicketStatus.APPROVED a new direct payment will be generated and the new
ticket status will be: TicketStatus.PROCESSED. |
protected org.cyclos.impl.access.EntityCheck<?> |
resolveEntityCheck()
Must be implemented in order to return the
EntityCheck managed by this security component, or null if
none |
Page<TicketEntryVO> |
search(TicketQuery query)
Searches for tickets according to the given query.
|
checkGuest, checkId, checkIds, checkInternalName, checkLoggedIn, checkManagesUser, checkRelatesToUser, checkVO, checkVOs, doInitialize, getEntityCheckRegistry, getUser, initializecanManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getChannelConfiguration, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, getValidationResult, 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, toDate, toDateTime, validatedelete, detach, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, updatepublic TicketVO approve(ApproveTicketDTO params) throws FrameworkException, TransferException
TicketServiceTicketStatus.OPEN.TicketStatus.PROCESSED. Otherwise, no payment is generated and the ticket goes to
TicketStatus.APPROVED status. The payment will be generated only after being processed by the receiver.approve in interface TicketServiceFrameworkExceptionTransferExceptionpublic SerializableInputStream barcode(TicketBarcodeParams params) throws FrameworkException
TicketServiceTicketStatus.OPEN containing a URL of
the form: .../pay/ticket_id (e.g
https://www.cyclos.org/pay/1234567890123456789).barcode in interface TicketServiceFrameworkExceptionpublic void cancel(TicketVO ticketVO) throws FrameworkException
TicketServiceTicketStatus.OPEN and the logged user is the ticket's receiver
or a manger of him.cancel in interface TicketServiceFrameworkExceptionpublic TicketVO create(CreateTicketDTO params) throws FrameworkException
TicketServiceTicketStatus.OPEN for the logged user (i.e setting it as the receiver).create in interface TicketServiceFrameworkExceptionpublic CreateTicketData getCreateData(UserLocatorVO payer) throws FrameworkException
TicketServicegetCreateData in interface TicketServiceFrameworkExceptionpublic TicketData getData(TicketVO vo) throws FrameworkException
TicketServicegetData in interface TicketServiceFrameworkExceptionpublic EasyInvoiceData getEasyInvoiceData(PerformPaymentDTO params) throws FrameworkException
TicketServiceTicketService.prepareEasyInvoice(PrepareEasyInvoiceParams)
The resulting data will contain the resolved read-only custom field values.
The resulting PerformPaymentTypeData will contain the custom fields for the missing values.getEasyInvoiceData in interface TicketServiceFrameworkExceptionpublic TicketPaymentTypeData getTicketPaymentTypeData(TransferTypeVO transferType) throws FrameworkException
TicketServicegetTicketPaymentTypeData in interface TicketServiceFrameworkExceptionpublic boolean hasViewPermission(InternalAccountOwner owner)
public boolean isAccessible(Ticket ticket)
public PrepareEasyInvoiceData prepareEasyInvoice(PrepareEasyInvoiceParams params) throws FrameworkException
TicketServiceEntityNotFoundException will be thrown.prepareEasyInvoice in interface TicketServiceFrameworkExceptionpublic ApproveTicketPreviewVO previewApprove(TicketVO ticketVO) throws FrameworkException
TicketServiceTicketStatus.APPROVED or TicketStatus.OPEN without a success url.previewApprove in interface TicketServiceFrameworkExceptionpublic TicketProcessResult process(ProcessTicketDTO params) throws TransferException, FrameworkException
TicketServiceTicketStatus.APPROVED a new direct payment will be generated and the new
ticket status will be: TicketStatus.PROCESSED.
There could be a case where this method is invoked for an already processed ticket (e.g. the ticket has both a
success url and an success webhook), for it, only in case the given process code is the correct one this method
runs without errors and returns the same result as the previous invocation (no payment is generated) but with the
TicketProcessResult.ACTUALLY_PROCESSED flag in false.process in interface TicketServiceTransferExceptionFrameworkExceptionpublic Page<TicketEntryVO> search(TicketQuery query) throws FrameworkException
TicketServicesearch in interface TicketServiceFrameworkExceptionprotected org.cyclos.impl.access.EntityCheck<?> resolveEntityCheck()
BaseServiceSecurityEntityCheck managed by this security component, or null if
noneresolveEntityCheck in class BaseServiceSecurity