Android SDK - Loyalty Module

DOCS

Last updated: Aug 15th, 7:35am

The Loyalty module of the SDK describes the functionality related to adding, editing, deleting, and otherwise modifying the loyalty subscriptions available within a registered wallet from directly within the app interface.

PackageService
UI ImplementationExposed through the com.paydiant.android.ui.service.loyalty.LoyaltyManagementService class.
Core ImplementationExposed through the com.paydiant.android.core.facade.LoyaltyManagerFacade class.

Set Loyalty Manager Listener

Sets com.paydiant.android.ui.service.loyalty.ILoyaltyManagementListener or an overridden instance of com.paydiant.android.ui.service.loyalty.LoyaltyManagementListenerAdapter so callback methods can be invoked during execution of loyalty methods.

ItemDescription
UI Methodvoid setLoyaltyManagementListener(ILoyaltyManagementListener listener);
Remove Listenervoid removeListener();
Call this method to remove the loyalty manager listener and set it to null.

Check Loyalty Registration

This method checks to see whether the currently logged-in user is enrolled in Paydiant’s loyalty program. Successful completion of this method passes the response as the value of the loyaltyStatus parameter.

ItemDescription
UI Methodvoid isRegisteredForLoyalty();
Applicable Listener Callbacksvoid onIsRegisteredForLoyaltySuccess(boolean loyaltyStatus);
Called when the user’s registration status has been successfully determined.

void onLoyaltyManagement Error(PaydiantException exception)
Called when the registration status could not be retrieved due to an error.
Core Methodboolean isRegisteredForLoyalty();

Get Loyalty Properties

Since different loyalty programs will require different profile information for the user, this method retrieves the metadata properties that are specific to the relevant Loyalty program.

ItemDescription
UI Methodvoid retrieveLoyaltyGlobalProfileMetaData();
Applicable Listener Callbacksvoid onRetrieveLoyaltyGlobalProfileMetaDataSuccess(List < LoyaltyProfileData> loyaltyProfileDataList);
Called when the loyalty metadata properties have been successfully retrieved.

void onLoyaltyManagementError(PaydiantException exception);
Called when the loyalty metadata could not be retrieved due to an error.
Core MethodList < LoyaltyProfileData > retrieveLoyaltyGlobalProfileMetaData()

Create Loyalty Profile

This method creates a global loyalty profile for the logged-in user, which can thereafter be used to subscribe to multiple specific loyalty programs. This method should pass the populated values for the properties retrieved in the Get Loyalty Properties method in the LoyaltyProfileData object with retrieved parameters as keys.

ItemDescription
UI Methodvoid registerCustomerForLoyalty(List < LoyaltyProfileData > loyaltyProfileDataList);
Applicable Listener Callbacksvoid onRegisterCustomerForLoyaltySuccess();
Called when the new registration is successfully created.

void onLoyaltyManagementError(PaydiantException exception);
Called when the registration could not be created due to an error.
Core methodvoid registerCustomerForLoyalty(List<LoyaltyProfileData> loyaltyProfileDataList);

Get Available Loyalty Programs

This method enables the developer to retrieve and publish a list of all loyalty programs in which the user is qualified to participate.

ItemDescription
UI Methodvoid retrieveAvailableLoyaltyPrograms();
Applicable Listener Callbacksvoid onRetrieveAvailableLoyaltyProgramsSuccess(List < LoyaltyProgram > loyaltyProgramList);
Called when the list of available loyalty programs is successfully retrieved.

void onLoyaltyManagementError(PaydiantException exception);
Called when the loyalty programs could not be retrieved due to an error.
Core MethodList < LoyaltyProgram > retrieveAvailableLoyaltyPrograms();

Get Enrolled (Subscribed) Loyalty Programs

This method enables the developer to retrieve and publish a list of specific loyalty programs in which the logged-in user has already enrolled within the mobile wallet.

ItemDescription
UI Methodvoid retrieveMyLoyaltyPrograms();
Applicable Listener Callbacksvoid onRetrieveMyLoyaltyProgramsSuccess(List < LoyaltyProgram > loyaltyProgramList);
Called when the list of enrolled loyalty programs is successfully retrieved.

void onLoyaltyManagementError(PaydiantException exception);
Called when the loyalty programs could not be retrieved due to an error.
Core MethodList < LoyaltyProgram > retrieveMyLoyaltyPrograms();

Get a Specific Loyalty Program

This method enables a developer to retrieve the details for the loyalty program specified in the parameter by its unique URI.

ItemDescription
UI Methodvoid retrieveLoyaltyProgram(String loyaltyProgramUri);
Applicable Listener Callbacksvoid onRetrieveLoyaltyProgramSuccess(LoyaltyProgram loyaltyProgram)
Called when the loyalty program is successfully retrieved.

void onLoyaltyManagementError(PaydiantException exception)
Called when the loyalty program could not be retrieved due to an error.
Core MethodLoyaltyProgram retrieveLoyaltyProgram(String loyaltyProgramUri);

Refresh Loyalty Points Balance

This method enables the developer to retrieve and publish the current points balance for the loyalty program specified.

ItemDescription
UI Methodvoid refreshPointsBalance(String loyaltyProgramUri);
Applicable Listener Callbacksvoid onRefreshLoyaltyPointsBalanceSuccess(int loyaltyPointsBalance)
Called when the loyalty program balance is successfully retrieved.

void onLoyaltyManagementError(PaydiantException exception)
Called when the program balance could not be retrieved due to an error.
Core Methodint refreshPointsBalance(String loyaltyProgramUri)

Get Points Earned

This method enables the developer to retrieve and publish the points earned for a specific transaction.

ItemDescription
UI Methodvoid retrieveLoyaltyPointsForTransaction(String paydiantRefId);

Applicable Listener Callbacksvoid onRetrieveLoyaltyPointsForTransactionSuccess(List < AccrualActivity > accrualActivityList)
Called when the earned points are successfully retrieved.

void onLoyaltyManagementError(PaydiantException exception)
Called when the earned points could not be retrieved due to an error.
Core MthodList < AccrualActivity > retrieveLoyaltyPointsForTransaction(String paydiantRefId)

Record External Activity Points

This method enables the developer to record points in the loyalty program for qualified events that are performed outside of the mobile wallet, such as social networking.

ItemDescription
UI Methodvoid recordExternalActivity(ExternalActivity externalActivity);
Applicable Listener Callbacksvoid onRecordExternalActivitySuccess(List < AccrualActivity > accrualActivityList)
Called when the earned external points are successfully recorded.

void onLoyaltyManagementError(PaydiantException exception)
Called when the earned points could not be recorded due to an error.
Core MethodList&lt;AccrualActivity&gt; recordExternalActivity(ExternalActivity externalActivity);