Android SDK - Receipt Management Module

The receipt management module of the Android SDK enables the developer to retrieve the authenticated user’s payment transaction history to display receipt data in the mobile payments app or to populate receipt data as needed by other calls, such as transaction voids or refunds.

The services exposed in the receipt management module are located in the following package classes:

Service Description
UI Service com.paydiant.android.ui.service.receipt.IReceiptRetrievalService
Core Service com.paydiant.android.core.facade.ReceiptManagerFacade

Set Receipt Management Service Listeners

To invoke the callback methods returned by the Paydiant service in response to the methods invoked by the receipt management module of the SDK, set an implementation of the listener interfaces in the appropriate UI service class.

Service Description
UI Service com.paydiant.android.ui.service.receipt.IReceiptRetrievalListener
or an overridden instance of:
com.paydiant.android.ui.service.receipt.ReceiptRetrievalListenerAdapter
Set Listener void setReceiptRetrievalListener(IReceiptRetrievalListener listener);
Remove Listener void removeListener();
Call this method to remove the receipt retrieval listener and set it to null.

Retrieve Receipt Summary

Invoke this method from the core or UI service package to obtain an array of receipt summary objects representing each historical transaction matching the parameters of the request, each of which includes a high level snapshot of the transaction, rather than the comprehensive details.

Note: The receipt summary retrieval functionality is exposed through several overloaded variations of the main method in order to accommodate different filtering options for the call, but all of the variations return the same callbacks.

Item Description
UI Method public void retrieveReceiptSummary(int startIndex, int records);

Filtered by Date
public void retrieveReceiptSummary(int startIndex, int records, Date startDate, Date endDate);

Filtered by Merchant
public void retrieveReceiptSummary(string acceptancePartnerUri, string acceptancePartnerPartnerUri, int startIndex, int records);

Filtered by Merchant and Date
public void retrieveReceiptSummary(string acceptancePartnerUri, string acceptancePartnerPartnerUri, int startIndex, int records, Date startDate, Date endDate);
Success void onReceiptSummaryRetrievalSuccess (ReceiptSummaryResponseBody receiptSummaryResponseBody);
Returns an instance of the receiptSummaryResponseBody containing the applied filters and the applicable set of matching receipt summaries.
Failure void onReceiptRetrievalError(PaydiantException exception)
Returns an instance of PaydiantException detailing the nature of the failure and the relevant errors as they relate to the RETRIEVE_RECEIPT_SUMMARY_EVENT.
Core Method public ReceiptSummaryResponseBody retrieveReceiptSummary(int startIndex, int records);

Filtered by Date
public ReceiptSummaryResponseBody retrieveReceiptSummary(int startIndex, int records, Date startDate, Date endDate);

Filtered by Merchant
public ReceiptSummaryResponseBody retrieveReceiptSummary (string acceptancePartnerUri, string acceptancePartnerPartnerUri, int startIndex, int records);

Filtered by Merchant and Date
public ReceiptSummaryResponseBody retrieveReceiptSummary (string acceptancePartnerUri, string acceptancePartnerPartnerUri, int startIndex, int records, Date startDate, Date endDate);

Returns the raw JSON output of the response - either the ReceiptSummaryResponseBody containing the requested summaries or the relevant exception.
Parameters startIndex - Return only receipts from this record forward.
records - Return up to a maximum of this many receipts.
startDate - Return only receipts that were generated on or after this date.
endDate - Return only receipts that were generated on or before this date.
acceptancePartnerUri - Return only receipts for transactions conducted with this merchant.
acceptancePartnerPartnerUri - Return only receipts for transactions conducted with this registered partner of the merchant.

Errors

When retrieving the receipts summary, the following error is applicable for the RETRIEVE_RECEIPT_SUMMARY_EVENT:

Error Description
500 An unknown error occurred internally in the server.

Retrieve Receipt Details

Invoke this method from the core or UI service package to obtain the comprehensive receipt details about the transaction referenced in the request.

Item Description
UI Method public void retrieveReceiptDetails(String paydiantReferenceId);

paydiantReferenceId - Paydiant’s unique identifier of the transaction for which the receipt is requested.
Success void onReceiptDetailsRetrievalSuccess (Receipt receiptDetails);

Returns an instance of the com.paydiant.android.core.domain.transactionflow.Receipt class that lists the entire breakdown of receipt properties, including adjustments such as tip, redeemed offers, tax, and other items.
Failure void onReceiptRetrievalError(PaydiantException exception)

Returns an instance of PaydiantException detailing the nature of the failure and the relevant errors as they relate to the RETRIEVE_RECEIPT_DETAILS_EVENT.
Core Method public com.paydiant.android.core.domain.transactionflow. Receipt retrieveReceiptDetails(String paydaintReferenceId);

Errors

When retrieving the receipt details, the following errors are applicable for the RETRIEVE_RECEIPT_DETAILS_EVENT:

Error Description
400 One or more input parameters is invalid.
500 An unknown error occurred internally in the server.

Retrieve Refundable Receipts

This method returns the list of refundable receipts for the specified merchant. Records in the returned list are ordered chronologically by record number and are truncated if the maximum number of records specified by the consumer is exceeded.

Note: The refundable receipts retrieval functionality is exposed through several overloaded variations of the main method in order to accommodate different filtering options for the call, but all of the variations return the same callbacks.

UI implementation

Item Description
UI Method void retrieveRefundableReceipts(string acceptancePartnerUri, string acceptancePartnerPartnerUri, string storeLocationUri, int startIndex, int noOfRecords);

Filtered by Date
void retrieveRefundableReceipts(string acceptancePartnerUri, string acceptancePartnerPartnerUri, string storeLocationUri, int startIndex, int noOfRecords, Date startDate, Date endDate);
Success void onReceiptListRetrievalSuccess (ReceiptList receiptList);

Returns an instance of receiptList containing the applied filters and the applicable set of matching receipts.
Failure void onReceiptRetrievalError(PaydiantException exception)

Returns an instance of PaydiantException detailing the nature of the failure and the relevant errors.
Core Method public ReceiptList retrieveRefundableReceipts(string acceptancePartnerUri, string acceptancePartnerPartnerUri, string storeLocationUri, int startIndex, int noOfRecords);

Filtered by Date
public ReceiptList retrieveRefundableReceipts(string acceptancePartnerUri, string acceptancePartnerPartnerUri, string storeLocationUri, int startIndex, int noOfRecords, Date startDate, Date endDate);

Returns the raw JSON output of the response - either the ReceiptList containing the requested data or the relevant exception.
Parameters acceptancePartnerUri - Return only receipts for transactions conducted with this merchant.
acceptancePartnerPartnerUri - Return only receipts for transactions conducted with this registered partner of the merchant.
storeLocationUri - Return only receipts for transactions conducted at this particular acceptance location of the merchant.
startIndex - Return only receipts from this record forward.
records - Return up to a maximum of this many receipts.
startDate - Return only receipts that were generated on or after this date.
endDate - Return only receipts that were generated on or before this date.

Errors

When retrieving refundable receipts, the following errors are applicable:

Error Description
500 An unknown error occurred internally in the server.

Retrieve Refundable Split Tender Receipts

This method returns the list of refundable receipts for the specified merchant in which the payment was split across multiple tenders. Records in the returned list are ordered chronologically by record number and are truncated if the maximum number of records specified by the consumer is exceeded.

Note: The refundable receipts retrieval functionality is exposed through several overloaded variations of the main method in order to accommodate different filtering options for the call, but all of the variations return the same callbacks.

Item Description
UI Method void retrieveRefundableReceiptsWithSplitTenderInfo(string acceptancePartnerUri, string acceptancePartnerPartnerUri, string storeLocationUri, int startIndex, int noOfRecords);

Filtered by Date
void retrieveRefundableReceiptsWithSplitTenderInfo(string acceptancePartnerUri, string acceptancePartnerPartnerUri, string storeLocationUri, int startIndex, int noOfRecords, Date startDate, Date endDate);
Success void onReceiptListRetrievalSuccess (receiptList receiptList);

Returns an instance of receiptList containing the applied filters and the applicable set of matching receipts.
Failure void onReceiptRetrievalError(PaydiantException exception)

Returns an instance of PaydiantException detailing the nature of the failure and the relevant errors.
Core Method public ReceiptList retrieveRefundableReceiptsWithSplitTenderInfo (string acceptancePartnerUri, string acceptancePartnerPartnerUri, string storeLocationUri, int startIndex, int noOfRecords);

Filtered by Date
public ReceiptList retrieveRefundableReceiptsWithSplitTenderInfo (string acceptancePartnerUri, string acceptancePartnerPartnerUri, string storeLocationUri, int startIndex, int noOfRecords, Date startDate, Date endDate);

Returns the raw JSON output of the response - either the ReceiptList containing the requested data or the relevant exception.
Parameters acceptancePartnerUri - Return only receipts for transactions conducted with this merchant.
acceptancePartnerPartnerUri - Return only receipts for transactions conducted with this registered partner of the merchant.
storeLocationUri - Return only receipts for transactions conducted at this particular acceptance location of the merchant.
startIndex - Return only receipts from this record forward.
records - Return up to a maximum of this many receipts.
startDate - Return only receipts that were generated on or after this date.
endDate - Return only receipts that were generated on or before this date.

Errors

When retrieving refundable receipts, the following errors are applicable:

Error Description
500 An unknown error occurred internally in the server.

Other Resources

javadocs

Feedback