Android SDK - Transaction Flow Rule Module

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.

Item Description
Set Listener The 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 Listener void 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.

Item Description
UI Method void retrieveTransactionMetaDataWithoutPolling (TransactionMetaDataParameters transactionMetaDataParameters);

Exposed in the com.paydiant.android.ui.service.transactionflow.TransactionFlowManagementService package
Applicable Listener Callbacks void 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 Method Exposed in the com.paydiant.android.core.facade.TransactionFlowManagerFacade package

TransactionMetaDataResponse retrieveTransactionMetaDataWithoutPolling (TransactionMetaDataParameters transactionMetaDataParameters);

Note: The top level status codes in the callbacks are specific to the success or failure only of the retrieval call. For status codes related to payment authorization, you must look at the paymentStatusCode of each transactionFlow.transactionDetail.paymentResult instance returned in this response. Split-tender transactions will have multiple paymentResult instances per transaction. See Transaction Module response codes for a list of relevant payment status codes.

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.

Note: When this method is set to any value that passes payment tenders, either the paymentAccounts attribute or the extendedPaymentInstruments attribute can be populated, not both.

Item Description
UI Method void updateTransaction(TransactionParameters transactionParameters);

Exposed in the com.paydiant.android.ui.service.transactionflow.TransactionFlowManagementService package
Applicable Listener Callbacks void 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 Method TransactionResponse 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.

Item Description
UI Method String generateAccessCode(int length);

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

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

Other Resources

javadocs

Feedback

Have feedback?

Let us know.