Class ReceiptUtils

java.lang.Object
com.avoka.fc.core.util.ReceiptUtils

public class ReceiptUtils extends Object
Provides PDF Receipt utility methods.
Since:
4.0.0
  • Constructor Details

    • ReceiptUtils

      public ReceiptUtils()
  • Method Details

    • renderPdfReceipt

      public static byte[] renderPdfReceipt(Submission submission)
      Render the submissions customer PDF receipt and return the PDF byte data.
      Parameters:
      submission - the submission record (not null)
      Returns:
      the customer PDF byte data
      Since:
      4.2.0
    • renderPdfReceipt

      public static void renderPdfReceipt(Submission submission, HttpServletRequest request, HttpServletResponse response)
      Render a temporary PDF receipt for the given submission to the provided servlet response. This method will
      Parameters:
      submission - the submission providing the XML data and receipt template to render (required)
      request - the servlet request (required)
      response - the servlet response (required)
    • getPdfReceiptWithEmbeddedData

      public static byte[] getPdfReceiptWithEmbeddedData(Submission submission) throws IOException
      Return a PDF receipt file for the given submission, with the associated transaction form XML and file attachments included in the PDF receipt document. This type of PDF is useful for a document of record storage.
      Parameters:
      submission - the submission, must be in Receipt Complete status and transaction data must not be deleted (required)
      Returns:
      the PDF document byte array
      Throws:
      IOException - if an rendering error occurs
      Since:
      4.1.8