Package com.avoka.fc.core.service
Class ReceiptDataService
- java.lang.Object
-
- com.avoka.fc.core.service.BaseService
-
- com.avoka.fc.core.service.CayenneService
-
- com.avoka.fc.core.service.ReceiptDataService
-
public class ReceiptDataService extends CayenneService
Provides receipt data handling services.
-
-
Constructor Summary
Constructors Constructor Description ReceiptDataService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
clearPaymentReceiptDetails(Submission submission, String receiptXml)
Clears out payment information stored in the receipt data, then stores the updated receipt XML.byte[]
getReceiptPdf(Submission submission, String mode)
Get receipt pdf as byte array.String
getReceiptXml(Submission submission)
Returns the receipt xml data for a submission If a submission has no receipt data but does have submission data, the receipt data will be generated from the form data.protected String
getReceiptXPath(Submission submission)
Return the Receipt XPath for the given submissionboolean
hasReceiptXml(Submission submission)
Returns whether a submission has receipt data Note: If a submission has been deleted, this will return false.void
setPaymentReceiptDetails(Submission submission, String receiptNo, Date paymentDate)
Allows to set the receipt number and payment date to be written in to the Receipt section The Receipt section is looked up using the schema config map for the submission's form deploy Note that this method does NOT commit the changes, it merely writes them into the submission's receipt data.-
Methods inherited from class com.avoka.fc.core.service.CayenneService
commitChanges, deleteObject, deleteObjects, findObject, getDataContext, getDataDomain, getObjectForPK, getObjectStore, newObject, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, refetchEntity, refetchObject, registerNewObject, rollbackChanges, toMap, toMap
-
Methods inherited from class com.avoka.fc.core.service.BaseService
getLogger
-
-
-
-
Method Detail
-
hasReceiptXml
public boolean hasReceiptXml(Submission submission)
Returns whether a submission has receipt data Note: If a submission has been deleted, this will return false. If a submission has no receipt data but does have submission data, the receipt data can be generated from the form data.- Parameters:
submission
- the submission- Returns:
- whether receipt data is available for the submission
-
getReceiptXml
public String getReceiptXml(Submission submission) throws ApplicationException
Returns the receipt xml data for a submission If a submission has no receipt data but does have submission data, the receipt data will be generated from the form data. If receipt data has to be generated from form data, this method stores and commits the receipt data.- Parameters:
submission
- the submission- Returns:
- whether receipt data is available for the submission
- Throws:
ApplicationException
- if the submission is deleted or has neither submission nor receipt data
-
setPaymentReceiptDetails
public void setPaymentReceiptDetails(Submission submission, String receiptNo, Date paymentDate)
Allows to set the receipt number and payment date to be written in to the Receipt section The Receipt section is looked up using the schema config map for the submission's form deploy Note that this method does NOT commit the changes, it merely writes them into the submission's receipt data.- Parameters:
submission
- the submissionreceiptNo
- the receipt number to be usedpaymentDate
- the date and time of payment
-
clearPaymentReceiptDetails
public String clearPaymentReceiptDetails(Submission submission, String receiptXml)
Clears out payment information stored in the receipt data, then stores the updated receipt XML.- Parameters:
submission
- the submission (required, payment status must not be "Completed")receiptXml
- the receipt XML (optional; will be retrieved via the submission data storage service if not specified)- Returns:
- the updated receipt XML
- Since:
- 4.1.2
-
getReceiptPdf
public byte[] getReceiptPdf(Submission submission, String mode)
Get receipt pdf as byte array.- Parameters:
submission
- the submissionmode
- the render receipt modeRequestLog.RECEIPT_MODES
- Returns:
- the byte array for the receipt pdf
-
getReceiptXPath
protected String getReceiptXPath(Submission submission)
Return the Receipt XPath for the given submission- Parameters:
submission
- the submission- Returns:
- the form receipt XPath, if available
-
-