-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(merchant-sdk): Duplicate
HealthSDK
into MerchantSDK
- Loading branch information
Showing
236 changed files
with
13,756 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Moved to https://developer.gini.net/gini-mobile-android/health-sdk/sdk/html/license.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
![Gini Health SDK for Android](./logo.png) | ||
|
||
Gini Health SDK for Android | ||
=========================== | ||
|
||
The Gini Health SDK for Android provides all the UI and functionality needed to use the Gini Health API in your app to | ||
extract payment and health information from invoices. The payment information can be reviewed and then the invoice can | ||
be paid using any available payment provider app (e.g., banking app). | ||
|
||
The Gini Health API provides an information extraction service for analyzing health invoices. Specifically, it extracts | ||
information such as the document sender or the payment relevant information (amount to pay, IBAN, etc.). In addition it | ||
also provides a secure channel for sharing payment related information between clients. | ||
|
||
Documentation | ||
------------- | ||
|
||
* [Integration Guide](https://developer.gini.net/gini-mobile-android/health-sdk/sdk) | ||
|
||
Example Apps | ||
------------ | ||
|
||
### Health Example App | ||
|
||
You can see a sample usage of the Gini Health SDK in the `:health-sdk:example-app` module. | ||
|
||
It requires Gini Health API credentials which are injected automatically if you create this file `health-sdk/example-app/local.properties` with the following properties: | ||
``` | ||
clientId=******* | ||
clientSecret=******* | ||
``` | ||
|
||
### Bank Example App | ||
|
||
An example bank app is available in the [Gini Bank SDK](https://github.com/gini/gini-mobile-android/tree/main/bank-sdk) called | ||
[`example-app`](https://github.com/gini/gini-mobile-android/tree/main/bank-sdk/example-app). | ||
|
||
License | ||
------- | ||
|
||
The Gini Health SDK for Android is available under a commercial license. | ||
See the LICENSE file for more info. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
client.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Gini Health SDK Example App | ||
========================= | ||
|
||
This example app provides you with a sample usage of the Gini Health SDK. | ||
|
||
The Gini Health API Library is used for analyzing documents and creating payment requests. | ||
|
||
Before using the Gini Health SDK example app, you need to set your Gini Health API client id and secret by creating a | ||
`local.properties` file in this folder containing a `clientId` and a `clientSecret` property. | ||
|
||
ProGuard | ||
======== | ||
|
||
A sample ProGuard configuration file is included in the example app's directory called `proguard-rules.pro`. | ||
|
||
The release build is configured to run ProGuard. You need a keystore with a key to sign it. Create a keystore with a key and provide them in | ||
the `gradle.properties` or as arguments for the build command: | ||
|
||
``` | ||
$ ./gradlew health-sdk:example-app:assembleRelease \ | ||
-PreleaseKeystoreFile=<path to keystore> \ | ||
-PreleaseKeystorePassword=<keystore password> \ | ||
-PreleaseKeyAlias=<key alias> \ | ||
-PreleaseKeyPassword=<key password> \ | ||
-PclientId=<Gini API client id> \ | ||
-PclientSecret=<Gini API client secret> | ||
``` | ||
|
||
Flavors | ||
======= | ||
|
||
The example app has three flavors: `dev`, `prod` and `qa`. The `dev` flavor is used by default. The `prod` flavor | ||
is used for creating release builds which can be shared with clients while the `qa` flavor is used for creating release builds | ||
for QA purposes. The difference between `prod` and `qa` is that `qa` allows using custom SSL root certificates for | ||
SSL proxies (e.g. Charles Proxy). | ||
|
||
Payment Providers for testing the Health SDK | ||
============================================ | ||
|
||
Payment Providers for testing are provided by the Gini Bank SDK's example app. Run `bundle exec fastlane install_test_payment_provider_apps` in the repository root to install test payment provider apps | ||
on all running emulators and connected devices. You can run `bundle exec fastlane uninstall_test_payment_provider_apps` | ||
to uninstall the test payment provider apps. | ||
|
||
Please view the Gini Bank SDK example app's readme at `bank-sdk/example-app/README.md` for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
import net.gini.gradle.CreatePropertiesTask | ||
import net.gini.gradle.PropertiesPlugin | ||
import net.gini.gradle.readLocalPropertiesToMap | ||
|
||
plugins { | ||
id("com.android.application") | ||
kotlin("android") | ||
kotlin("kapt") | ||
} | ||
|
||
android { | ||
namespace = "net.gini.android.merchant.sdk.exampleapp" | ||
compileSdk = libs.versions.android.compileSdk.get().toInt() | ||
|
||
// after upgrading to AGP 8, we need this to have the defaultConfig block | ||
buildFeatures { | ||
buildConfig = true | ||
} | ||
defaultConfig { | ||
applicationId = "net.gini.android.merchant.sdk.exampleapp" | ||
minSdk = libs.versions.android.minSdk.get().toInt() | ||
targetSdk =libs.versions.android.targetSdk.get().toInt() | ||
|
||
versionName = version as String | ||
versionCode = (properties["versionCode"] as? String)?.toInt() ?: 0 | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
vectorDrawables { | ||
useSupportLibrary = true | ||
} | ||
} | ||
|
||
signingConfigs { | ||
create("release") { | ||
storeFile = file(properties["releaseKeystoreFile"] ?: "") | ||
storePassword = (properties["releaseKeystorePassword"] as? String) ?: "" | ||
keyAlias = (properties["releaseKeyAlias"] as? String) ?: "" | ||
keyPassword = (properties["releaseKeyPassword"] as? String) ?: "" | ||
} | ||
} | ||
|
||
buildTypes { | ||
getByName("release") { | ||
isMinifyEnabled = false | ||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") | ||
|
||
signingConfig = signingConfigs.getByName("release") | ||
} | ||
} | ||
flavorDimensions += "environment" | ||
productFlavors { | ||
create("prod") { | ||
dimension = "environment" | ||
} | ||
create("dev") { | ||
isDefault = true | ||
dimension = "environment" | ||
} | ||
create("qa") { | ||
dimension = "environment" | ||
} | ||
} | ||
buildFeatures { | ||
viewBinding = true | ||
} | ||
compileOptions { | ||
sourceCompatibility(JavaVersion.VERSION_1_8) | ||
targetCompatibility(JavaVersion.VERSION_1_8) | ||
} | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
// Fix for "Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option" | ||
// https://issuetracker.google.com/issues/217593040#comment6 | ||
freeCompilerArgs = listOf("-Xjvm-default=all") | ||
} | ||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
} | ||
} | ||
|
||
// after upgrading to AGP 8, we need this, otherwise, gradle will complain to use the same jdk version as your machine (17 which is bundled with Android Studio) | ||
// https://youtrack.jetbrains.com/issue/KT-55947/Unable-to-set-kapt-jvm-target-version | ||
tasks.withType(type = org.jetbrains.kotlin.gradle.internal.KaptGenerateStubsTask::class) { | ||
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString() | ||
} | ||
|
||
dependencies { | ||
|
||
implementation(libs.androidx.core.ktx) | ||
implementation(libs.androidx.activity.ktx) | ||
implementation(libs.androidx.fragment.ktx) | ||
implementation(libs.androidx.appcompat) | ||
implementation(libs.androidx.lifecycle.viewmodel.ktx) | ||
implementation(libs.material) | ||
implementation(libs.androidx.constraintlayout) | ||
implementation(libs.koin.androidx.scope) | ||
implementation(libs.koin.androidx.viewmodel) | ||
implementation(libs.koin.androidx.fragment) | ||
implementation(libs.insetter) | ||
implementation(libs.datastore.preferences) | ||
implementation(libs.moshi.core) | ||
implementation(libs.androidx.lifecycle.runtime.ktx) | ||
implementation(project(":merchant-sdk:sdk")) | ||
kapt(libs.moshi.codegen) | ||
implementation(libs.logback.android.core) | ||
implementation(libs.logback.android.classic) { | ||
// workaround issue #73 | ||
exclude(group = "com.google.android", module = "android") | ||
} | ||
|
||
testImplementation(libs.junit) | ||
|
||
androidTestImplementation(libs.androidx.test.junit) | ||
androidTestImplementation(libs.androidx.test.espresso.core) | ||
} | ||
|
||
apply<PropertiesPlugin>() | ||
|
||
tasks.register<CreatePropertiesTask>("injectClientCredentials") { | ||
val propertiesMap = mutableMapOf<String, String>() | ||
|
||
doFirst { | ||
propertiesMap.clear() | ||
propertiesMap.putAll(readLocalPropertiesToMap(project, listOf("clientId", "clientSecret"))) | ||
} | ||
|
||
destinations.put( | ||
file("src/main/resources/client.properties"), | ||
propertiesMap | ||
) | ||
} | ||
|
||
afterEvaluate { | ||
tasks.filter { it.name.startsWith("assemble", ignoreCase = true) }.forEach { | ||
it.dependsOn(tasks.getByName("injectClientCredentials")) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version=1.0.0 | ||
versionCode=1 | ||
|
||
# Signing | ||
releaseKeystoreFile=health_sdk_example.jks | ||
releaseKeystorePassword=*** | ||
releaseKeyAlias=health_sdk_example | ||
releaseKeyPassword=*** |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
24 changes: 24 additions & 0 deletions
24
merchant-sdk/example-app/src/androidTest/java/net/gini/pay/app/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.gini.pay.app | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("net.gini.pay.app", appContext.packageName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<application android:networkSecurityConfig="@xml/network_security_config" /> | ||
|
||
</manifest> |
8 changes: 8 additions & 0 deletions
8
merchant-sdk/example-app/src/dev/res/xml/network_security_config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<network-security-config> | ||
<base-config cleartextTrafficPermitted="false"> | ||
<trust-anchors> | ||
<certificates src="system" /> | ||
<certificates src="user" /> | ||
</trust-anchors> | ||
</base-config> | ||
</network-security-config> |
Oops, something went wrong.