Android SDK - Order History Module

DOCS

Last updated: Aug 15th, 7:56am

The Order History module of the Android SDK exposes the endpoints that allow issuing partners who enable online ordering through the mobile payments app to manage a user’s order history and location preferences in order to streamline repeat orders.

ServiceDescription
UI Servicecom.paydiant.android.ui.service.orderhistory.OrderHistoryService
Core Servicecom.paydiant.android.core.facade.OrderHistoryManagerFacade

Set Order History Service Listeners

To invoke the callback methods returned by the Paydiant service in response to the methods invoked by the Order History module of the SDK, set an implementation of the listener interface in the UI Service class:com.paydiant.android.ui.service.orderhistory.IOrderHistoryServiceListener or an overridden instance of:com.paydiant.android.ui.service.orderhistory.OrderHistoryServiceListenerAdapter

MethodDescription
Set Listenervoid setOrderHistoryServiceListener
(IOrderHistoryServiceListener orderHistoryServiceListener);
Remove Listenervoid removeListener();
Call this method to remove the order history listener and set it to null.

Get Order Summary

Invoke this method from the core or UI service package to retrieve the set of objects representing the high level order data for orders that have previously been placed for the logged-in user.

MethodDescription
UI Methodpublic void retrieveOrderHistorySummary();
Successvoid onRetrieveOrderHistorySummarySuccess(List < Order > orderList);
The success callback returns an instance of the orderList array containing the list of orders contained in the user’s history.
Failurevoid onOrderHistoryServiceError(PaydiantException exception)
The failure callback returns an instance of PaydiantException detailing the nature of the failure and the relevant errors as they relate to the RETRIEVE_ORDER_HISTORY_SUMMARY_EVENT.
Core Methodpublic List < order > retrieveOrderHistorySummary();
ReturnsThe raw JSON output of the response - either the orderList or the relevant exception.

Errors

When retrieving the order history summary, the following errors are applicable for the RETRIEVE_ORDER_HISTORY_SUMMARY_EVENT:

ErrorDescription
500An unknown error occurred internally in the server.

Get Order Details

Invoke this method from the core or UI service package to retrieve the comprehensive data related to a specific order in the user’s history.

MethodDescription
UI Methodpublic void retrieveOrder (String orderId);

orderId - Paydiant’s unique identifier for the order, as persisted in the user’s history.
Successvoid onRetriveOrderSuccess(Order order);
The success callback returns an instance of the order object containing all metadata pertaining to the requested orderId.
Failurevoid onOrderHistoryServiceError(PaydiantException exception)
The failure callback returns an instance of PaydiantException detailing the nature of the failure and the relevant errors as they relate to the RETRIEVE_ORDER_EVENT.
Core Methodpublic Order retrieveOrder(String orderId);
ReturnsThe raw JSON output of the response. This may be either the order data or the relevant exception.

Errors

When getting the details for a specific order, the following errors are applicable for the RETRIEVE_ORDER_EVENT:

ErrorDescription
400One or more parameters in the request is invalid.
500An unknown error occurred internally in the server.