Statement SDK Usage

A step-by-step guide on how to initialize Statement SDK on Android.

👍

Visit our Brankas Collection for Android, to see a sample project of how to integrate the SDK.

📘

Minimum Requirements

  1. Android Studio 3.0 but preferably the latest version
  2. Minimum Android SDK: API 17 or Android 4.2

Installation & Updating

Please refer to the Installation page for Android platform installation and update steps

Initialization

  1. Call the initialize function from the StatementTapSDK and pass the context and api key provided by Brankas.
import as.brank.sdk.tap.statement.StatementTapSDK;

StatementTapSDK.INSTANCE.initialize(context, apiKey, null, false);
import `as`.brank.sdk.tap.statement.StatementTapSDK

StatementTapSDK.initialize(context, apiKey, null, false)

❗️

To use the Sandbox environment, set the optional isDebug option to true

  1. The checkout function can now be called once the initialize function has been called.

Usage

  1. country - refers to the country of origin of the bank you wanted to do statement retrieval with. There are three countries currently supported: Philippines (PH), Indonesia (ID) and Thailand (TH)

  2. bankCodes - refers to the list of banks to be shown within the Tap Web Application. If null value is passed, the SDK automatically fills up all the available banks depending on the country passed

  3. externalId - refers to the identifier passed to track the request

  4. successURL - refers to the URL where the user will be redirected to after a successful statement retrieval

  5. failURL - refers to the URL where the user will be redirected to after a failed statement retrieval

  6. organizationName - refers to the name of the organization that will be displayed while doing statement retrieval

  7. redirectDuration - refers to the time in seconds when the user should be redirected upon finishing statement retrieval. The default value is 60 seconds.

  8. dismissalDialog - pertains to the showing of alert dialog when closing the WebView. It consists of message, positiveButtonText and negativeButtonText. Just set this value to null* to remove the alert dialog when closing the application.

  9. statementRetrievalRequest - pertains to the statement retrieval after Tap Web Session. startDate and endDate can be configured to retrieve transactions within date range

Here is a sample on how to use it and call:

after Tap Web Session. startDate and endDate can be configured to retrieve transactions within date range

Here is a sample on how to use it and call:

Kotlin:

import `as`.brank.sdk.tap.statement.StatementTapSDK
import `as`.brank.sdk.core.CoreError
import `as`.brank.sdk.tap.CoreListener
import tap.model.BankCode
import tap.model.Country
import tap.statement.StatementTapRequest

val request = StatementTapRequest.Builder()
            .country(Country.PH)
            .externalId("External ID")
            .successURL("https://google.com")
            .failURL("https://hello.com")
            .organizationName("Organization Name")

StatementTapSDK.checkout(this, request.build(), object: CoreListener<String>() {

        override fun onResult(data: String?, error: CoreError?) {
                println("DATA: "+data)
        }

}, 3000, false, true);

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        if(requestCode == 2000) {
            if(resultCode == RESULT_OK) {
                val statementId = data?.getStringExtra(StatementTapSDK.STATEMENT_ID)
                Toast.makeText(this,
                    "Statement Retrieval Successful! Here is the statement id: $statementId",
                    Toast.LENGTH_SHORT).show()
            }
            else {
                val error = data?.getStringExtra(StatementTapSDK.ERROR)
                val errorCode = data?.getStringExtra(StatementTapSDK.ERROR_CODE)
                Toast.makeText(this, "$error ($errorCode)", Toast.LENGTH_LONG).show()
            }
        }
    }
import as.brank.sdk.tap.statement.StatementTapSDK;
import as.brank.sdk.core.CoreError;
import as.brank.sdk.tap.CoreListener;
import tap.model.BankCode;
import tap.model.Country;
import tap.statement.StatementTapRequest;

StatementTapRequest.Builder request = new StatementTapRequest.Builder()
    .country(Country.PH)
        .externalId("External ID")
        .successURL("https://google.com")
        .failURL("https://hello.com")
        .organizationName("Organization Name");

StatementTapSDK.INSTANCE.checkout(this, request.build(), new CoreListener<String>() {
    @Override
        public void onResult(String data, CoreError error) {
                System.out.println("DATA: "+data);
        }

}, 3000, false, true);

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(requestCode == 3000) {
            if(resultCode == RESULT_OK) {
                String statementId = data.getStringExtra(StatementTapSDK.STATEMENT_ID);
                Toast.makeText(this,
                    "Statement Retrieval Successful! Here is the statement id: "+statementId,
                    Toast.LENGTH_SHORT).show();
            }
            else {
                String error = data.getStringExtra(StatementTapSDK.ERROR);
                String errorCode = data.getStringExtra(StatementTapSDK.ERROR_CODE);
                Toast.makeText(this, error + " " +errorCode, Toast.LENGTH_LONG).show();
            }
        }
    }

📘

If showInBrowser is set to true, the transactionId will be returned if bank transfer is successful else it would be null. If it has been set to false, the redirect URL for the Tap Web Application will be returned after checkout has been successful.

If the internal WebView is opted not to be used (showInBrowser is false), do not forget to call terminate() function to ensure previous Tap session is closed

The isAutoConsent in the checkout function is set to false by default. To enable its usage, just set the 2nd to the last parameter to true

The useRememberMe in the checkout function is set to false by default. To enable the usage of Remember Me inside the Tap Web Application, just pass false to the last parameter in the checkout function

The actionBarText in the checkout function is set to null by default - thus, the ActionBar gets hidden. To show it, just pass a String to it


Did this page help you?