Android SDK - Loyalty Module

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.

Package Service
UI Implementation Exposed through the com.paydiant.android.ui.service.loyalty.LoyaltyManagementService class.
Core Implementation Exposed 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.

Item Description
UI Method void setLoyaltyManagementListener(ILoyaltyManagementListener listener);
Remove Listener void 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.

Item Description
UI Method void isRegisteredForLoyalty();
Applicable Listener Callbacks void 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 Method boolean 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.

Item Description
UI Method void retrieveLoyaltyGlobalProfileMetaData();
Applicable Listener Callbacks void 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 Method List < 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.

Note: Before executing this method, the app must have already obtained the required metatdata properties for the global profile by running the Get Loyalty Properties method.

Item Description
UI Method void registerCustomerForLoyalty(List < LoyaltyProfileData > loyaltyProfileDataList);
Applicable Listener Callbacks void 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 method void registerCustomerForLoyalty(ListLoyaltyProfileData 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.

Item Description
UI Method void retrieveAvailableLoyaltyPrograms();
Applicable Listener Callbacks void 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 Method List < 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.

Item Description
UI Method void retrieveMyLoyaltyPrograms();
Applicable Listener Callbacks void 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 Method List < 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.

Item Description
UI Method void retrieveLoyaltyProgram(String loyaltyProgramUri);
Applicable Listener Callbacks void 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 Method LoyaltyProgram 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.

Item Description
UI Method void refreshPointsBalance(String loyaltyProgramUri);
Applicable Listener Callbacks void 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 Method int refreshPointsBalance(String loyaltyProgramUri)

Note: If calling this method directly following a purchase or refund transaction in order to show the updated total points balance with the awarded points from the immediately preceding transaction, implement a programmatic delay or polling call to ensure that the server has time to apply the accrual. Otherwise, an inaccurate "no accrual activities detected" response may be returned.

Get Points Earned

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

Item Description
UI Method void retrieveLoyaltyPointsForTransaction(String paydiantRefId);

Applicable Listener Callbacks void 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 Mthod List < AccrualActivity > retrieveLoyaltyPointsForTransaction(String paydiantRefId)

Note: If calling this method directly following a purchase or refund transaction in order to show the updated total points balance with the awarded points from the immediately preceding transaction, implement a programmatic delay or polling call to ensure that the server has time to apply the accrual. Otherwise, an inaccurate "no accrual activities detected" response may be returned.

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.

Item Description
UI Method void recordExternalActivity(ExternalActivity externalActivity);
Applicable Listener Callbacks void 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 Method List<AccrualActivity> recordExternalActivity(ExternalActivity externalActivity);

Other Resources

javadocs

Feedback

Have feedback?

Let us know.