Android SDK - Order History Module

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.

Service

Description

UI Service

com.paydiant.android.ui.service.orderhistory.OrderHistoryService

Core Service

com.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

void 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.

Method

Description

UI Method

public void retrieveOrderHistorySummary();

Success

void 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.

Failure

void 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 Method

public List < order > retrieveOrderHistorySummary();

Returns

The 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:

Error

Description

500

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

Method

Description

UI Method

public void retrieveOrder (String orderId);

orderId - Paydiant’s unique identifier for the order, as persisted in the user’s history.

Success

void onRetriveOrderSuccess(Order order);The success callback returns an instance of the order object containing all metadata pertaining to the requested orderId.

Failure

void 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 Method

public Order retrieveOrder(String orderId);

Returns

The 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: