Class ReceiptContract
- java.lang.Object
-
- com.clover.sdk.v1.printer.ReceiptContract
-
public final class ReceiptContract extends Object
A class defining the contract to be implemented by content providers that wish to provide additional content on customer receipts.To register a receipt registration content provider with the Clover platform, use the
Receipt registration content providers must support either, or both theReceiptRegistrationConnector.register(Uri)
method.ReceiptContract.Text.CONTENT_TYPE
andReceiptContract.Image.CONTENT_TYPE
content types.If the provider supports the
ReceiptContract.Text.CONTENT_TYPE
content type, it must implement theContentProvider.query(android.net.Uri, String[], String, String[], String)
method. If the returned cursor contains the columnReceiptContract.TextColumns.TEXT
, the string value of the column is added to the receipt. The content provider may return a null cursor, or a cursor that does not contain theReceiptContract.TextColumns.TEXT
column to indicate that the receipt should not be modified.If the content provider supports the
ReceiptContract.Image.CONTENT_TYPE
content type, it must implement theContentProvider.openFile(android.net.Uri, String)
method, and the returned file descriptor value must either:-
Point to a file that contains bitmap data that can be decoded using
BitmapFactory.decodeStream(java.io.InputStream)
. For example, it can be a PNG, GIF, or JPG encoded file. -
Be
null
, indicating that the content provider declined to add image content to this receipt.
PARAM_*
query parameters listed below. This may be used as input to other Clover services to obtain additional information about the order, customer, etc. Receipt registration content providers have a maximum of 2 seconds to return receipt content. It is advisable to stay well below this limit. You must not perform long-running tasks such as network I/O. If the receipt registration content provider repeatedly fails to respond in the allotted time, throws exceptions, or otherwise fails to return valid content as specified above, the provider may be temporarily or permanently disabled.It is recommended that apps registering receipt registration providers implement a pre-uninstall hook and unregister the content provider. See:
Intents.ACTION_APP_PRE_UNINSTALL
for more information. -
Point to a file that contains bitmap data that can be decoded using
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReceiptContract.Image
static class
ReceiptContract.Text
static interface
ReceiptContract.TextColumns
Column name for returning text-only receipt data.
-
Field Summary
Fields Modifier and Type Field Description static String
PARAM_ACCOUNT_NAME
The Clover account that is printing the receipt.static String
PARAM_ACCOUNT_TYPE
The Clover account type is printing the receipt.static String
PARAM_FLAGS
The print flags.static String
PARAM_MERCHANT_ID
The merchant ID.static String
PARAM_ORDER_ID
The order ID of the receipt to be printed.static String
PARAM_PAYMENT_ID
The payment ID of the receipt to be printed.static String
PARAM_RECEIPT_WIDTH
The receipt width
-
Constructor Summary
Constructors Constructor Description ReceiptContract()
-
-
-
Field Detail
-
PARAM_ORDER_ID
public static final String PARAM_ORDER_ID
The order ID of the receipt to be printed.- See Also:
- Constant Field Values
-
PARAM_ACCOUNT_NAME
public static final String PARAM_ACCOUNT_NAME
The Clover account that is printing the receipt.- See Also:
- Constant Field Values
-
PARAM_ACCOUNT_TYPE
public static final String PARAM_ACCOUNT_TYPE
The Clover account type is printing the receipt.- See Also:
- Constant Field Values
-
PARAM_MERCHANT_ID
public static final String PARAM_MERCHANT_ID
The merchant ID.- See Also:
- Constant Field Values
-
PARAM_FLAGS
public static final String PARAM_FLAGS
The print flags.- See Also:
- Constant Field Values
-
PARAM_RECEIPT_WIDTH
public static final String PARAM_RECEIPT_WIDTH
The receipt width- See Also:
- Constant Field Values
-
PARAM_PAYMENT_ID
public static final String PARAM_PAYMENT_ID
The payment ID of the receipt to be printed.- See Also:
- Constant Field Values
-
-