Package org.cyclos.services.banking
Interface TicketService
-
- All Superinterfaces:
Service
- All Known Subinterfaces:
TicketServiceLocal
public interface TicketService extends Service
Service interface to manage tickets.
A ticket is a transaction having a receiver user and represents a pending payment to be accepted by any user (the payer) who want (and can) make the payment. It also could be created to be accepted by a specific payer.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TicketVOapprove(@NotNull ApproveTicketDTO params)Approves a ticket, as a payer, only if status isTicketStatus.OPEN.
If there is no "success URL" defined then it generates a new direct payment and the ticket goes toTicketStatus.PROCESSED.SerializableInputStreambarcode(@NotNull TicketBarcodeParams params)Generates a two-dimensional barcode (aka QR code) only if status isTicketStatus.OPENcontaining a URL of the form: .../pay/ticket_id (e.g https://www.cyclos.org/pay/1234567890123456789).voidcancel(@NotNull TicketVO ticket)Cancels the ticket only if status isTicketStatus.OPENand the logged user is the ticket's receiver or a manger of him.TicketVOcreate(@NotNull CreateTicketDTO params)Creates a new ticket with statusTicketStatus.OPENfor the logged user (i.e setting it as the receiver).CreateTicketDatagetCreateData(UserLocatorVO owner, UserLocatorVO payer)Returns data used to crate a new ticket for the given user, optionally with a fixed payer.TicketDatagetData(@NotNull TicketVO vo)Returns data to view the ticket's details.TicketPaymentTypeDatagetTicketPaymentTypeData(UserLocatorVO owner, @NotNull TransferTypeVO transferType)Returns the data for a specific payment type used to create a new ticketApproveTicketPreviewVOpreviewApprove(@NotNull TicketVO ticket)Previews the payment which would be performed when approving the given ticket as the payer.TicketProcessResultprocess(ProcessTicketDTO params)Processes a ticket as the receiver of the payment (i.e the ticket creator).
Only if the ticket status isTicketStatus.APPROVEDa new direct payment will be generated and the new ticket status will be:TicketStatus.PROCESSED.
-
-
-
Method Detail
-
approve
TicketVO approve(@NotNull @NotNull ApproveTicketDTO params) throws TransferException, FrameworkException
Approves a ticket, as a payer, only if status isTicketStatus.OPEN.
If there is no "success URL" defined then it generates a new direct payment and the ticket goes toTicketStatus.PROCESSED. Otherwise, no payment is generated and the ticket goes toTicketStatus.APPROVEDstatus. The payment will be generated only after being processed by the receiver.- Throws:
TransferExceptionFrameworkException
-
barcode
SerializableInputStream barcode(@NotNull @NotNull TicketBarcodeParams params) throws FrameworkException
Generates a two-dimensional barcode (aka QR code) only if status isTicketStatus.OPENcontaining a URL of the form: .../pay/ticket_id (e.g https://www.cyclos.org/pay/1234567890123456789).- Throws:
FrameworkException
-
cancel
void cancel(@NotNull @NotNull TicketVO ticket) throws FrameworkExceptionCancels the ticket only if status isTicketStatus.OPENand the logged user is the ticket's receiver or a manger of him.- Throws:
FrameworkException
-
create
TicketVO create(@NotNull @NotNull CreateTicketDTO params) throws FrameworkException
Creates a new ticket with statusTicketStatus.OPENfor the logged user (i.e setting it as the receiver).- Throws:
FrameworkException
-
getCreateData
CreateTicketData getCreateData(UserLocatorVO owner, UserLocatorVO payer) throws FrameworkException
Returns data used to crate a new ticket for the given user, optionally with a fixed payer.- Throws:
FrameworkException
-
getData
TicketData getData(@NotNull @NotNull TicketVO vo) throws FrameworkException
Returns data to view the ticket's details.- Throws:
FrameworkException
-
getTicketPaymentTypeData
TicketPaymentTypeData getTicketPaymentTypeData(UserLocatorVO owner, @NotNull @NotNull TransferTypeVO transferType) throws FrameworkException
Returns the data for a specific payment type used to create a new ticket- Throws:
FrameworkException
-
previewApprove
ApproveTicketPreviewVO previewApprove(@NotNull @NotNull TicketVO ticket) throws FrameworkException
Previews the payment which would be performed when approving the given ticket as the payer. The ticket status must beTicketStatus.APPROVEDorTicketStatus.OPENwithout a success url.- Throws:
FrameworkException
-
process
TicketProcessResult process(ProcessTicketDTO params) throws TransferException, FrameworkException
Processes a ticket as the receiver of the payment (i.e the ticket creator).
Only if the ticket status isTicketStatus.APPROVEDa 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 theTicketProcessResult.ACTUALLY_PROCESSEDflag in false.- Throws:
TransferExceptionFrameworkException
-
-