Skip to content

Commit

Permalink
* Updated ReadMe and Changelog for Statement Tap SDK 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
torresejay102 committed Feb 10, 2022
1 parent 9760d21 commit 078f9de
Show file tree
Hide file tree
Showing 83 changed files with 46,793 additions and 62 deletions.
166 changes: 135 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ DirectTapSDK.checkout(activity,

# Statement Tap SDK for Android
***
*Version:* 1.3.2
*Version:* 1.4.0
***


Expand Down Expand Up @@ -280,11 +280,11 @@ This set of instructions assumes that the IDE being used is Android Studio
```
**NOTE: You can use any GitHub Account in filling up the credentials**

2. In your app build.gradle file, add this line inside the dependencies configuration: **implementation "com.brankas.tap:statement-tap:1.3.2"** to set the SDK as a dependency for the application. This should look like:
2. In your app build.gradle file, add this line inside the dependencies configuration: **implementation "com.brankas.tap:statement-tap:1.4.0"** to set the SDK as a dependency for the application. This should look like:

```gradle
dependencies {
implementation "com.brankas.tap:statement-tap:1.3.2"
implementation "com.brankas.tap:statement-tap:1.4.0"
}


Expand All @@ -301,6 +301,7 @@ This set of instructions assumes that the IDE being used is Android Studio
implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
//implementation "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$kotlin_coroutines_version"
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2'
}

compileOptions {
Expand All @@ -314,26 +315,45 @@ This set of instructions assumes that the IDE being used is Android Studio
```
**NOTE: To mix coroutines and RxJava in the same project, include the optional dependency commented out**

4. In the plugins section, add these:

````gradle
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-parcelize'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.6.10'
}
````

4. Add the permission **android.permission.INTERNET** in your **AndroidManifest.xml** file to allow your application to access Internet, which is required to use Tap API Services.
5. Add the permission **android.permission.INTERNET** in your **AndroidManifest.xml** file to allow your application to access Internet, which is required to use Tap API Services.

```xml
<uses-permission android:name="android.permission.INTERNET" />
```

## Initialization

1. Call the initialize function from the TapSDK and pass the context and api key provided by Brankas.
1. Call the initialize function from the DirectTapSDK and pass the context and api key provided by Brankas.<br/><br/>**Java:**

```java

import as.brank.sdk.tap.statement.StatementTapSDK;
import as.brank.sdk.tap.direct.StatementTapSDK;

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

```

***NOTE:*** It is better to call the initialize function inside the application class to avoid leaking of context or unexpected crash when other functions from the SDK are called in the background subsequently. Also, to use the **Sandbox** environment, set the optional **isDebug** option to **true**
**Kotlin:**

```kotlin

import `as`.brank.sdk.tap.direct.StatementTapSDK

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

```
***NOTE:*** To use the **Sandbox** environment, set the optional **isDebug** option to **true**

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

Expand Down Expand Up @@ -362,57 +382,141 @@ In order to use the checkout function, an **StatementTapRequest** is needed to b
9. **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.

Here is a sample on how to use it and call:
<br/><br/> **Kotlin:**

```java
```kotlin

import as.brank.sdk.tap.statement.StatementTapSDK;
import as.brank.sdk.core.CoreError;
import as.brank.sdk.tap.TapListener;
import tap.common*;
import `as`.brank.sdk.tap.statement.StatementTapSDK
import `as`.brank.sdk.core.CoreError
import `as`.brank.sdk.tap.CoreListener
import tap.common.BankCode
import tap.common.Country
import tap.common.DismissalDialog
import tap.statement.StatementTapRequest

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

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

@Override
public void onResult(data: String?, error: CoreError?) {
if(data != null) {
System.out.println("Transaction Successful! Here is the transaction id: " + data);
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()
}
}
}
}
```

@Override
public void onTapStarted() {
<br/><br/> **Kotlin:**

}
```kotlin

@Override
public void onTapEnded() {
import `as`.brank.sdk.tap.statement.StatementTapSDK
import `as`.brank.sdk.core.CoreError
import `as`.brank.sdk.tap.CoreListener
import tap.common.BankCode
import tap.common.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()
}
}
}
```

<br/><br/> **Java:**

```java

import as.brank.sdk.tap.statement.StatementTapSDK;
import as.brank.sdk.core.CoreError;
import as.brank.sdk.tap.CoreListener;
import tap.common.BankCode;
import tap.common.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");

}, requestCode, false, true);
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);
System.out.println("Transaction Successful! Here is the statement id: " + statementId);
Toast.makeText(this,
"Statement Retrieval Successful! Here is the statement id: "+statementId,
Toast.LENGTH_SHORT).show();
}

else {
System.out.println("ERROR: "+ data.getStringExtra(StatementTapSDK.ERROR);
String error = data.getStringExtra(StatementTapSDK.ERROR);
String errorCode = data.getStringExtra(StatementTapSDK.ERROR_CODE);
Toast.makeText(this, error + " " +errorCode, Toast.LENGTH_LONG).show();
}
}
}
}
```


***NOTE:*** 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.<br/><br/>
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**

Expand Down
56 changes: 56 additions & 0 deletions javadoc statement/allclasses.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<html lang="en">
<head>
<title>All Classes </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2020-03-25">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="dokka-javadoc-stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="jquery/jquery-ui.js"></script>

<script type="text/javascript" src="search.js"></script>
<script async type="text/javascript" src="module-search-index.js"></script>
<script async type="text/javascript" src="package-search-index.js"></script>
<script async type="text/javascript" src="type-search-index.js"></script>
<script async type="text/javascript" src="member-search-index.js"></script>
<script async type="text/javascript" src="tag-search-index.js"></script>
</head><body>
<h1 class="bar">All Classes</h1>
<main role="main" class="indexContainer">
<ul>

<li><a href=as/brank/sdk/core/CheckListener.html>CheckListener</a></li>

<li><a href=as/brank/sdk/core/CoreError.html>CoreError</a></li>

<li><a href=as/brank/sdk/core/CoreException.html>CoreException</a></li>

<li><a href=as/brank/sdk/core/CoreListener.html>CoreListener</a></li>

<li><a href=as/brank/sdk/core/ErrorCode.html>ErrorCode</a></li>

<li><a href=as/brank/sdk/core/CoreErrorCode.html>CoreErrorCode</a></li>

<li><a href=as/brank/sdk/core/SignatureAlgorithm.html>SignatureAlgorithm</a></li>

<li><a href=as/brank/sdk/core/UnrecognizedErrorCode.html>UnrecognizedErrorCode</a></li>

<li><a href=as/brank/sdk/core/statement/StatementErrorCode.html>StatementErrorCode</a></li>

<li><a href=as/brank/sdk/tap/statement/StatementTapSDK.html>StatementTapSDK</a></li>

<li><a href=tap/common/BankCode.html>BankCode</a></li>

<li><a href=tap/common/Country.html>Country</a></li>

<li><a href=tap/common/DismissalDialog.html>DismissalDialog</a></li>

<li><a href=tap/common/Reference.html>Reference</a></li>

<li><a href=tap/statement/StatementTapRequest.html>StatementTapRequest</a></li>
</ul>
</main>
</body>
</html>
Loading

0 comments on commit 078f9de

Please sign in to comment.