Package com.avoka.tm.svc
Class ReceiptGenerator
java.lang.Object
com.avoka.tm.svc.ReceiptGenerator
Provides a PDF Receipt generate service which supports rendering PDF receipts on demand.
This Receipt generate service only supports PhantomJSRenderReceiptService and PuppeteerRenderReceiptService
Examples
The example below illustrates how to generate receipt byte array using the provided parameter data.
import com.avoka.tm.svc.ReceiptGenerator byte[] receiptBytes = new ReceiptGenerator() .setFormCode("formCode") .setFormTemplateVersion("1.0.0") .setSvcName("serviceName") .setSvcVersion("1.0.0") .setXml("xmlData") .generateReceipt()
- Since:
- 24.10.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Generate the PDF based on the provided params and return the PDF byte data.setFormCode
(String formCode) Set the formCode parameter.setFormTemplateVersion
(String formTemplateVersion) Set the formTemplateVersionsetSvcClientCode
(String svcClientCode) Set the receipt service client Code to render.setSvcName
(String svcName) Set the receipt service name to render.setSvcVersion
(String svcVersion) Set the receipt service version to invoke.Set the xml parameter.
-
Constructor Details
-
ReceiptGenerator
public ReceiptGenerator()
-
-
Method Details
-
setFormCode
Set the formCode parameter.- Parameters:
formCode
- the formCode to render (required)- Returns:
- the receipt generator service
-
setFormTemplateVersion
Set the formTemplateVersion- Parameters:
formTemplateVersion
- the version number of the form to render. If not set, the current version will be resolved- Returns:
- the receipt generator service
-
setSvcClientCode
Set the receipt service client Code to render.- Parameters:
svcClientCode
- the client code of the receipt service to render (optional). If not set, will look up for global one- Returns:
- the receipt generator service
-
setSvcName
Set the receipt service name to render.- Parameters:
svcName
- the receipt service name to render (required)- Returns:
- the receipt generator service
-
setSvcVersion
Set the receipt service version to invoke.- Parameters:
svcVersion
- the receipt service version number to invoke (required)- Returns:
- the receipt generator service
-
setXml
Set the xml parameter.- Parameters:
xml
- the form XML String to render (required)- Returns:
- the receipt generator service
-
generateReceipt
public byte[] generateReceipt()Generate the PDF based on the provided params and return the PDF byte data.- Returns:
- the generated PDF data in byte array
-