Android SDK - Transaction Flow Rule Module

DOCS

Last updated: Aug 15th, 7:07am

The transaction flow rule module provides additional flexibilty when managing transaction flows. The traditional Transaction Module supports a simple but ridgid transaction flow. Most transactions employ the greater flexibility provided by the Transaction Flow Rule methods, however, certain methods still require the basic design offered by the traditional transaction module.

The transaction flow rule module exposes methods that allow developers to identify a particular step, or flow rule, in an overall transaction. Developers can then provide the associated parameters used to retrieve or submit metadata required to complete that flow rule. Each flow rule can be manually populated or the builder can be used to automate processing of the flow rules.

The methods described in this section enable the developer to manually populate each instance of the methods required to process each stage of a transaction through the various flow rules.

Set Listeners

To receive the callback responses for methods originating in the UI package of the transaction flow rule module, set the listeners to ensure responses are sent to the correct module.

ItemDescription
Set ListenerThe com.paydiant.android.ui.service.transactionflow.TransactionFlowManagementService uses one of the following two implementations for its listener:
com.paydiant.android.ui.service.transactionflow.ITransactionFlowManagementListener
or an overridden instance of
com.paydiant.android.ui.service.transactionflow.TransactionFlowManagementListenerAdapter
TransactionFlowManagementService.setTransactionFlowManagementListener(ITransactionFlowManagementListener listener)
Remove Listenervoid removeListener();
Removes the service listener and set it to null

Retrieve Transaction Metadata Without Polling

This method retrieves any relevant transaction metadata for the applicable flow rule being processed. For example, if the flow rule is SUBMIT_OFFERS, this method might need to be called in order to obtain the list of offers that are eligible for the transaction in order to display them to the user for selection. This method does not manage polling or caching within the SDK. App developers are therefore required to implement the necessary polling mechanisms for eligible flow rules.

ItemDescription
UI Methodvoid retrieveTransactionMetaDataWithoutPolling (TransactionMetaDataParameters transactionMetaDataParameters);

Exposed in the com.paydiant.android.ui.service.transactionflow.TransactionFlowManagementService package
Applicable Listener Callbacksvoid onRetrieveTransactionMetaDataSuccess(TransactionMetaDataResponse transactionMetaDataResponse)
Returns the metadata relevant to the parameters in the originating call.

void onTransactionFlowManagementError(PaydiantException exception);
Called when the metadata could not be obtained due to the error identified in the RETRIEVE_TRANSACTION_METADATA_EVENT exception event code.
Core MethodExposed in the com.paydiant.android.core.facade.TransactionFlowManagerFacade package

TransactionMetaDataResponse retrieveTransactionMetaDataWithoutPolling (TransactionMetaDataParameters transactionMetaDataParameters);

Update Transaction

This method updates the transaction with any relevant data for the executing flow rule. For example, if the flow rule is SUBMIT_OFFERS, this method is called to submit any offer that the user has selected to redeem so the transaction amount can be reduced accordingly and the POS can be informed of the update. The transactionParameters values required varies depending on the flow rule that is currently applicable.

ItemDescription
UI Methodvoid updateTransaction(TransactionParameters transactionParameters);

Exposed in the com.paydiant.android.ui.service.transactionflow.TransactionFlowManagementService package
Applicable Listener Callbacksvoid onUpdateTransactionSuccess(TransactionResponse transactionResponse)

Called to confirm that the transaction was successfully updated.

Note: ATM Partial Payment Consideration: In the event that an ATM has insufficient case to fulfill the entire amount of a withdrawal request, but some portion of cash has already been dispense, the response object in the completion block will return a PARTIAL_PAYMENT_SUCCESS transaction status and an updated amount value. Mobile wallet apps that support ATM withdrawals must be configured to handle this variable success case.

void onTransactionFlow
ManagementError(PaydiantException exception);

Called when the metadata could not be obtained due to the error identified in the UPDATE_TRANSACTION_EVENT exception event code.
Core MethodTransactionResponse updateTransaction(TransactionParameters transactionParameters);

Exposed in the com.paydiant.android.core.facade.TransactionFlowManagerFacade package

Generate Access Code

This method produces a randomly generated, non-leading-zero integer of the number of digits specified in the length parameter that can be used to satisfy a processor’s requirement for a secondary identification in pre-auth transactions. For example, if the flow rule is SUBMIT_TENDER_FOR_FUEL_WITH_SECONDARY_ID, this method is called to produce the value for the secondaryIdentification data input.

ItemDescription
UI MethodString generateAccessCode(int length);

Exposed in the com.paydiant.android.ui.service.transactionflow.TransactionFlowManagementService package
listener CallbacksThere are no listener callbacks associated with this method.
Core Methodpublic String generateAccessCode(int length);

Exposed in the com.paydiant.android.core.facade.TransactionFlowManagerFacade package.