Android SDK - Receipt Management Module

DOCS

Last updated: Aug 15th, 6:06am

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:

ServiceDescription
UI Servicecom.paydiant.android.ui.service.receipt.IReceiptRetrievalService
Core Servicecom.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.

ServiceDescription
UI Servicecom.paydiant.android.ui.service.receipt.IReceiptRetrievalListener
or an overridden instance of:
com.paydiant.android.ui.service.receipt.ReceiptRetrievalListenerAdapter
Set Listenervoid setReceiptRetrievalListener(IReceiptRetrievalListener listener);
Remove Listenervoid 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.

ItemDescription
UI Methodpublic 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);
Successvoid onReceiptSummaryRetrievalSuccess (ReceiptSummaryResponseBody receiptSummaryResponseBody);
Returns an instance of the receiptSummaryResponseBody containing the applied filters and the applicable set of matching receipt summaries.
Failurevoid 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 Methodpublic 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.
ParametersstartIndex - 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:

ErrorDescription
500An 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.

ItemDescription
UI Methodpublic void retrieveReceiptDetails(String paydiantReferenceId);

paydiantReferenceId - Paydiant’s unique identifier of the transaction for which the receipt is requested.
Successvoid 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.
Failurevoid 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 Methodpublic 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:

ErrorDescription
400One or more input parameters is invalid.
500An 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.

UI implementation

ItemDescription
UI Methodvoid 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);
Successvoid onReceiptListRetrievalSuccess (ReceiptList receiptList);

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

Returns an instance of PaydiantException detailing the nature of the failure and the relevant errors.
Core Methodpublic 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.
ParametersacceptancePartnerUri - 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:

ErrorDescription
500An 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.

ItemDescription
UI Methodvoid 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);
Successvoid onReceiptListRetrievalSuccess (receiptList receiptList);

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

Returns an instance of PaydiantException detailing the nature of the failure and the relevant errors.
Core Methodpublic 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.
ParametersacceptancePartnerUri - 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:

ErrorDescription
500An unknown error occurred internally in the server.