Skip to content

Commit

Permalink
Merge branch 'feature/main' into 'main'
Browse files Browse the repository at this point in the history
Connect Transfer Android SDK Release 1.0.0 Main Branch

See merge request connect/connect-transfer-android-sdk!17
  • Loading branch information
ddonthula committed Dec 17, 2024
2 parents 38a1290 + 5275b40 commit 8429413
Show file tree
Hide file tree
Showing 54 changed files with 1,266 additions and 56 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
/connect-transfer-sdk
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Connect Transfer Android SDK Changelog

### 1.0.0 (December 17, 2024)

Initial Release:
- Connect Transfer Android SDK to support Payroll Deposit Switch.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 MasterCardOpenBanking

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
176 changes: 120 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,93 +1,157 @@
# Connect Transfer Android SDK


## Using the Connect Transfer Android SDK

## Getting started
The Connect Transfer Android SDK is distributed as a compiled binary in Maven Central which allows you to easily integrate our SDK into your development projects.
Maven central is Android’s officially supported format for distributing binary libraries to multiple platforms and architectures in a single bundle.

To make it easy for you to get started with GitLab, here's a list of recommended next steps.
## Compatibility

Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
The Connect Android SDK supports the following Android versions.
* Android 7.0 (Lollipop) or later
* minSdkVersion 24 or later

## Add your files

- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
## Install the Connect Transfer Android SDK

Install the Connect Android SDK using Maven Central
Modify your root-level Gradle file (build.gradle) as follows:

```
allprojects {
repositories { {
google()
mavenCentral()
}
}
```
cd existing_repo
git remote add origin https://gitlab.fini.city/connect/connect-transfer-android-sdk.git
git branch -M main
git push -uf origin main
Modify your app-level Gradle file (build.gradle) as follows:

```
android {
defaultConfig {
minSdkVersion 24 // or greater
}
}
## Integrate with your tools
- [ ] [Set up project integrations](https://gitlab.fini.city/connect/connect-transfer-android-sdk/-/settings/integrations)
dependencies {
// ...
implementation 'com.mastercard.openbanking.connect:connect-transfer-sdk:<latest version>'
}
```
Note: The latest version of the Connect Transfer Android SDK can be found in [Maven Central](https://central.sonatype.com/artifact/com.mastercard.openbanking.connect/connect-transfer-sdk)

## Collaborate with your team

- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Update Android application settings

## Test and Deploy
The Connect Android SDK requires internet access to connect with our servers, so you need to add internet permissions to the AndroidManifest.xml file:

Use the built-in continuous integration in GitLab.
```
<uses-permission android:name="android.permission.INTERNET">
```

- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)

***

# Editing this README
## Integration

When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
**ConnectTransfer Class**

## Suggestions for a good README
The ConnectTransfer class contains a start method that when called, starts an activity with the supplied event listener. The SDK only allows a single instance of the ConnectTransfer activity to run. If you start ConnectTransfer while a ConnectTransfer activity is already running, a RuntimeException is thrown.

Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
The ConnectTransfer Android SDK’s main component is the ConnectTransfer class that contains a static start method, which runs an activity that connects with the ConnectTransferEventListener.

## Name
Choose a self-explaining name for your project.
To access the APIs in the SDK include the following imports:

## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
```
import com.mastercard.openbanking.connect.transfer.ui.activity.ConnectTransfer;
import com.mastercard.openbanking.connect.transfer.events.ConnectTransferEventListener;
```

## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
The ConnectTransfer.start() method launches the activity, requiring:

## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
* A valid Context.
* The Connect Transfer URL.
* An instance of ConnectTransferEventListener to handle SDK events.

## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
**Java:**

```
ConnectTransfer.start(context, url, new ConnectTransferEventListener() {
@Override
public void onInitializeConnectTransfer(JSONObject data) {
Log.d("ConnectTransfer", "onInitializeConnectTransfer: " + data.toString());
}
@Override
public void onTermsAndConditionsAccepted(JSONObject data) {
Log.d("ConnectTransfer", "onTermsAndConditionsAccepted: " + data.toString());
}
@Override
public void onLaunchTransferSwitch(JSONObject data) {
Log.d("ConnectTransfer", "onLaunchTransferSwitch: " + data.toString());
}
@Override
public void onTransferEnd(JSONObject data) {
Log.d("ConnectTransfer", "onTransferEnd: " + data.toString());
}
@Override
public void onUserEvent(JSONObject data) {
Log.d("ConnectTransfer", "onUserEvent: " + data.toString());
}
});
```

**Kotlin:**

```
ConnectTransfer.start(context, url, object : ConnectTransferEventListener {
override fun onInitializeConnectTransfer(data: JSONObject) {
Log.d("ConnectTransfer", "onInitializeConnectTransfer: ${data.toString()}")
}
override fun onTermsAndConditionsAccepted(data: JSONObject) {
Log.d("ConnectTransfer", "onTermsAndConditionsAccepted: ${data.toString()}")
}
override fun onLaunchTransferSwitch(data: JSONObject) {
Log.d("ConnectTransfer", "onLaunchTransferSwitch: ${data.toString()}")
}
override fun onTransferEnd(data: JSONObject) {
Log.d("ConnectTransfer", "onTransferEnd: ${data.toString()}")
}
override fun onUserEvent(data: JSONObject) {
Log.d("ConnectTransfer", "onUserEvent: ${data.toString()}")
}
})
```
Throughout Connect Transfer's flow events about the state of the application are sent as JSONObjects to the ConnectTransferEventListener methods.

## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
The onInitializeConnectTransfer, onTermsAndConditionsAccepted, onLaunchTransferSwitch, onTransferEnd, and onUserEvent callback functions will have a JSONObject parameter that contains data about the event.

## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
**Parameters**

## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
Java:

## Contributing
State if you are open to contributions and what your requirements are for accepting them.
`public static void start(Context context, String connectTransferUrl, ConnectTransferEventListener listener)
`

For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
Kotlin:

You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
`fun start(context: Context,connectTransferUrl: String, listener: ConnectTransferEventListener)
`

## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
**Details:**

## License
For open source projects, say how it is licensed.
| Parameter | Type | Description |
|:-----------|:---------|:-------------------------------|
| `context` | `Context` | The context from which the function is called, typically an Activity or Fragment context. |
| `connectTransferUrl` | `String` | The Connect Transfer URL required to initiate the ConnectTransfer flow. |
| `listener` | `ConnectTransferEventListener`| An instance of ConnectTransferEventListener to receive callbacks for various events, such as when the transfer is initialized, terms are accepted, and the transfer is completed. |

## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
45 changes: 45 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//plugins {
// alias(libs.plugins.android.application)
//}
apply plugin: 'com.android.application'


android {
namespace 'com.mastercard.openbanking.connecttransfer.demo'
compileSdk 34

defaultConfig {
applicationId "com.mastercard.openbanking.connecttransfer.demo"
minSdk 24
targetSdk 34
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {

implementation libs.appcompat
implementation libs.material
implementation libs.activity
implementation libs.constraintlayout
testImplementation libs.junit
androidTestImplementation libs.ext.junit
androidTestImplementation libs.espresso.core

implementation 'com.mastercard.openbanking.connect:connect-transfer-sdk:1.0.0'

}
Loading

0 comments on commit 8429413

Please sign in to comment.