diff --git a/MiA-SDK/build.gradle b/MiA-SDK/build.gradle
new file mode 100644
index 0000000..9b33651
--- /dev/null
+++ b/MiA-SDK/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ ext.kotlin_version = '1.3.11'
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.0.1'
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/MiA-SDK/gradle.properties b/MiA-SDK/gradle.properties
new file mode 100644
index 0000000..743d692
--- /dev/null
+++ b/MiA-SDK/gradle.properties
@@ -0,0 +1,13 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/MiA-SDK/gradle/wrapper/gradle-wrapper.jar b/MiA-SDK/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..7a3265e
Binary files /dev/null and b/MiA-SDK/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/MiA-SDK/gradle/wrapper/gradle-wrapper.properties b/MiA-SDK/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..bdd834a
--- /dev/null
+++ b/MiA-SDK/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Dec 17 16:47:20 EET 2018
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
diff --git a/MiA-SDK/gradlew b/MiA-SDK/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/MiA-SDK/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/MiA-SDK/gradlew.bat b/MiA-SDK/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/MiA-SDK/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/MiA-SDK/mia/build.gradle b/MiA-SDK/mia/build.gradle
new file mode 100644
index 0000000..c0f3b0c
--- /dev/null
+++ b/MiA-SDK/mia/build.gradle
@@ -0,0 +1,79 @@
+buildscript {
+ repositories {
+ jcenter()
+ }
+
+ dependencies {
+ //plugin for POM file
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
+ //plugin for kotlin documentation
+ classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:0.9.17"
+ //plugin for test coverage report
+ classpath 'com.dicedmelon.gradle:jacoco-android:0.1.2'
+ //plant uml diagrams generator
+ classpath 'be.jlr-home.gradle:plantumlPlugin:0.1.+'
+ //bintray plugin
+ classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
+ }
+}
+apply plugin: 'com.android.library'
+
+apply plugin: 'kotlin-android'
+
+apply plugin: 'kotlin-android-extensions'
+
+apply plugin: 'org.jetbrains.dokka-android'
+
+apply plugin: 'com.github.dcendents.android-maven'
+
+
+
+//helper gradle tasks
+apply from: 'coverage_report.gradle'
+
+apply from: 'util_closures.gradle'
+apply from: 'build_tasks.gradle'
+apply from: 'dokka_kotlin.gradle'
+
+
+android {
+ compileSdkVersion 28
+ defaultConfig {
+ minSdkVersion 21
+ targetSdkVersion 28
+ versionCode Integer.parseInt(VERSION_CODE)
+ versionName VERSION_NAME
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+ buildConfigField "String", "TECHNICAL_VERSION_INFO_HASH", "\"b2934af\""
+ buildConfigField "String", "TECHNICAL_VERSION_INFO_ID", "\"423\""
+ buildConfigField "String", "TECHNICAL_VERSION_INFO_BRANCH", "\"master\""
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ testOptions {
+ //in order to not mock the Log class from android
+ unitTests.returnDefaultValues = true
+ }
+}
+
+tasks.withType(Test) {
+ jacoco.includeNoLocationClasses = true
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+ implementation 'com.android.support:appcompat-v7:28.0.0'
+ implementation 'com.android.support.constraint:constraint-layout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.2'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+ testImplementation 'org.mockito:mockito-core:2.6.2'
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/build_tasks.gradle b/MiA-SDK/mia/build_tasks.gradle
new file mode 100644
index 0000000..9542184
--- /dev/null
+++ b/MiA-SDK/mia/build_tasks.gradle
@@ -0,0 +1,68 @@
+/**
+ * Customize output aar filename
+ */
+task updateBuildOutputFileName {
+ android.libraryVariants.all { variant ->
+ variant.outputs.all {
+ outputFileName = "${getOutputFileName(variant.buildType.name)}"
+ }
+ }
+}
+
+/**
+ * Filter build variants that are not needed
+ */
+task filterBuildVariant {
+ def buildTypeArray = getBuildType()
+
+ android.variantFilter { variant ->
+ if (!buildTypeArray.contains(variant.buildType.name)) {
+ variant.setIgnore(true)
+ }
+ }
+}
+
+/**
+ * Task that filters the build types,
+ * runs the clean task, runs the tests, build the SDK aar file,
+ * creates the pom file for both release and debug.
+ *
+ * The task does not create the documentation.
+ *
+ * Example on how to call the task :
+ * - to build both release and debug build
+ * gradlew buildSDK
+ * - to specify the build type
+ * gradlew buildSDK -PbuildType="debug"
+ * gradlew buildSDK -PbuildType="release"
+ * - to specify the repo type ("snapshot", "release"). Default value is "snapshot"
+ * gradlew buildSDK -PrepoType="snapshot"
+ *
+ * The .aar files can be find at {pathToTheProject}\\mia\\build\\outputs\\aar
+ * The test results can find at {pathToTheProject}\\mia\\build\\reports
+ * The pom files can find at {pathToTheProject}\\mia\\build\\poms
+ *
+ */
+task buildSDK {
+ dependsOn 'clean'
+ dependsOn 'updateBuildOutputFileName'
+ dependsOn 'filterBuildVariant'
+ dependsOn 'check'
+ dependsOn 'assemble'
+
+ tasks.findByName('updateBuildOutputFileName').mustRunAfter 'clean'
+ tasks.findByName('filterBuildVariant').mustRunAfter 'updateBuildOutputFileName'
+ tasks.findByName('check').mustRunAfter 'filterBuildVariant'
+ tasks.findByName('assemble').mustRunAfter 'check'
+
+ doLast {
+ def buildTypeArray = getBuildType()
+ for (buildType in buildTypeArray) {
+ pom {
+ version = getSDKVersion()
+ groupId = GROUP_ID
+ artifactId = getArtifactId(buildType)
+ }.withXml {}.writeTo("$buildDir/poms/${getPomFileName(buildType)}")
+ }
+ }
+}
diff --git a/MiA-SDK/mia/coverage_report.gradle b/MiA-SDK/mia/coverage_report.gradle
new file mode 100644
index 0000000..2be7e85
--- /dev/null
+++ b/MiA-SDK/mia/coverage_report.gradle
@@ -0,0 +1,53 @@
+apply plugin: 'jacoco-android'
+
+ext {
+ coverageSourceDirs = 'src/test/java'
+}
+
+jacoco {
+ toolVersion = "0.7.5.201505241946"
+ reportsDir = file("$buildDir/reports")
+}
+
+task jacocoCoverageReport(type: JacocoReport, dependsOn: "testDebugUnitTest") {
+
+ group = "Reporting"
+ description = "Generate Jacoco coverage reports for Debug build"
+
+ reports {
+ xml.enabled = true
+ html.enabled = true
+ }
+
+ // what to exclude from coverage report
+ // UI, "noise", generated classes, platform classes, etc.
+ def excludes = ['**/R.class',
+ '**/R$*.class',
+ '**/BuildConfig.*',
+ '**/Manifest*.*',
+ '**/*Test*.*',
+ 'android/**/*.*',
+ '**/utils',
+ '**/BaseWebView.*',
+ '**/BaseWebViewActivity.*',
+ '**/BaseWebViewPresenter.*',
+ '**/MiAActivityView.*',
+ '**/MiAActivity.*',
+ '**/MiAActivityPresenter.*'
+ ]
+ // generated classes
+ classDirectories = fileTree(
+ dir: "$buildDir/intermediates/classes/debug",
+ excludes: excludes
+ ) + fileTree(
+ dir: "$buildDir/tmp/kotlin-classes/debug",
+ excludes: excludes
+ )
+
+ // sources
+ sourceDirectories = files([
+ android.sourceSets.main.java.srcDirs,
+ "src/main/kotlin"
+ ])
+ executionData = files("$buildDir/jacoco/testDebugUnitTest.exec")
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/dokka_kotlin.gradle b/MiA-SDK/mia/dokka_kotlin.gradle
new file mode 100644
index 0000000..6054dd3
--- /dev/null
+++ b/MiA-SDK/mia/dokka_kotlin.gradle
@@ -0,0 +1,77 @@
+task generateDiagrams() {
+ doLast {
+ javaexec {
+ main = "-jar";
+ args = [
+ "../plantuml.jar",
+ "src/main/documentation/img"
+ ]
+ }
+ }
+}
+
+dokka {
+ outputFormat = 'html'
+ outputDirectory = "$buildDir/javadoc"
+
+ skipEmptyPackages = true
+
+ if (!shouldIncludeSDKSourceCode()) {
+ //if SDK source code is not included in the release, don't generate documentation for internal code
+ for (def pkg : ["eu.nets.mia.utils", "eu.nets.mia.webview"]) {
+ packageOptions {
+ prefix = pkg
+ reportUndocumented = false
+ suppress = true
+ }
+ }
+ }
+}
+
+task clearDocumentationFolder(type: Delete) {
+ delete "build/javadoc"
+}
+
+task copyOverviewFiles(type: Copy) {
+ from("src/main/documentation") {
+ exclude '**/*.txt'
+ exclude '**/*.md'
+ exclude 'readme-files'
+ }
+ into "build/javadoc/mia"
+}
+
+task modifyOverviewDocumentationSDKVersion{
+ def standaloneOverviewFilePath = DOCUMENTATION_OVERVIEW
+ def standaloneOverviewFile = file(standaloneOverviewFilePath)
+ def standaloneOverviewLines = standaloneOverviewFile.readLines()
+ def newStandaloneOverviewLines = new ArrayList()
+ standaloneOverviewLines.each { line ->
+ if (line.contains("implementation(")) {
+ newStandaloneOverviewLines.add("\timplementation('$GROUP_ID:$ARTIFACT:$VERSION_NAME') { transitive = true;}")
+ } else {
+ newStandaloneOverviewLines.add(line)
+ }
+ }
+ PrintWriter standaloneOverviewWriter = new PrintWriter(standaloneOverviewFile)
+ newStandaloneOverviewLines.each { line ->
+ standaloneOverviewWriter.println(line)
+ }
+
+ standaloneOverviewWriter.close()
+}
+
+task generateDocumentation() {
+ dependsOn 'clearDocumentationFolder'
+ dependsOn 'modifyOverviewDocumentationSDKVersion'
+ dependsOn 'generateDiagrams'
+ dependsOn 'dokka'
+ dependsOn 'copyOverviewFiles'
+ dependsOn 'jacocoCoverageReport'
+
+ tasks.findByName('modifyOverviewDocumentationSDKVersion').mustRunAfter('clearDocumentationFolder')
+ tasks.findByName('generateDiagrams').mustRunAfter('modifyOverviewDocumentationSDKVersion')
+ tasks.findByName('dokka').mustRunAfter('generateDiagrams')
+ tasks.findByName('copyOverviewFiles').mustRunAfter('dokka')
+ tasks.findByName('jacocoCoverageReport').mustRunAfter 'copyOverviewFiles'
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/gradle.properties b/MiA-SDK/mia/gradle.properties
new file mode 100644
index 0000000..6899fb5
--- /dev/null
+++ b/MiA-SDK/mia/gradle.properties
@@ -0,0 +1,31 @@
+#Tue Feb 02 16:00:02 EET 2021
+LICENSE_URL=https\://github.com/Nets-mobile-acceptance/Easy-Android-SDK/MiA-SDK-License.md
+GROUP_ID=eu.nets.mia
+BINTRAY_ORG=nets-mobile-acceptance
+DEFAULT_REPO_TYPE_RELEASE=snapshot
+DEVELOPER_EMAIL=mobile-acceptance@nets.eu
+JAVADOC_DESTINATION=build/javadoc
+BUILD_TYPE_PARAMETER=buildType
+SNAPSHOT_POSTFIX=-SNAPSHOT
+BUILD_TYPE_DEBUG=debug
+BUILD_TYPE_RELEASE=release
+BINTRAY_REPO=Easy-Android-SDK
+INCLUDE_SDK_SOURCE_CODE_PARAMETER=includeSDKSourceCode
+ARTIFACT=mia-sdk
+INCLUDE_SDK_SOURCE_CODE_NO=no
+SCM_CONNECTION=https\://github.com/Nets-mobile-acceptance/Easy-Android-SDK.git
+DOCUMENTATION_OVERVIEW=src/main/documentation/Start - Overview of MiA Android SDK.html
+LICENSE_NAME=MIT
+REPO_TYPE_RELEASE=release
+VERSION_NAME=1.3.0
+DEVELOPER_ID=BuildManager-Nets
+SDK_PROJECT_URL=https\://github.com/Nets-mobile-acceptance/Easy-Android-SDK/
+VERSION_CODE=29
+BINTRAY_NAME=MiA-SDK-Android
+SDK_PROJECT_DESCRIPTION=MiA - Android SDK is a library which facilitates the Embedded NETS Easy Checkout integration in your Android application.
+DEVELOPER_NAME=Nets Denmark A/S
+INCLUDE_SDK_SOURCE_CODE_YES=yes
+REPO_TYPE_PARAMETER=repoType
+LIBRARY_NAME=MiA-SDK-Android
+REPO_TYPE_SNAPSHOT=snapshot
+PROJECT_URL=https\://github.com/Nets-mobile-acceptance/Easy-Android-SDK
diff --git a/MiA-SDK/mia/proguard-rules.pro b/MiA-SDK/mia/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/MiA-SDK/mia/proguard-rules.pro
@@ -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
diff --git a/MiA-SDK/mia/src/androidTest/java/eu/nets/mia/ExampleInstrumentedTest.kt b/MiA-SDK/mia/src/androidTest/java/eu/nets/mia/ExampleInstrumentedTest.kt
new file mode 100644
index 0000000..2218696
--- /dev/null
+++ b/MiA-SDK/mia/src/androidTest/java/eu/nets/mia/ExampleInstrumentedTest.kt
@@ -0,0 +1,24 @@
+package eu.nets.mia
+
+import android.support.test.InstrumentationRegistry
+import android.support.test.runner.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.getTargetContext()
+ assertEquals("eu.nets.mia.test", appContext.packageName)
+ }
+}
diff --git a/MiA-SDK/mia/src/main/AndroidManifest.xml b/MiA-SDK/mia/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7607bec
--- /dev/null
+++ b/MiA-SDK/mia/src/main/AndroidManifest.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/main/java/eu/nets/mia/MiASDK.kt b/MiA-SDK/mia/src/main/java/eu/nets/mia/MiASDK.kt
new file mode 100644
index 0000000..af04d46
--- /dev/null
+++ b/MiA-SDK/mia/src/main/java/eu/nets/mia/MiASDK.kt
@@ -0,0 +1,148 @@
+package eu.nets.mia
+
+import android.app.Activity
+import android.content.Intent
+import android.os.Bundle
+import android.support.v4.app.Fragment
+import eu.nets.mia.data.MiAPaymentInfo
+import eu.nets.mia.webview.MiAActivity
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+open class MiASDK {
+
+ companion object {
+ /**
+ * Request code used when starting the SDK as #startActivityForResult(). Check for this code on your *onActivityResult()
+ */
+ const val EASY_SDK_REQUEST_CODE = 1001
+ /**
+ * Parcelable Extra - [eu.nets.mia.data.MiAResult] will be found in the Intent Data under this key.
+ *
+ */
+ const val BUNDLE_COMPLETE_RESULT: String = "BUNDLE_COMPLETE_RESULT"
+
+ private val instance: MiASDK = MiASDK()
+
+ /**
+ * Returns Singleton instance if MiaSDK class
+ */
+ @JvmStatic
+ fun getInstance(): MiASDK {
+ return instance
+ }
+ }
+
+ /**
+ * Starts the SDK from an Activity, with startActivityForResult() with the requestCode = EASY_SDK_REQUEST_CODE
+ *
+ * @param activity The activity from where the SDK is started
+ * @param miAPaymentInfo The payment information (paymentId and checkoutUrl) provided by merchant application
+ */
+ fun startSDK(activity: Activity, miAPaymentInfo: MiAPaymentInfo) {
+ validateFields(miAPaymentInfo)
+
+ val intent = Intent(activity, MiAActivity::class.java)
+ intent.putExtras(createBundle(miAPaymentInfo))
+
+ activity.startActivityForResult(intent, EASY_SDK_REQUEST_CODE)
+ }
+
+ /**
+ * Starts the SDK from an Fragment, with startActivityForResult() with the requestCode = EASY_SDK_REQUEST_CODE
+ *
+ * @param fragment The fragment from where the SDK is started
+ * @param miAPaymentInfo The payment information (paymentId and checkoutUrl) provided by merchant application
+ */
+ fun startSDK(fragment: Fragment, miAPaymentInfo: MiAPaymentInfo) {
+ validateFields(miAPaymentInfo)
+
+ val intent = Intent(fragment.activity, MiAActivity::class.java)
+ intent.putExtras(createBundle(miAPaymentInfo))
+
+ fragment.startActivityForResult(intent, EASY_SDK_REQUEST_CODE)
+ }
+
+ /**
+ * It will validate the parameters received form merchant application
+ * Will throw IllegalArgumentException if the conditions are not met
+ */
+ private fun validateFields(miAPaymentInfo: MiAPaymentInfo?) {
+ //check made for java code for nullable values
+ if (miAPaymentInfo == null) throw IllegalArgumentException("MiAPaymentInfo must not be null.")
+ //check for localhost url
+ if (!miAPaymentInfo.checkoutUrl.contains("http://") && !miAPaymentInfo.checkoutUrl.contains("https://")) {
+ throw IllegalArgumentException("Checkout URL is not valid.")
+ }
+ }
+
+ /**
+ * Helper function to create the bundle to be sent in the target activity
+ */
+ private fun createBundle(miAPaymentInfo: MiAPaymentInfo): Bundle {
+ val bundle = Bundle()
+ bundle.putParcelable(MiAActivity.BUNDLE_PAYMENT_INFO, miAPaymentInfo)
+
+ return bundle
+ }
+
+ /**
+ * Formats the technical version of the SDK in a String. It is composed of:
+ * - the branch name from where the build was made
+ * - branch revision id
+ * - branch hash key
+ *
+ * @return Technical version String
+ */
+ fun getTechnicalVersion(): String {
+ return "${BuildConfig.TECHNICAL_VERSION_INFO_BRANCH}.${BuildConfig.TECHNICAL_VERSION_INFO_HASH}.${BuildConfig.TECHNICAL_VERSION_INFO_ID}"
+ }
+
+ /**
+ * Get the version name of the SDK
+ *
+ * @return SDK version name
+ */
+ fun getVersionName(): String {
+ return BuildConfig.VERSION_NAME
+ }
+
+ /**
+ * Get the version code of the SDK
+ *
+ * @return SDK version code
+ */
+ fun getVersionCode(): String {
+ return BuildConfig.VERSION_CODE.toString()
+ }
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/main/java/eu/nets/mia/data/MiAPaymentInfo.kt b/MiA-SDK/mia/src/main/java/eu/nets/mia/data/MiAPaymentInfo.kt
new file mode 100644
index 0000000..f8a6924
--- /dev/null
+++ b/MiA-SDK/mia/src/main/java/eu/nets/mia/data/MiAPaymentInfo.kt
@@ -0,0 +1,91 @@
+package eu.nets.mia.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+
+/**
+ * MiaPaymentInfo object containing the payment information required by the SDK
+ *
+ * First two parameters define the Merchant Hosted Payment Page integration type
+ * @param paymentId The id of the payment generated by merchant app
+ * @param checkoutUrl The URL of the checkout page containing the Easy iFrame script
+ *
+ * Along the two parameters sent above, mentioning the following parameter will specify the SDK that
+ * the Integration type is: Easy Host Payment Page
+ */
+class MiAPaymentInfo(var paymentId: String, var checkoutUrl: String) : Parcelable {
+
+ var returnUrl: String? = null
+ var cancelUrl: String? = null
+
+ constructor(parcel: Parcel) : this(
+ parcel.readString(),
+ parcel.readString(),
+ parcel.readString(),
+ parcel.readString())
+
+ @Deprecated("Use the new method MiAPaymentInfo(paymentId: String, checkoutUrl: String, returnUrl: String?, cancelUrl: String?) method", level = DeprecationLevel.WARNING)
+ constructor(paymentId: String, checkoutUrl: String, returnUrl: String?) : this(paymentId, checkoutUrl) {
+ this.returnUrl = returnUrl
+ }
+
+ constructor(paymentId: String, checkoutUrl: String, returnUrl: String?, cancelUrl: String?) : this(paymentId, checkoutUrl) {
+ this.returnUrl = returnUrl
+ this.cancelUrl = cancelUrl
+ }
+
+ override fun writeToParcel(parcel: Parcel, flags: Int) {
+ parcel.writeString(paymentId)
+ parcel.writeString(checkoutUrl)
+ parcel.writeString(returnUrl)
+ parcel.writeString(cancelUrl)
+ }
+
+ override fun describeContents(): Int {
+ return 0
+ }
+
+ companion object CREATOR : Parcelable.Creator {
+ override fun createFromParcel(parcel: Parcel): MiAPaymentInfo {
+ return MiAPaymentInfo(parcel)
+ }
+
+ override fun newArray(size: Int): Array {
+ return arrayOfNulls(size)
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/main/java/eu/nets/mia/data/MiAResult.kt b/MiA-SDK/mia/src/main/java/eu/nets/mia/data/MiAResult.kt
new file mode 100644
index 0000000..d250bb1
--- /dev/null
+++ b/MiA-SDK/mia/src/main/java/eu/nets/mia/data/MiAResult.kt
@@ -0,0 +1,143 @@
+package eu.nets.mia.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+
+/**
+ * MiaResult class used to deliver the payment result back to merchant app
+ *
+ * @param success flag used to specify if the payment was successful or not
+ */
+class MiAResult(
+ /**
+ * Boolean flag which specifies the the payment process is successful or not
+ */
+ val miaResultCode: MiAResultCode
+) : Parcelable {
+
+ /**
+ * error enum item; check Overview documentation on how to Handle error codes
+ */
+ var miaError: MiAError? = null
+
+ /**
+ * Constructor called by restoring state from parcel
+ *
+ * @param parcel the Parcel containing success val and/or miaError object
+ */
+ constructor(parcel: Parcel) : this(MiAResultCode.findByInt(parcel.readInt())) {
+ miaError = try {
+ //if before writing to parcel the miaError was null, it needs to be null after createFromParcel
+ parcel.readSerializable() as MiAError
+ } catch (e: Exception) {
+ null
+ }
+ }
+
+ /**
+ * Secondary constructor; this is called only for error cases; it will set result code to RESULT_PAYMENT_FAILED by default
+ *
+ * @param miaError the error enum item (containing a code and a explanation message)
+ */
+ constructor(miaError: MiAError) : this(MiAResultCode.RESULT_PAYMENT_FAILED) {
+ this.miaError = miaError
+ }
+
+ override fun writeToParcel(parcel: Parcel, flags: Int) {
+ parcel.writeInt(miaResultCode.result)
+ parcel.writeSerializable(miaError)
+ }
+
+ override fun describeContents(): Int {
+ return 0
+ }
+
+ companion object CREATOR : Parcelable.Creator {
+ override fun createFromParcel(parcel: Parcel): MiAResult {
+ return MiAResult(parcel)
+ }
+
+ override fun newArray(size: Int): Array {
+ return arrayOfNulls(size)
+ }
+ }
+
+}
+
+enum class MiAError(val errorCode: Int) {
+ /**
+ * Error code 101; This occurs inside the SDK when something went wrong (e.g. references to
+ * paymentId and/or checkoutUrl are cleared from RAM, and the payment cannot continue)
+ */
+ MiASDKError(101);//SDK Internal error; Something wen't wrong and payment cannot continue
+
+ /**
+ * Function to return a brief description of the error
+ *
+ * @return Explanation message for each error
+ */
+ fun getErrorMessage(): String {
+ return "Something went wrong. Please try again."
+ }
+}
+
+enum class MiAResultCode(val result: Int) {
+ /**
+ * The payment process has completed by the user
+ */
+ RESULT_PAYMENT_COMPLETED(0),
+ /**
+ * The payment process was canceled by the user
+ */
+ RESULT_PAYMENT_CANCELLED(1),
+ /**
+ * The payment process has encountered and error and cannot continue
+ */
+ RESULT_PAYMENT_FAILED(2);
+
+ companion object {
+ /**
+ * Find the enum value of a specific int code
+ */
+ fun findByInt(resultCodeInt: Int): MiAResultCode {
+ for (code in values()) {
+ if (code.result == resultCodeInt) {
+ return code
+ }
+ }
+ return RESULT_PAYMENT_FAILED
+ }
+ }
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/main/java/eu/nets/mia/utils/HTMLInterceptor.java b/MiA-SDK/mia/src/main/java/eu/nets/mia/utils/HTMLInterceptor.java
new file mode 100644
index 0000000..1ea6507
--- /dev/null
+++ b/MiA-SDK/mia/src/main/java/eu/nets/mia/utils/HTMLInterceptor.java
@@ -0,0 +1,54 @@
+package eu.nets.mia.utils;
+
+import android.util.Log;
+import android.webkit.JavascriptInterface;
+
+import eu.nets.mia.BuildConfig;
+import eu.nets.mia.webview.base.BaseWebViewPresenterImpl;
+
+/**
+ * ****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+public class HTMLInterceptor {
+ /**
+ * Java method used inside the WebView to log the requests and pages
+ *
+ * @param html The page content
+ */
+ @JavascriptInterface
+ public void showHTML(String html) {
+ if (BuildConfig.DEBUG) {
+ Log.e(BaseWebViewPresenterImpl.Companion.getTAG(), "---- show html ----");
+ Log.e(BaseWebViewPresenterImpl.Companion.getTAG(), html);
+ Log.e(BaseWebViewPresenterImpl.Companion.getTAG(), "---- show html end----");
+ }
+ }
+}
diff --git a/MiA-SDK/mia/src/main/java/eu/nets/mia/utils/JSCallbackInterceptor.java b/MiA-SDK/mia/src/main/java/eu/nets/mia/utils/JSCallbackInterceptor.java
new file mode 100644
index 0000000..87e2b00
--- /dev/null
+++ b/MiA-SDK/mia/src/main/java/eu/nets/mia/utils/JSCallbackInterceptor.java
@@ -0,0 +1,58 @@
+package eu.nets.mia.utils;
+
+import android.webkit.JavascriptInterface;
+
+/**
+ * ****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+public class JSCallbackInterceptor {
+
+ private JSPaymentCallback mCallback;
+
+ /**
+ * Constructor to prepare the JavaScript callback to be send in the SDK internal code
+ *
+ * @param callback JSPaymentCallback interface
+ */
+ public JSCallbackInterceptor(JSPaymentCallback callback) {
+ this.mCallback = callback;
+ }
+
+ /**
+ * Method to be called from HTML merchant page, when the 'payment-completed' event has been triggered
+ */
+ @JavascriptInterface
+ public void notifyPaymentCompleted() {
+ if (mCallback != null) {
+ mCallback.onPaymentCompleted();
+ }
+ }
+}
diff --git a/MiA-SDK/mia/src/main/java/eu/nets/mia/utils/JSPaymentCallback.kt b/MiA-SDK/mia/src/main/java/eu/nets/mia/utils/JSPaymentCallback.kt
new file mode 100644
index 0000000..d893a87
--- /dev/null
+++ b/MiA-SDK/mia/src/main/java/eu/nets/mia/utils/JSPaymentCallback.kt
@@ -0,0 +1,41 @@
+package eu.nets.mia.utils
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+interface JSPaymentCallback {
+
+ /**
+ * Callback method to notify the SDK that the payment is completed and successful
+ */
+ fun onPaymentCompleted()
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/MiAActivity.kt b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/MiAActivity.kt
new file mode 100644
index 0000000..b999068
--- /dev/null
+++ b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/MiAActivity.kt
@@ -0,0 +1,257 @@
+package eu.nets.mia.webview
+
+import android.app.Activity
+import android.content.ActivityNotFoundException
+import android.content.DialogInterface
+import android.content.Intent
+import android.net.Uri
+import android.os.Bundle
+import android.os.PersistableBundle
+import android.support.v7.app.AlertDialog
+import eu.nets.mia.MiASDK
+import eu.nets.mia.R
+import eu.nets.mia.data.MiAError
+import eu.nets.mia.data.MiAPaymentInfo
+import eu.nets.mia.data.MiAResult
+import eu.nets.mia.data.MiAResultCode
+import eu.nets.mia.webview.base.BaseWebViewActivity
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+class MiAActivity : BaseWebViewActivity(), MiAActivityView {
+
+ //bundle keys
+ companion object {
+ const val BUNDLE_PAYMENT_INFO = "BUNDLE_PAYMENT_INFO"
+ }
+ //end
+
+ private lateinit var mPresenter: MiAActivityPresenter
+ private var miAPaymentInfo: MiAPaymentInfo? = null
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ mPresenter = MiAActivityPresenterImpl(this)
+ mPresenter.init(intent?.extras ?: savedInstanceState)
+ }
+
+ //activity lifecycle
+ /**
+ * Activity onResume()
+ * Call presenter onResume to store new state of view
+ */
+ override fun onResume() {
+ super.onResume()
+ mPresenter.onResume(this)
+ }
+
+ /**
+ * Activity onStop()
+ * Call presenter onStop to clear the state of view
+ */
+ override fun onStop() {
+ super.onStop()
+ mPresenter.onStop()
+ }
+
+ /**
+ * Store the variables in activity state so it can be retrieved later
+ */
+ override fun onSaveInstanceState(outState: Bundle?, outPersistentState: PersistableBundle?) {
+ outState?.putParcelable(BUNDLE_PAYMENT_INFO, miAPaymentInfo)
+ super.onSaveInstanceState(outState, outPersistentState)
+ }
+ //end
+
+ //easy activity view interface
+ /**
+ * Initialize the data received from the merchant app
+ * @param bundle Can be the Intent bundle data (from the merchant app directly), or
+ * savedInstanceState bundle data (SDK stored in case the app goes to background)
+ */
+ override fun initData(bundle: Bundle?) {
+ miAPaymentInfo = bundle?.getParcelable(BUNDLE_PAYMENT_INFO)
+ }
+
+ /**
+ * Validates again the paymentId and checkoutUrl
+ * - if are valid, it will notify the BaseActivity to load the specific URL
+ * - if not valid, cancel the process with error - something went wrong
+ *
+ * @param paymentId the ID of the payment provided by merchant app
+ * @param checkoutUrl the checkout url provided by merchant app
+ */
+ override fun loadWebViewData(paymentId: String?, checkoutUrl: String?) {
+ if (paymentId == null || checkoutUrl == null) {
+ //cannot continue if one of these are null -- SDK Internal error
+ setResult(Activity.RESULT_OK, getResultIntent(MiAResult(MiAError.MiASDKError)))
+ finish()
+ return
+ }
+ loadUrl(checkoutUrl, paymentId)
+ }
+
+ /**
+ * Hide/show the ProgressView based on the flag
+ * @param show Boolean flag
+ */
+ override fun showLoader(show: Boolean) {
+ showProgressView(show)
+ }
+
+ /**
+ * Returns the checkout URL received from the merchant app
+ * @return URL String
+ */
+ override fun getCheckoutUrl(): String? {
+ return miAPaymentInfo?.checkoutUrl
+ }
+
+ /**
+ * Returns the paymentId received from the merchant app
+ * @return paymentId String
+ */
+ override fun getPaymentId(): String? {
+ return miAPaymentInfo?.paymentId
+ }
+ //base activity abstract methods
+
+ /**
+ * Returns the return URL received from the merchant app
+ * @return returnUrl String
+ */
+ override fun getReturnUrl(): String? {
+ return miAPaymentInfo?.returnUrl
+ }
+
+ /**
+ * Returns the cancel URL received from the merchant app
+ * @return cancelUrl String
+ */
+ override fun getCancelUrl(): String? {
+ return miAPaymentInfo?.cancelUrl
+ }
+
+ /**
+ * BaseWebViewActivity callback
+ * Notifies this activity that the payment has finished with success
+ * Handle here the way the result gets delivered to the application
+ */
+ override fun onProcessFinishedSuccess() {
+ setResult(Activity.RESULT_OK, getResultIntent(MiAResult(MiAResultCode.RESULT_PAYMENT_COMPLETED)))
+ finish()
+ }
+
+ /**
+ * BaseWebViewActivity callback
+ * Notifies this activity that the payment was canceled
+ * Handle here the way the result gets delivered to the application
+ */
+ override fun onProcessCanceled() {
+ setResult(Activity.RESULT_OK, getResultIntent(MiAResult(MiAResultCode.RESULT_PAYMENT_CANCELLED)))
+ finish()
+ }
+ //end
+
+ //helpers
+ /**
+ * Helper method to build the result intent with data
+ */
+ private fun getResultIntent(miaResult: MiAResult): Intent {
+ val intent = Intent()
+ intent.putExtra(MiASDK.BUNDLE_COMPLETE_RESULT, miaResult)
+ return intent
+ }
+ //
+
+ override fun openBankIdApp(deepLink: String?) {
+ var intent = packageManager.getLaunchIntentForPackage("com.bankid.bus")
+ if (intent != null) {
+ // BankId app is found -- launch it
+
+ if (deepLink == null) {
+ //is nordea visa case -- launch app directly using launcher intent
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+ startActivity(intent)
+ } else {
+ //is mastercard ID check -- launch app using deeplink
+ val bankIdIntent = Intent(Intent.ACTION_VIEW)
+ bankIdIntent.setPackage("com.bankid.bus")
+ bankIdIntent.data = Uri.parse(deepLink)
+ startActivity(bankIdIntent)
+ }
+ } else {
+ // BankId app is not found on user's device -- open Market to download it
+ intent = Intent(Intent.ACTION_VIEW)
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+ intent.data = Uri.parse("market://details?id=" + "com.bankid.bus")
+ try {
+ startActivity(intent)
+ } catch (e: ActivityNotFoundException) {
+ //cannot open market -- show error toast
+ showBankIdErrorAlert()
+ }
+
+ }
+ }
+
+ private fun showBankIdErrorAlert() {
+
+ try {
+ val builder = AlertDialog.Builder(this)
+ builder.setTitle(getString(R.string.mia_error_title))
+ builder.setMessage(getString(R.string.mia_bank_id_error_open))
+ builder.setCancelable(false)
+
+ builder.setPositiveButton(
+ getString(R.string.mia_alert_ok_action),
+ DialogInterface.OnClickListener { dialog, id ->
+ dialog.cancel()
+ })
+
+ val dialog = builder.create()
+ dialog.show()
+ //apply font to dialog after the dialog.show() has been called to avoid NullPointerException
+ } catch (e: Exception) {
+ //in case activity is not attached to window -- catch exception here and do nothing
+ }
+
+ }
+
+ interface AlertCallback {
+ fun onPositiveAction()
+
+ fun onNegativeAction()
+ }
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/MiAActivityPresenter.kt b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/MiAActivityPresenter.kt
new file mode 100644
index 0000000..473127c
--- /dev/null
+++ b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/MiAActivityPresenter.kt
@@ -0,0 +1,62 @@
+package eu.nets.mia.webview
+
+import android.os.Bundle
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+interface MiAActivityPresenter {
+
+ /**
+ * Initialize the data received from the merchant app, and load the checkoutUrl receive from merchat app into the WebView
+ * @param bundle Can be the Intent bundle data (from the merchant app directly), or
+ * savedInstanceState bundle data (SDK stored in case the app goes to background)
+ */
+ fun init(bundle: Bundle?)
+
+ /**
+ * Notify the view to load the checkoutUrl page
+ */
+ fun loadCheckoutPage()
+
+ /**
+ * Update locally the recreated view instance
+ * @param miaActivityView recreated instance of the view
+ */
+ fun onResume(miaActivityView: MiAActivityView?)
+
+ /**
+ * Remove the cached instance of the view
+ */
+ fun onStop()
+
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/MiAActivityPresenterImpl.kt b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/MiAActivityPresenterImpl.kt
new file mode 100644
index 0000000..97970db
--- /dev/null
+++ b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/MiAActivityPresenterImpl.kt
@@ -0,0 +1,74 @@
+package eu.nets.mia.webview
+
+import android.os.Bundle
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+open class MiAActivityPresenterImpl(var miaActivityView: MiAActivityView?) : MiAActivityPresenter {
+
+ //easy activity presenter interface
+ /**
+ * Initialize the data received from the merchant app, and load the checkoutUrl receive from merchat app into the WebView
+ * @param bundle Can be the Intent bundle data (from the merchant app directly), or
+ * savedInstanceState bundle data (SDK stored in case the app goes to background)
+ */
+ override fun init(bundle: Bundle?) {
+ //init the data from bundle in the activity
+ miaActivityView?.initData(bundle)
+
+ loadCheckoutPage()
+ }
+
+ /**
+ * Notify the view to load the checkoutUrl page
+ */
+ override fun loadCheckoutPage() {
+ miaActivityView?.loadWebViewData(miaActivityView?.getPaymentId(), miaActivityView?.getCheckoutUrl())
+ }
+
+ /**
+ * Update locally the recreated view instance
+ * @param miaActivityView recreated instance of the view
+ */
+ override fun onResume(miaActivityView: MiAActivityView?) {
+ this.miaActivityView = miaActivityView
+ }
+
+ /**
+ * Remove the cached instance of the view
+ */
+ override fun onStop() {
+ this.miaActivityView = null
+ }
+ //end
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/MiAActivityView.kt b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/MiAActivityView.kt
new file mode 100644
index 0000000..5fb73ea
--- /dev/null
+++ b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/MiAActivityView.kt
@@ -0,0 +1,74 @@
+package eu.nets.mia.webview
+
+import android.os.Bundle
+import eu.nets.mia.data.MiAResult
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+interface MiAActivityView {
+
+ /**
+ * Initialize the data received from the merchant app
+ * @param bundle Can be the Intent bundle data (from the merchant app directly), or
+ * savedInstanceState bundle data (SDK stored in case the app goes to background)
+ */
+ fun initData(bundle: Bundle?)
+
+ /**
+ * Validates again the paymentId and checkoutUrl
+ * - if are valid, it will notify the BaseActivity to load the specific URL
+ * - if not valid, cancel the process with error - something went wrong
+ *
+ * @param paymentId the ID of the payment provided by merchant app
+ * @param checkoutUrl the checkout url provided by merchant app
+ */
+ fun loadWebViewData(paymentId: String?, checkoutUrl: String?)
+
+ /**
+ * Hide/show the ProgressView based on the flag
+ * @param show Boolean flag
+ */
+ fun showLoader(show: Boolean)
+
+ /**
+ * Returns the checkout URL received from the merchant app
+ * @return URL String
+ */
+ fun getCheckoutUrl(): String?
+
+ /**
+ * Returns the paymentId received from the merchant app
+ * @return paymentId String
+ */
+ fun getPaymentId(): String?
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/base/BaseWebView.kt b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/base/BaseWebView.kt
new file mode 100644
index 0000000..ff70cfe
--- /dev/null
+++ b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/base/BaseWebView.kt
@@ -0,0 +1,126 @@
+package eu.nets.mia.webview.base
+
+import android.os.Bundle
+import android.widget.FrameLayout
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+interface BaseWebView {
+
+ /**
+ * Initialize the UI listeners and setup the WebView configuration
+ */
+ fun init(bundle: Bundle?)
+
+ /**
+ * Close the current activity and deliver success result to application
+ */
+ fun sendOKResult()
+
+ /**
+ * Close the current activity and deliver canceled result to application
+ */
+ fun sendCancelResult()
+
+ /**
+ * Get the root view of the WebView to load multiple WebViews as child pop-ups
+ */
+ fun getRootFrame(): FrameLayout
+
+ /**
+ * Enable/disable the forward button navigation
+ *
+ * @param enable flag to specify is button is enabled or disabled
+ */
+ fun enableForwardNavigation(enable: Boolean)
+
+ /**
+ * Enable/disable the back button navigation
+ *
+ * @param enable flag to specify is button is enabled or disabled
+ */
+ fun enableBackNavigation(enable: Boolean)
+
+ /**
+ * Load the received URL in the parent WebView
+ *
+ * @param url the checkout URL provided by the merchant
+ * @param paymentId the paymentId provided by the merchant
+ */
+ fun loadUrl(url: String, paymentId: String)
+
+ /**
+ * Update the icon on the action button in the navigation bar (For parent WebView it will be Close,
+ * and for child WebView it will be Dismiss)
+ *
+ * @param resId the resource id of the Drawable
+ */
+ fun handleNavBarActionText(resId: Int)
+
+ /**
+ * Returns the checkout URL provided by merchant app
+ * @return URL String
+ */
+ fun getCheckoutPage(): String
+
+ /**
+ * Returns the payment identifier provided by merchant app
+ * @return paymentId String
+ */
+ fun getPaymentIdentifier(): String
+
+ /**
+ * Show/hide the loader based on WebView callbacks
+ */
+ fun showProgressView(show: Boolean)
+
+ /**
+ * Returns the return URL received from the merchant app
+ * @return returnUrl String
+ */
+ fun getRedirectUrl(): String?
+
+ /**
+ * Returns the cancel URL received from the merchant app
+ * @return cancelUrl String
+ */
+ fun getCancelURL(): String?
+
+ /**
+ * Case when customer's credit card supports BankId
+ *
+ * @param deepLink bankId deeplink URL for app switch;
+ * (if it's null, will launch the app using launcher intent; of not, will launch it using scheme url)
+ */
+ fun openBankIdApp(deepLink: String?)
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/base/BaseWebViewActivity.kt b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/base/BaseWebViewActivity.kt
new file mode 100644
index 0000000..f6ee43a
--- /dev/null
+++ b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/base/BaseWebViewActivity.kt
@@ -0,0 +1,235 @@
+package eu.nets.mia.webview.base
+
+import android.graphics.PorterDuff
+import android.graphics.drawable.Drawable
+import android.os.Bundle
+import android.support.v4.content.ContextCompat
+import android.support.v7.app.AppCompatActivity
+import android.view.View
+import android.view.WindowManager
+import android.widget.FrameLayout
+import eu.nets.mia.BuildConfig
+import eu.nets.mia.R
+import kotlinx.android.synthetic.main.activity_base_webview.*
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+abstract class BaseWebViewActivity : AppCompatActivity(), BaseWebView {
+
+ abstract fun onProcessFinishedSuccess()
+ abstract fun onProcessCanceled()
+ abstract fun getReturnUrl(): String?
+ abstract fun getCancelUrl(): String?
+
+ private lateinit var mPresenter: BaseWebViewPresenter
+ private lateinit var checkoutPage: String
+ private lateinit var paymentId: String
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ //disable screenshot
+ if (BuildConfig.DEBUG) {
+ window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
+ } else {
+ window.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
+ }
+
+ setContentView(R.layout.activity_base_webview)
+
+ mPresenter = BaseWebViewPresenterImpl(this)
+ mPresenter.onCreate(savedInstanceState)
+ }
+
+ //activity lifecycle
+ /**
+ * Activity onResume()
+ * Call presenter onResume to store new state of view and to resume the WebView timers
+ */
+ override fun onResume() {
+ super.onResume()
+ mPresenter.onResume(this)
+ }
+
+ /**
+ * Activity onStop()
+ * Call presenter onStop to clear the state of view
+ */
+ override fun onStop() {
+ super.onStop()
+ mPresenter.onStop()
+ }
+
+ /**
+ * Activity onPause()
+ * Call presenter onPause to pause the WebView timers
+ */
+ override fun onPause() {
+ super.onPause()
+ mPresenter.onPause()
+ }
+
+ /**
+ * Activity onBackPressed()
+ * Check if there are opened WebView pop-ups to be closed. If not, navigate back
+ */
+ override fun onBackPressed() {
+ if (mPresenter.getLatestWebView() != null) {
+ mPresenter.onBackPressed()
+ } else {
+ super.onBackPressed()
+ }
+ }
+ //end
+
+ //base web view interface
+ /**
+ * Initialize the UI listeners and setup the WebView configuration
+ */
+ override fun init(bundle: Bundle?) {
+ //set listeners
+ actionBack.setOnClickListener { mPresenter.onNavigateBack() }
+ actionForward.setOnClickListener { mPresenter.onNavigateForward() }
+ actionClose.setOnClickListener {
+ if (mPresenter.getLatestWebView() != null) mPresenter.onBackPressed() else sendCancelResult()
+ }
+
+ mPresenter.configureWebView(parentWebView)
+ }
+
+ /**
+ * Close the current activity and deliver success result to application
+ */
+ override fun sendOKResult() {
+ onProcessFinishedSuccess()
+ }
+
+ /**
+ * Close the current activity and deliver canceled result to application
+ */
+ override fun sendCancelResult() {
+ onProcessCanceled()
+ }
+
+ /**
+ * Get the root view of the WebView to load multiple WebViews as child pop-ups
+ */
+ override fun getRootFrame(): FrameLayout {
+ return baseFrameLayout
+ }
+
+ /**
+ * Enable/disable the forward button navigation
+ *
+ * @param enable flag to specify is button is enabled or disabled
+ */
+ override fun enableForwardNavigation(enable: Boolean) {
+ actionForward.isEnabled = enable
+ actionForward.alpha = if (enable) 1f else 0.3f
+ }
+
+ /**
+ * Enable/disable the back button navigation
+ *
+ * @param enable flag to specify is button is enabled or disabled
+ */
+ override fun enableBackNavigation(enable: Boolean) {
+ actionBack.isEnabled = enable
+ actionBack.alpha = if (enable) 1f else 0.3f
+ }
+
+ /**
+ * Load the received URL in the parent WebView
+ *
+ * @param url the checkout URL provided by the merchant
+ * @param paymentId the paymentId provided by the merchant
+ */
+ override fun loadUrl(url: String, paymentId: String) {
+ this.checkoutPage = url
+ this.paymentId = paymentId
+ parentWebView.loadUrl(url)
+ }
+
+ /**
+ * Update the icon on the action button in the navigation bar (For parent WebView it will be Close,
+ * and for child WebView it will be Dismiss)
+ *
+ * @param resId the resource id of the Drawable
+ */
+ override fun handleNavBarActionText(resId: Int) {
+ val actionDrawable: Drawable? = ContextCompat.getDrawable(this, resId)
+ actionDrawable?.setColorFilter(ContextCompat.getColor(this, R.color.miaColorPrimary), PorterDuff.Mode.SRC_IN)
+ actionClose.setImageDrawable(actionDrawable)
+ }
+
+ /**
+ * Returns the checkout URL provided by merchant app
+ * @return URL String
+ */
+ override fun getCheckoutPage(): String {
+ return checkoutPage
+ }
+
+ /**
+ * Returns the payment identifier provided by merchant app
+ * @return paymentId String
+ */
+ override fun getPaymentIdentifier(): String {
+ return paymentId
+ }
+
+ /**
+ * Show/hide the loader based on WebView callbacks
+ */
+ override fun showProgressView(show: Boolean) {
+ progressView.visibility = if (show) View.VISIBLE else View.GONE
+ parentWebView.setOnTouchListener { _, _ -> show }
+ }
+
+ /**
+ * Returns the return URL received from the merchant app
+ * @return returnUrl String
+ */
+ override fun getRedirectUrl(): String? {
+ return getReturnUrl()
+ }
+
+ /**
+ * Returns the cancel URL received from the merchant app
+ * @return cancelUrl String
+ */
+ override fun getCancelURL(): String? {
+ return getCancelUrl()
+ }
+
+ //end
+}
diff --git a/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/base/BaseWebViewPresenter.kt b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/base/BaseWebViewPresenter.kt
new file mode 100644
index 0000000..8cb42a8
--- /dev/null
+++ b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/base/BaseWebViewPresenter.kt
@@ -0,0 +1,160 @@
+package eu.nets.mia.webview.base
+
+import android.os.Bundle
+import android.webkit.WebView
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+interface BaseWebViewPresenter {
+
+ /**
+ * Initialize the view and make startup configurations
+ */
+ fun onCreate(savedInstanceState: Bundle?)
+
+ /**
+ * Configure the useful settings for the WebView
+ *
+ * @param webView the WebView to be configured
+ */
+ fun configureWebView(webView: WebView?)
+
+ /**
+ * In case of Easy Host Payment window integration type, do the following:
+ * - check if the redirect happens to the url provided by the application
+ * - check if the redirect url contains the actual payment id
+ * - if so, stop the SDK process and deliver payment result OK
+ *
+ * In case of other integration types, do nothing!
+ */
+ fun handleShouldOverrideUrlLoading(url: String?) : Boolean
+
+ /**
+ * Creates a new WebView called "Child" to be loaded on top of the parent (pop-up)
+ * It will have same functionalities as the parent, except the detection of the payment status.
+ * Usually, this child will only show pages like: Help, Terms&Conditions, etc.
+ *
+ * @return WebView popup
+ */
+ fun createChildWebView(): WebView?
+
+ /**
+ * Apply required settings to the given WebView
+ *
+ * @param webView The WebView which will be modified to have required settings
+ * @return WebView with specific settings
+ */
+ fun applyWebViewSettings(webView: WebView?): WebView?
+
+ /**
+ * Handles hardware back button interactions
+ */
+ fun onBackPressed()
+
+ /**
+ * Navigate to previous loaded page in the visible WebView
+ */
+ fun onNavigateBack()
+
+ /**
+ * Navigate to next loaded page in the visible WebView
+ */
+ fun onNavigateForward()
+
+ /**
+ * Mark Forward button as enabled or disabled
+ * @param enable Boolean flag
+ */
+ fun enableForwardNavigation(enable: Boolean)
+
+ /**
+ * Mark Back button as enabled or disabled
+ * @param enable Boolean flag
+ */
+ fun enableBackNavigation(enable: Boolean)
+
+ /**
+ * Returns the latest loaded WebView (the visible one)
+ * @return WebView child or parent
+ */
+ fun getLatestWebView(): WebView?
+
+ /**
+ * Pauses the JavaScript functions in WebView that are running periodically
+ */
+ fun pauseTimers()
+
+ /**
+ * Resumes the JavaScript functions in WebView that are running periodically
+ */
+ fun resumeTimers()
+
+ /**
+ * Send callbacks to activity to enable/disable both navigation arrows in the same time
+ */
+ fun notifyNavigationEnabled()
+
+ /**
+ * Removed the visible WebView from UI and from local stack
+ */
+ fun removeLatestWebView()
+
+ /**
+ * Handles the case of Canceled or Not Authenticated user cases
+ */
+ fun handlePageFinished(url: String?)
+
+ /**
+ * Update the icon on the action button in the navigation bar (For parent WebView it will be Close,
+ * and for child WebView it will be Dismiss)
+ *
+ * @param resId the resource id of the Drawable
+ */
+ fun handleNavBarActionIcon(resId: Int)
+
+ /**
+ * Update locally the recreated view instance and resume the WebView JavaScript functions
+ * @param baseWebView recreated instance of the view
+ */
+ fun onResume(baseWebView: BaseWebView?)
+
+ /**
+ * Remove the cached instance of the view
+ */
+ fun onStop()
+
+ /**
+ * Stop the JavaScript functions
+ */
+ fun onPause()
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/base/BaseWebViewPresenterImpl.kt b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/base/BaseWebViewPresenterImpl.kt
new file mode 100644
index 0000000..12e8540
--- /dev/null
+++ b/MiA-SDK/mia/src/main/java/eu/nets/mia/webview/base/BaseWebViewPresenterImpl.kt
@@ -0,0 +1,394 @@
+package eu.nets.mia.webview.base
+
+import android.annotation.SuppressLint
+import android.content.Context
+import android.graphics.Bitmap
+import android.os.Bundle
+import android.os.Message
+import android.webkit.WebChromeClient
+import android.webkit.WebResourceRequest
+import android.webkit.WebView
+import android.webkit.WebViewClient
+import eu.nets.mia.R
+import eu.nets.mia.utils.HTMLInterceptor
+import eu.nets.mia.utils.JSCallbackInterceptor
+import eu.nets.mia.utils.JSPaymentCallback
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+open class BaseWebViewPresenterImpl(var mView: BaseWebView?) : BaseWebViewPresenter, JSPaymentCallback {
+
+ companion object {
+ val TAG: String = BaseWebViewPresenterImpl::class.java.simpleName
+ }
+
+ protected var parentWebView: WebView? = null
+ protected var childWebViewList: ArrayList = ArrayList()
+ private var transactionCanceled: Boolean = false
+ protected val pdfViewerUrl: String = "https://drive.google.com/viewerng/viewer?embedded=true&url="
+
+ protected var parentWebViewClient = object : WebViewClient() {
+
+ //NOTE: This method will be called for API 24 and above
+ override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean {
+ return handleShouldOverrideUrlLoading(request?.url?.toString())
+ }
+
+ //NOTE: This method will be called for API 23 and below. THis was deprecated in API 24
+ override fun shouldOverrideUrlLoading(view: WebView?, url: String): Boolean {
+ return handleShouldOverrideUrlLoading(url)
+ }
+
+ override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
+ mView?.showProgressView(true)
+ enableBackNavigation(false)
+ super.onPageStarted(view, url, favicon)
+ }
+
+ override fun onPageFinished(view: WebView?, url: String?) {
+ mView?.showProgressView(false)
+ view?.loadUrl("javascript:window.HTMLInterceptor.showHTML" +
+ "(''+document.getElementsByTagName('html')[0].innerHTML+'');")
+ notifyNavigationEnabled()
+ handlePageFinished(url)
+ }
+ }
+
+ protected var childWebViewClient = object : WebViewClient() {
+ var urlToUpload: String? = null
+ var urlToUploadFlag: Boolean? = false
+
+ override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
+ super.onPageStarted(view, url, favicon)
+ mView?.showProgressView(true)
+ enableBackNavigation(false)
+ if (!url!!.contains(pdfViewerUrl) && url.endsWith(".pdf")) {
+ urlToUpload = url
+ urlToUploadFlag = true
+ }
+
+ if (urlToUpload != null && urlToUploadFlag ?: true) {
+ val completeUrl = pdfViewerUrl + urlToUpload
+ view?.loadUrl(completeUrl)
+ }
+
+ if (url == "about:blank") {
+ urlToUploadFlag = false
+ }
+ }
+
+ override fun onPageFinished(view: WebView?, url: String?) {
+ super.onPageFinished(view, url)
+ mView?.showProgressView(false)
+ view?.loadUrl("javascript:window.HTMLInterceptor.showHTML" +
+ "(''+document.getElementsByTagName('html')[0].innerHTML+'');")
+ view?.clearCache(true)
+ view?.clearHistory()
+ notifyNavigationEnabled()
+ }
+ }
+
+ /**
+ * Initialize the view and make startup configurations
+ */
+ override
+ fun onCreate(savedInstanceState: Bundle?) {
+ mView?.init(savedInstanceState)
+
+ enableBackNavigation(false)
+ enableForwardNavigation(false)
+ }
+
+ /**
+ * Configure the useful settings for the WebView
+ *
+ * @param webView the WebView to be configured
+ */
+ override fun configureWebView(webView: WebView?) {
+
+ parentWebView = applyWebViewSettings(webView)
+
+ webView?.webChromeClient = object : WebChromeClient() {
+ override fun onCreateWindow(view: WebView?, isDialog: Boolean, isUserGesture: Boolean, resultMsg: Message?): Boolean {
+ val childWebView = createChildWebView() ?: return false
+ (resultMsg?.obj as WebView.WebViewTransport).webView = childWebView
+ resultMsg.sendToTarget()
+ return true
+ }
+ }
+
+ webView?.webViewClient = parentWebViewClient
+
+ //on parent WebView show cancel icon
+ handleNavBarActionIcon(R.drawable.mia_ic_close)
+ }
+
+ /**
+ * In case of Easy Host Payment window integration type, do the following:
+ * - check if the redirect happens to the url provided by the application
+ * - check if the redirect url contains the actual payment id
+ * - if so, stop the SDK process and deliver payment result OK
+ *
+ * In case of other integration types, do nothing!
+ */
+ override fun handleShouldOverrideUrlLoading(url: String?): Boolean {
+ if (url == null) return false //don't interfere with the redirect
+
+ val redirectUrl = mView?.getRedirectUrl()
+ val cancelUrl = mView?.getCancelURL()
+ if (redirectUrl != null && url.contains(redirectUrl)
+ && url.endsWith(mView?.getPaymentIdentifier() ?: "")) {
+ //is Easy Host Payment window integration type
+ mView?.sendOKResult()
+ return true
+ } else if (cancelUrl != null && url.contains(cancelUrl)) {
+ mView?.sendCancelResult()
+ return true
+ } else if (url.toLowerCase().contains("com.bankid.bus")) run {
+ //check if user chose BankId option and open app
+ mView?.openBankIdApp(null) //deeplink is null -- open the app using launcher intent
+ return true
+ } else if (url.toLowerCase().startsWith("bankid://")) run {
+ mView?.openBankIdApp(url) //deeplink is valid -- use app switch with scheme url
+ return true
+ }
+
+ return false //don't interfere with the redirect
+ }
+
+ /**
+ * Creates a new WebView called "Child" to be loaded on top of the parent (pop-up)
+ * It will have same functionalities as the parent, except the detection of the payment status.
+ * Usually, this child will only show pages like: Help, Terms&Conditions, etc.
+ *
+ * @return WebView popup
+ */
+ override fun createChildWebView(): WebView? {
+ if (mView?.getRootFrame() == null) return null
+
+ val childWebView = applyWebViewSettings(WebView(mView as Context))
+
+ childWebViewList.add(childWebView!!)
+ mView?.getRootFrame()?.addView(childWebView)
+
+ handleNavBarActionIcon(R.drawable.mia_ic_dismiss)
+
+ childWebView.webChromeClient = object : WebChromeClient() {
+
+ override fun onCreateWindow(view: WebView?, isDialog: Boolean, isUserGesture: Boolean, resultMsg: Message?): Boolean {
+ val child: WebView = createChildWebView() ?: return false
+ (resultMsg?.obj as WebView.WebViewTransport).webView = child
+ resultMsg.sendToTarget()
+ return true
+ }
+
+ override fun onCloseWindow(window: WebView?) {
+ super.onCloseWindow(window)
+ removeLatestWebView()
+ }
+ }
+
+ childWebView.webViewClient = childWebViewClient
+
+ notifyNavigationEnabled()
+
+ return childWebView
+ }
+
+ /**
+ * Apply required settings to the given WebView
+ *
+ * @param webView The WebView which will be modified to have required settings
+ * @return WebView with specific settings
+ */
+ @SuppressLint("SetJavaScriptEnabled")
+ override fun applyWebViewSettings(webView: WebView?): WebView? {
+ webView?.settings?.builtInZoomControls = true
+ webView?.settings?.domStorageEnabled = true
+ webView?.settings?.javaScriptEnabled = true
+ webView?.settings?.javaScriptCanOpenWindowsAutomatically = true
+ webView?.settings?.setSupportMultipleWindows(true)
+ webView?.settings?.useWideViewPort = true
+ webView?.settings?.loadWithOverviewMode = true
+
+ webView?.addJavascriptInterface(HTMLInterceptor(), "HTMLInterceptor")
+ webView?.addJavascriptInterface(JSCallbackInterceptor(this), "JSCallbackInterceptor")
+
+ return webView
+ }
+
+ /**
+ * Handles hardware back button interactions
+ */
+ override fun onBackPressed() {
+ removeLatestWebView()
+ }
+
+ /**
+ * Navigate to previous loaded page in the visible WebView
+ */
+ override fun onNavigateBack() {
+ if (getLatestWebView() != null) {
+ if (getLatestWebView()?.canGoBack() == true) getLatestWebView()?.goBack()
+ } else {
+ if (parentWebView?.canGoBack() == true) parentWebView?.goBack()
+ }
+ }
+
+ /**
+ * Navigate to next loaded page in the visible WebView
+ */
+ override fun onNavigateForward() {
+ if (getLatestWebView() != null) {
+ if (getLatestWebView()?.canGoForward() == true) getLatestWebView()?.goForward()
+ } else {
+ if (parentWebView?.canGoForward() == true) parentWebView?.goForward()
+ }
+ }
+
+ /**
+ * Mark Forward button as enabled or disabled
+ * @param enable Boolean flag
+ */
+ override fun enableForwardNavigation(enable: Boolean) {
+ mView?.enableForwardNavigation(enable)
+ }
+
+ /**
+ * Mark Back button as enabled or disabled
+ * @param enable Boolean flag
+ */
+ override fun enableBackNavigation(enable: Boolean) {
+ mView?.enableBackNavigation(enable)
+ }
+
+ /**
+ * Returns the latest loaded WebView (the visible one)
+ * @return WebView child or parent
+ */
+ override fun getLatestWebView(): WebView? {
+ return childWebViewList.lastOrNull()
+ }
+
+ /**
+ * Pauses the JavaScript functions in WebView that are running periodically
+ */
+ override fun pauseTimers() {
+ parentWebView?.pauseTimers()
+ }
+
+ /**
+ * Resumes the JavaScript functions in WebView that are running periodically
+ */
+ override fun resumeTimers() {
+ parentWebView?.resumeTimers()
+ }
+
+ /**
+ * Send callbacks to activity to enable/disable both navigation arrows in the same time
+ */
+ override fun notifyNavigationEnabled() {
+ enableBackNavigation(getLatestWebView()?.canGoBack() == true)
+ enableForwardNavigation(getLatestWebView()?.canGoForward() == true)
+ }
+
+ /**
+ * Removed the visible WebView from UI and from local stack
+ */
+ override fun removeLatestWebView() {
+ val child = childWebViewList.lastOrNull()
+ mView?.showProgressView(false)
+
+ if (child != null) {
+ mView?.getRootFrame()?.removeView(child)
+ child.destroy()
+ childWebViewList.remove(child)
+ }
+
+ if (childWebViewList.size == 0) handleNavBarActionIcon(R.drawable.mia_ic_close)
+ notifyNavigationEnabled()
+ }
+
+ /**
+ * Handles the case of Canceled or Not Authenticated user cases
+ */
+ override fun handlePageFinished(url: String?) {
+ if (transactionCanceled) {
+ mView?.sendCancelResult()
+ }
+ if (url?.contains("authenticated=false") == true) {
+ transactionCanceled = true
+ }
+ }
+
+ /**
+ * Update the icon on the action button in the navigation bar (For parent WebView it will be Close,
+ * and for child WebView it will be Dismiss)
+ *
+ * @param resId the resource id of the Drawable
+ */
+ override fun handleNavBarActionIcon(resId: Int) {
+ mView?.handleNavBarActionText(resId)
+ }
+
+ /**
+ * Update locally the recreated view instance and resume the WebView JavaScript functions
+ * @param baseWebView recreated instance of the view
+ */
+ override fun onResume(baseWebView: BaseWebView?) {
+ this.mView = baseWebView
+ resumeTimers()
+ }
+
+ /**
+ * Remove the cached instance of the view
+ */
+ override fun onStop() {
+ mView = null
+ }
+
+ /**
+ * Stop the JavaScript functions
+ */
+ override fun onPause() {
+ pauseTimers()
+ }
+
+ /**
+ * Callback method to notify the SDK that the payment is completed and successful
+ */
+ override fun onPaymentCompleted() {
+ mView?.sendOKResult()
+ }
+
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/main/res/drawable-hdpi/mia_ic_close.png b/MiA-SDK/mia/src/main/res/drawable-hdpi/mia_ic_close.png
new file mode 100644
index 0000000..12449e5
Binary files /dev/null and b/MiA-SDK/mia/src/main/res/drawable-hdpi/mia_ic_close.png differ
diff --git a/MiA-SDK/mia/src/main/res/drawable-hdpi/mia_ic_dismiss.png b/MiA-SDK/mia/src/main/res/drawable-hdpi/mia_ic_dismiss.png
new file mode 100644
index 0000000..ff1e433
Binary files /dev/null and b/MiA-SDK/mia/src/main/res/drawable-hdpi/mia_ic_dismiss.png differ
diff --git a/MiA-SDK/mia/src/main/res/drawable-mdpi/mia_ic_close.png b/MiA-SDK/mia/src/main/res/drawable-mdpi/mia_ic_close.png
new file mode 100644
index 0000000..af70e73
Binary files /dev/null and b/MiA-SDK/mia/src/main/res/drawable-mdpi/mia_ic_close.png differ
diff --git a/MiA-SDK/mia/src/main/res/drawable-mdpi/mia_ic_dismiss.png b/MiA-SDK/mia/src/main/res/drawable-mdpi/mia_ic_dismiss.png
new file mode 100644
index 0000000..04655c9
Binary files /dev/null and b/MiA-SDK/mia/src/main/res/drawable-mdpi/mia_ic_dismiss.png differ
diff --git a/MiA-SDK/mia/src/main/res/drawable-xhdpi/mia_ic_close.png b/MiA-SDK/mia/src/main/res/drawable-xhdpi/mia_ic_close.png
new file mode 100644
index 0000000..9224f68
Binary files /dev/null and b/MiA-SDK/mia/src/main/res/drawable-xhdpi/mia_ic_close.png differ
diff --git a/MiA-SDK/mia/src/main/res/drawable-xhdpi/mia_ic_dismiss.png b/MiA-SDK/mia/src/main/res/drawable-xhdpi/mia_ic_dismiss.png
new file mode 100644
index 0000000..8b6744d
Binary files /dev/null and b/MiA-SDK/mia/src/main/res/drawable-xhdpi/mia_ic_dismiss.png differ
diff --git a/MiA-SDK/mia/src/main/res/drawable-xxhdpi/mia_ic_close.png b/MiA-SDK/mia/src/main/res/drawable-xxhdpi/mia_ic_close.png
new file mode 100644
index 0000000..8869de6
Binary files /dev/null and b/MiA-SDK/mia/src/main/res/drawable-xxhdpi/mia_ic_close.png differ
diff --git a/MiA-SDK/mia/src/main/res/drawable-xxhdpi/mia_ic_dismiss.png b/MiA-SDK/mia/src/main/res/drawable-xxhdpi/mia_ic_dismiss.png
new file mode 100644
index 0000000..baf0fe8
Binary files /dev/null and b/MiA-SDK/mia/src/main/res/drawable-xxhdpi/mia_ic_dismiss.png differ
diff --git a/MiA-SDK/mia/src/main/res/drawable-xxxhdpi/mia_ic_close.png b/MiA-SDK/mia/src/main/res/drawable-xxxhdpi/mia_ic_close.png
new file mode 100644
index 0000000..92e5c90
Binary files /dev/null and b/MiA-SDK/mia/src/main/res/drawable-xxxhdpi/mia_ic_close.png differ
diff --git a/MiA-SDK/mia/src/main/res/drawable-xxxhdpi/mia_ic_dismiss.png b/MiA-SDK/mia/src/main/res/drawable-xxxhdpi/mia_ic_dismiss.png
new file mode 100644
index 0000000..e111894
Binary files /dev/null and b/MiA-SDK/mia/src/main/res/drawable-xxxhdpi/mia_ic_dismiss.png differ
diff --git a/MiA-SDK/mia/src/main/res/drawable/mia_ic_chevron_left_black_24dp.xml b/MiA-SDK/mia/src/main/res/drawable/mia_ic_chevron_left_black_24dp.xml
new file mode 100644
index 0000000..9049f6a
--- /dev/null
+++ b/MiA-SDK/mia/src/main/res/drawable/mia_ic_chevron_left_black_24dp.xml
@@ -0,0 +1,7 @@
+
+
+
diff --git a/MiA-SDK/mia/src/main/res/drawable/mia_ic_chevron_right_black_24dp.xml b/MiA-SDK/mia/src/main/res/drawable/mia_ic_chevron_right_black_24dp.xml
new file mode 100644
index 0000000..2a6b727
--- /dev/null
+++ b/MiA-SDK/mia/src/main/res/drawable/mia_ic_chevron_right_black_24dp.xml
@@ -0,0 +1,7 @@
+
+
+
diff --git a/MiA-SDK/mia/src/main/res/layout/activity_base_webview.xml b/MiA-SDK/mia/src/main/res/layout/activity_base_webview.xml
new file mode 100644
index 0000000..eaa1073
--- /dev/null
+++ b/MiA-SDK/mia/src/main/res/layout/activity_base_webview.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/main/res/values/colors.xml b/MiA-SDK/mia/src/main/res/values/colors.xml
new file mode 100644
index 0000000..83849f1
--- /dev/null
+++ b/MiA-SDK/mia/src/main/res/values/colors.xml
@@ -0,0 +1,8 @@
+
+
+ #2a86c3
+ #2372a6
+ #2a86c3
+
+ #b9e2e1e1
+
diff --git a/MiA-SDK/mia/src/main/res/values/strings.xml b/MiA-SDK/mia/src/main/res/values/strings.xml
new file mode 100644
index 0000000..0c8c3e9
--- /dev/null
+++ b/MiA-SDK/mia/src/main/res/values/strings.xml
@@ -0,0 +1,7 @@
+
+
+ Error
+ Cannot switch or find BankID application. Please open and authenticate with BankID application manually.
+ OK
+
+
diff --git a/MiA-SDK/mia/src/main/res/values/styles.xml b/MiA-SDK/mia/src/main/res/values/styles.xml
new file mode 100644
index 0000000..3689637
--- /dev/null
+++ b/MiA-SDK/mia/src/main/res/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/MiA-SDK/mia/src/test/java/eu/nets/mia/MiaSDKTest.kt b/MiA-SDK/mia/src/test/java/eu/nets/mia/MiaSDKTest.kt
new file mode 100644
index 0000000..4d72091
--- /dev/null
+++ b/MiA-SDK/mia/src/test/java/eu/nets/mia/MiaSDKTest.kt
@@ -0,0 +1,111 @@
+package eu.nets.mia
+
+import android.app.Activity
+import android.content.Intent
+import android.support.v4.app.Fragment
+import eu.nets.mia.data.MiAPaymentInfo
+import junit.framework.TestCase.assertEquals
+import junit.framework.TestCase.assertNotNull
+import org.junit.Before
+import org.junit.Test
+import org.mockito.ArgumentMatchers
+import org.mockito.Mockito.*
+import kotlin.IllegalArgumentException
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+class MiaSDKTest {
+
+ private lateinit var miASDK: MiASDK
+
+ @Before
+ fun before() {
+ miASDK = mock(MiASDK::class.java)
+ }
+
+ @Test
+ fun testCompanion() {
+ assertEquals(1001, MiASDK.EASY_SDK_REQUEST_CODE)
+ assertEquals("BUNDLE_COMPLETE_RESULT", MiASDK.BUNDLE_COMPLETE_RESULT)
+ assertNotNull(MiASDK.getInstance())
+ }
+
+ @Test
+ fun test_StartSDK_FromActivity(){
+ val activity = mock(Activity::class.java)
+ val paymentId = "paymentId"
+ val checkoutUrl = "http://checkoutUrl"
+ val paymentInfo = MiAPaymentInfo(paymentId, checkoutUrl)
+
+ miASDK.startSDK(activity,paymentInfo)
+
+ verify(activity).startActivityForResult(any(Intent::class.java), ArgumentMatchers.anyInt())
+ }
+
+ @Test(expected = IllegalArgumentException::class)
+ fun test_StartSDK_FromActivity_InvalidCheckoutUrl(){
+ val activity = mock(Activity::class.java)
+ val paymentId = "paymentId"
+ val checkoutUrl = "checkoutUrl"
+ val paymentInfo = MiAPaymentInfo(paymentId, checkoutUrl)
+
+ miASDK.startSDK(activity,paymentInfo)
+
+ verify(activity).startActivityForResult(any(Intent::class.java), ArgumentMatchers.anyInt())
+ }
+
+ @Test
+ fun test_StartSDK_FromFragment(){
+ val fragment = mock(Fragment::class.java)
+ val paymentId = "paymentId"
+ val checkoutUrl = "https://checkoutUrl"
+ val paymentInfo = MiAPaymentInfo(paymentId, checkoutUrl)
+
+ miASDK.startSDK(fragment,paymentInfo)
+
+ verify(fragment).startActivityForResult(any(Intent::class.java), ArgumentMatchers.anyInt())
+ }
+
+ @Test(expected = IllegalArgumentException::class)
+ fun test_StartSDK_FFragment_InvalidCheckoutUrl(){
+ val fragment = mock(Fragment::class.java)
+ val paymentId = "paymentId"
+ val checkoutUrl = "checkoutUrl"
+ val paymentInfo = MiAPaymentInfo(paymentId, checkoutUrl)
+
+ miASDK.startSDK(fragment,paymentInfo)
+
+ verify(fragment).startActivityForResult(any(Intent::class.java), ArgumentMatchers.anyInt())
+ }
+
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/test/java/eu/nets/mia/data/MiAPaymentInfoTest.kt b/MiA-SDK/mia/src/test/java/eu/nets/mia/data/MiAPaymentInfoTest.kt
new file mode 100644
index 0000000..d859a4c
--- /dev/null
+++ b/MiA-SDK/mia/src/test/java/eu/nets/mia/data/MiAPaymentInfoTest.kt
@@ -0,0 +1,110 @@
+package eu.nets.mia.data
+
+import android.os.Parcel
+import junit.framework.TestCase.assertEquals
+import junit.framework.TestCase.assertNotSame
+import org.junit.Test
+import org.mockito.Mockito.*
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+class MiAPaymentInfoTest {
+
+ @Test
+ fun testPrimaryConstructor() {
+ val paymentId = "paymentId"
+ val checkoutUrl = "checkoutUrl"
+ val paymentInfo = MiAPaymentInfo(paymentId, checkoutUrl)
+
+ assertEquals(paymentId, paymentInfo.paymentId)
+ assertEquals(checkoutUrl, paymentInfo.checkoutUrl)
+ }
+
+ @Test
+ fun testSecondaryConstructor() {
+ val paymentId = "paymentId"
+ val checkoutUrl = "checkoutUrl"
+ val returnUrl = "returnUrl"
+ val paymentInfo = MiAPaymentInfo(paymentId, checkoutUrl, returnUrl)
+
+ assertEquals(paymentId, paymentInfo.paymentId)
+ assertEquals(checkoutUrl, paymentInfo.checkoutUrl)
+ assertEquals(returnUrl, paymentInfo.returnUrl)
+ }
+
+ @Test
+ fun testParcelable() {
+ val paymentId = "paymentId"
+ val checkoutUrl = "checkoutUrl"
+ val paymentInfo = MiAPaymentInfo(paymentId, checkoutUrl)
+ val parcel: Parcel = mock(Parcel::class.java)
+
+ paymentInfo.writeToParcel(parcel, paymentInfo.describeContents())
+ parcel.setDataPosition(0)
+
+ verify(parcel).writeString(paymentId)
+ verify(parcel).writeString(checkoutUrl)
+
+ `when`(parcel.readString()).thenReturn(paymentId)
+
+ val paymentInfoFromParcel = MiAPaymentInfo.createFromParcel(parcel)
+
+ assertEquals(paymentId, paymentInfoFromParcel.paymentId)
+ }
+
+ @Test
+ fun testParcelable_NewArray() {
+ val expected = 2
+ val newArray = MiAPaymentInfo.newArray(expected)
+
+ assertEquals(expected, newArray.size)
+ }
+
+ @Test
+ fun testMiaErrorSetter() {
+ val paymentId = "paymentId"
+ val checkoutUrl = "checkoutUrl"
+
+ val paymentInfo = MiAPaymentInfo(paymentId, checkoutUrl)
+
+ val paymentIdNew = "paymentIdNew"
+ val checkoutUrlNew = "checkoutUrlNew"
+ paymentInfo.paymentId = paymentIdNew
+ paymentInfo.checkoutUrl = checkoutUrlNew
+
+ assertEquals(paymentIdNew, paymentInfo.paymentId)
+ assertEquals(checkoutUrlNew, paymentInfo.checkoutUrl)
+
+ assertNotSame(paymentId, paymentInfo.paymentId)
+ assertNotSame(checkoutUrl, paymentInfo.checkoutUrl)
+ }
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/test/java/eu/nets/mia/data/MiaResultTest.kt b/MiA-SDK/mia/src/test/java/eu/nets/mia/data/MiaResultTest.kt
new file mode 100644
index 0000000..abbc843
--- /dev/null
+++ b/MiA-SDK/mia/src/test/java/eu/nets/mia/data/MiaResultTest.kt
@@ -0,0 +1,172 @@
+package eu.nets.mia.data
+
+import android.os.Parcel
+import junit.framework.TestCase.*
+import org.junit.Test
+import org.mockito.Mockito.`when`
+import org.mockito.Mockito.mock
+import java.lang.IllegalArgumentException
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+class MiAResultTest {
+
+ @Test
+ fun testConstructor_Primary_Success() {
+ val miaResult = MiAResult(MiAResultCode.RESULT_PAYMENT_COMPLETED)
+
+ assertEquals(MiAResultCode.RESULT_PAYMENT_COMPLETED, miaResult.miaResultCode)
+ assertNull(miaResult.miaError)
+ }
+
+ @Test
+ fun testConstructor_Primary_Error() {
+ val miaResult = MiAResult(MiAResultCode.RESULT_PAYMENT_FAILED)
+
+ assertEquals(MiAResultCode.RESULT_PAYMENT_FAILED, miaResult.miaResultCode)
+ assertNull(miaResult.miaError)
+ }
+
+ @Test
+ fun testConstructor_Primary_Canceled() {
+ val miaResult = MiAResult(MiAResultCode.RESULT_PAYMENT_CANCELLED)
+
+ assertEquals(MiAResultCode.RESULT_PAYMENT_CANCELLED, miaResult.miaResultCode)
+ assertNull(miaResult.miaError)
+ }
+
+ @Test
+ fun testConstructorSecondary() {
+ val miaResultErrorSDK = MiAResult(MiAError.MiASDKError)
+
+ assertEquals(MiAError.MiASDKError, miaResultErrorSDK.miaError)
+ assertEquals(MiAResultCode.RESULT_PAYMENT_FAILED, miaResultErrorSDK.miaResultCode)
+ }
+
+ @Test
+ fun testParcelableImplementation_Success_NoErrorCode() {
+ val miaResult = MiAResult(MiAResultCode.RESULT_PAYMENT_COMPLETED)
+ val parcel: Parcel = mock(Parcel::class.java)
+ `when`(parcel.readInt()).thenReturn(MiAResultCode.RESULT_PAYMENT_COMPLETED.result)
+ miaResult.writeToParcel(parcel, miaResult.describeContents())
+ parcel.setDataPosition(0)
+
+ val miaResultFromParcel = MiAResult.createFromParcel(parcel)
+
+ assertEquals(MiAResultCode.RESULT_PAYMENT_COMPLETED, miaResultFromParcel.miaResultCode)
+ assertNull(miaResult.miaError)
+ }
+
+
+ @Test
+ fun testParcelableImplementation_Error_NoErrorCode() {
+ val miaResult = MiAResult(MiAResultCode.RESULT_PAYMENT_FAILED)
+ val parcel: Parcel = mock(Parcel::class.java)
+ `when`(parcel.readInt()).thenReturn(MiAResultCode.RESULT_PAYMENT_FAILED.result)
+ miaResult.writeToParcel(parcel, miaResult.describeContents())
+ parcel.setDataPosition(0)
+
+ val miaResultFromParcel = MiAResult.createFromParcel(parcel)
+
+ assertEquals(MiAResultCode.RESULT_PAYMENT_FAILED, miaResultFromParcel.miaResultCode)
+ assertNull(miaResult.miaError)
+ }
+
+ @Test
+ fun testParcelableImplementation_Error_WithErrorCode() {
+ val miaResult = MiAResult(MiAError.MiASDKError)
+ val parcel: Parcel = mock(Parcel::class.java)
+ `when`(parcel.readInt()).thenReturn(MiAResultCode.RESULT_PAYMENT_FAILED.result)
+ `when`(parcel.readSerializable()).thenReturn(MiAError.MiASDKError)
+ miaResult.writeToParcel(parcel, miaResult.describeContents())
+ parcel.setDataPosition(0)
+
+ val miaResultFromParcel = MiAResult.createFromParcel(parcel)
+
+ assertEquals(MiAResultCode.RESULT_PAYMENT_FAILED, miaResultFromParcel.miaResultCode)
+ assertEquals(miaResultFromParcel.miaError, MiAError.MiASDKError)
+ }
+
+
+ @Test
+ fun testParcelableImplementation_Error_WithNullErrorCode() {
+ val miaResult = MiAResult(MiAError.MiASDKError)
+ val parcel: Parcel = mock(Parcel::class.java)
+ `when`(parcel.readInt()).thenReturn(MiAResultCode.RESULT_PAYMENT_FAILED.result)
+ `when`(parcel.readSerializable()).thenReturn(null)
+ miaResult.writeToParcel(parcel, miaResult.describeContents())
+ parcel.setDataPosition(0)
+
+ val miaResultFromParcel = MiAResult.createFromParcel(parcel)
+
+ assertEquals(MiAResultCode.RESULT_PAYMENT_FAILED, miaResultFromParcel.miaResultCode)
+ assertNull(miaResultFromParcel.miaError)
+ }
+
+ @Test
+ fun testParcelableImplementation_Error_WithInvalidErrorCode() {
+ val miaResult = MiAResult(MiAError.MiASDKError)
+ val parcel: Parcel = mock(Parcel::class.java)
+ `when`(parcel.readInt()).thenReturn(MiAResultCode.RESULT_PAYMENT_FAILED.result)
+ `when`(parcel.readSerializable()).thenReturn(1)//test integer in bundle instead of MiAError
+ miaResult.writeToParcel(parcel, miaResult.describeContents())
+ parcel.setDataPosition(0)
+
+ val miaResultFromParcel = MiAResult.createFromParcel(parcel)
+
+ assertEquals(MiAResultCode.RESULT_PAYMENT_FAILED, miaResultFromParcel.miaResultCode)
+ assertNull(miaResultFromParcel.miaError)
+ }
+
+ @Test
+ fun testParcelableImplementation_Array() {
+ val arrayOfNulls = MiAResult.newArray(3)
+
+ assertEquals(3, arrayOfNulls.size)
+ }
+
+ @Test
+ fun testMiaError_getErrorMessage() {
+ assertEquals(MiAError.MiASDKError.getErrorMessage(), "Something went wrong. Please try again.")
+ }
+
+ @Test
+ fun testMiaError_InheritedFunction() {
+ assertEquals(MiAError.MiASDKError, MiAError.values()[0])
+ assertEquals(MiAError.MiASDKError, MiAError.valueOf("MiASDKError"))
+ }
+
+ @Test(expected = IllegalArgumentException::class)
+ fun testMiaError_ValueOf() {
+ MiAError.valueOf("someError")
+ }
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/test/java/eu/nets/mia/webview/MiaActivityPresenterImplWrapper.kt b/MiA-SDK/mia/src/test/java/eu/nets/mia/webview/MiaActivityPresenterImplWrapper.kt
new file mode 100644
index 0000000..fde885c
--- /dev/null
+++ b/MiA-SDK/mia/src/test/java/eu/nets/mia/webview/MiaActivityPresenterImplWrapper.kt
@@ -0,0 +1,42 @@
+package eu.nets.mia.webview
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+open class MiAActivityPresenterImplWrapper(mView: MiAActivityView?) : MiAActivityPresenterImpl(mView) {
+
+ var baseView: MiAActivityView?
+ get() = miaActivityView
+ set(value) {
+ miaActivityView = value
+ }
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/test/java/eu/nets/mia/webview/MiaActivityPresenterTest.kt b/MiA-SDK/mia/src/test/java/eu/nets/mia/webview/MiaActivityPresenterTest.kt
new file mode 100644
index 0000000..a8cd01a
--- /dev/null
+++ b/MiA-SDK/mia/src/test/java/eu/nets/mia/webview/MiaActivityPresenterTest.kt
@@ -0,0 +1,105 @@
+package eu.nets.mia.webview
+
+import android.os.Bundle
+import junit.framework.TestCase.assertEquals
+import junit.framework.TestCase.assertNull
+import org.junit.Before
+import org.junit.Test
+import org.mockito.Mockito.*
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+class MiAActivityPresenterTest {
+
+ private lateinit var mView: MiAActivityView
+ private lateinit var mPresenter: MiAActivityPresenterImplWrapper
+
+ @Before
+ fun before() {
+ mView = mock(MiAActivityView::class.java)
+ mPresenter = spy(MiAActivityPresenterImplWrapper(mView))
+ }
+
+ @Test
+ fun testInit() {
+ val bundle = mock(Bundle::class.java)
+
+ val checkoutUrl = "checkoutUrl"
+ val paymentId = "paymentId"
+
+ `when`(mView.getPaymentId()).thenReturn(paymentId)
+ `when`(mView.getCheckoutUrl()).thenReturn(checkoutUrl)
+ mPresenter.baseView = mView
+
+ mPresenter.init(bundle)
+
+ verify(mView).initData(bundle)
+ verify(mPresenter).loadCheckoutPage()
+
+ verify(mView).loadWebViewData(paymentId, checkoutUrl)
+ }
+
+ @Test
+ fun testInit_NullView() {
+ val nullView: MiAActivityView? = null
+
+ val bundle = mock(Bundle::class.java)
+ mPresenter.baseView = nullView
+
+ mPresenter.init(bundle)
+
+ //if view is null, null value is returned; otherwise Unit is returned
+ assertNull(nullView?.initData(bundle))
+ assertNull(nullView?.getPaymentId())
+ assertNull(nullView?.getCheckoutUrl())
+ verify(mPresenter).loadCheckoutPage()
+ assertNull(nullView?.loadWebViewData(null, null))
+ }
+
+ @Test
+ fun testOnResume() {
+ val newView = mock(MiAActivityView::class.java)
+ mPresenter.baseView = mView
+ mPresenter.onResume(newView)
+
+ assertEquals(newView, mPresenter.baseView)
+ }
+
+ @Test
+ fun testOnStop() {
+ mPresenter.baseView = mView
+ mPresenter.onStop()
+
+ assertNull(mPresenter.baseView)
+ }
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/test/java/eu/nets/mia/webview/base/BaseWebViewPresenterImplWrapper.kt b/MiA-SDK/mia/src/test/java/eu/nets/mia/webview/base/BaseWebViewPresenterImplWrapper.kt
new file mode 100644
index 0000000..54da6a5
--- /dev/null
+++ b/MiA-SDK/mia/src/test/java/eu/nets/mia/webview/base/BaseWebViewPresenterImplWrapper.kt
@@ -0,0 +1,69 @@
+package eu.nets.mia.webview.base
+
+import android.webkit.WebView
+import android.webkit.WebViewClient
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+open class BaseWebViewPresenterImplWrapper(mView: BaseWebView?) : BaseWebViewPresenterImpl(mView) {
+
+ var baseView: BaseWebView?
+ get() = mView
+ set(value) {
+ mView = value
+ }
+
+ var mParentWebview: WebView?
+ get() = parentWebView
+ set(value) {
+ parentWebView = value
+ }
+ var childList: ArrayList
+ get() = childWebViewList
+ set(value) {
+ childWebViewList = value
+ }
+
+ var parentWebClient: WebViewClient
+ get() = parentWebViewClient
+ set(value) {
+ parentWebViewClient = value
+ }
+
+ var childWebClient: WebViewClient
+ get() = childWebViewClient
+ set(value) {
+ childWebViewClient = value
+ }
+ val onlinePDFView = pdfViewerUrl
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/src/test/java/eu/nets/mia/webview/base/BaseWebViewPresenterTest.kt b/MiA-SDK/mia/src/test/java/eu/nets/mia/webview/base/BaseWebViewPresenterTest.kt
new file mode 100644
index 0000000..4916204
--- /dev/null
+++ b/MiA-SDK/mia/src/test/java/eu/nets/mia/webview/base/BaseWebViewPresenterTest.kt
@@ -0,0 +1,966 @@
+package eu.nets.mia.webview.base
+
+import android.graphics.Bitmap
+import android.net.Uri
+import android.os.Bundle
+import android.webkit.WebResourceRequest
+import android.webkit.WebView
+import android.widget.FrameLayout
+import junit.framework.TestCase.*
+import org.junit.Before
+import org.junit.Test
+import org.mockito.ArgumentMatchers
+import org.mockito.Mockito.*
+
+
+/**
+ *****Copyright (c) 2020 Nets Denmark A/S*****
+ *
+ * NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+ * IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+ * IN THIS LICENSE AGREEMENT.
+ * BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+ * IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+ * YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+ * OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+ *
+ * Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+ * Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+ *
+ * No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+ *
+ * Permission is hereby granted, 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.
+ *
+ * Software may only be used for commercial or production purpose together with
+ * Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+ *
+ * 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.
+ */
+class BaseWebViewPresenterTest {
+
+ private lateinit var mView: BaseWebView
+ private lateinit var mPresenter: BaseWebViewPresenterImplWrapper
+
+ @Before
+ fun before() {
+ mView = mock(BaseWebView::class.java)
+ mPresenter = spy(BaseWebViewPresenterImplWrapper(mView))
+ }
+
+ @Test
+ fun testOnCreate() {
+ val expected = false
+
+ val bundle = mock(Bundle::class.java)
+
+ mPresenter.baseView = mView
+
+ mPresenter.onCreate(bundle)
+
+ verify(mView).init(bundle)
+ verify(mPresenter).enableBackNavigation(expected)
+ verify(mPresenter).enableForwardNavigation(expected)
+ }
+
+ @Test
+ fun testOnCreate_NullView() {
+ val expected = false
+
+ val bundle = mock(Bundle::class.java)
+ val nullView: BaseWebView? = null
+
+ mPresenter.baseView = nullView
+
+ mPresenter.onCreate(bundle)
+
+ //if view is null, null value is returned; otherwise Unit is returned
+ assertNull(nullView?.init(bundle))
+ verify(mPresenter).enableBackNavigation(expected)
+ verify(mPresenter).enableForwardNavigation(expected)
+ }
+
+ @Test
+ fun testConfigureWebView() {
+ mPresenter.baseView = mView
+
+ val parentWebView = mock(WebView::class.java)
+
+ mPresenter.configureWebView(parentWebView)
+
+ verify(mPresenter).applyWebViewSettings(parentWebView)
+ }
+
+ @Test
+ fun testParentWebViewClient() {
+ mPresenter.baseView = mView
+
+ val childList = spy(ArrayList())
+
+ mPresenter.childList = childList
+
+ val url = "someUrl"
+ val popup = mock(WebView::class.java)
+ val request = mock(WebResourceRequest::class.java)
+ val uri = mock(Uri::class.java)
+ `when`(request.url).thenReturn(uri)
+ `when`(uri.toString()).thenReturn(url)
+
+ mPresenter.parentWebClient.shouldOverrideUrlLoading(popup, request)
+
+ assertEquals(url, request?.url.toString())
+
+ mPresenter.parentWebClient.onPageStarted(popup, url, mock(Bitmap::class.java))
+
+ verify(mView).showProgressView(true)
+
+ mPresenter.parentWebClient.onPageFinished(popup, url)
+ verify(mView).showProgressView(false)
+ verify(popup).loadUrl(any(String::class.java))
+
+ }
+
+ @Test
+ fun testParentWebViewClient_EasyHostedPage_PaymentSuccess() {
+ mPresenter.baseView = mView
+
+ val returnUrl = "http://returnUrl.com/success.php"
+ val paymentId = "somePaymentIdString"
+
+ val url = "$returnUrl?paymentId=$paymentId"
+
+
+ `when`(mView.getRedirectUrl()).thenReturn(returnUrl)
+ `when`(mView.getPaymentIdentifier()).thenReturn(paymentId)
+
+ val shouldOverride = mPresenter.handleShouldOverrideUrlLoading(url)
+
+ assertTrue(shouldOverride)
+ verify(mView).sendOKResult()
+ }
+
+ @Test
+ fun testParentWebViewClient_EasyHostedPage_NullRedirectUrl() {
+ mPresenter.baseView = mView
+
+ val returnUrl = "http://returnUrl.com/success.php"
+ val paymentId = "somePaymentIdString"
+
+ val url = "$returnUrl?paymentId=$paymentId"
+
+
+ `when`(mView.getRedirectUrl()).thenReturn(null)
+ `when`(mView.getPaymentIdentifier()).thenReturn(paymentId)
+
+ val shouldOverride = mPresenter.handleShouldOverrideUrlLoading(url)
+
+ assertFalse(shouldOverride)
+ verify(mView, times(0)).sendOKResult()
+ }
+
+ @Test
+ fun testParentWebViewClient_EasyHostedPage_NullUrl() {
+ mPresenter.baseView = mView
+
+ val shouldOverride = mPresenter.handleShouldOverrideUrlLoading(null)
+
+ assertFalse(shouldOverride)
+ verify(mView, times(0)).sendOKResult()
+ }
+
+ @Test
+ fun testParentWebViewClient_EasyHostedPage_RedirectToOtherPage() {
+ mPresenter.baseView = mView
+
+ val returnUrl = "http://returnUrl.com/success.php"
+ val paymentId = "somePaymentIdString"
+
+ val url = "http://someUrlThatLoadsAutomatically.com"
+
+
+ `when`(mView.getRedirectUrl()).thenReturn(returnUrl)
+ `when`(mView.getPaymentIdentifier()).thenReturn(paymentId)
+
+ val shouldOverride = mPresenter.handleShouldOverrideUrlLoading(url)
+
+ assertFalse(shouldOverride)
+ verify(mView, times(0)).sendOKResult()
+ }
+
+
+ @Test
+ fun testParentWebViewClient_NullValues() {
+ val nullView: BaseWebView? = null
+ mPresenter.baseView = nullView
+
+ val childList = spy(ArrayList())
+
+ mPresenter.childList = childList
+
+ val url = "someUrl"
+ val popup: WebView? = null
+ val request: WebResourceRequest? = null
+
+ mPresenter.parentWebClient.shouldOverrideUrlLoading(popup, request)
+
+ assertEquals("null", request?.url.toString())
+
+ mPresenter.parentWebClient.onPageStarted(popup, url, mock(Bitmap::class.java))
+
+ assertNull(nullView?.showProgressView(true))
+
+ mPresenter.parentWebClient.onPageFinished(popup, url)
+
+ assertNull(nullView?.showProgressView(false))
+ assertNull(popup?.loadUrl(any(String::class.java)))
+ }
+
+ @Test
+ fun testChildWebViewClient_ShouldOverrideUrl_Valid_RandomPage() {
+ mPresenter.baseView = mView
+
+ val url = "someUrl"
+ val popup = mock(WebView::class.java)
+ val request = mock(WebResourceRequest::class.java)
+ val uri = mock(Uri::class.java)
+ `when`(request.url).thenReturn(uri)
+ `when`(uri.toString()).thenReturn(url)
+
+ assertFalse(mPresenter.childWebClient.shouldOverrideUrlLoading(popup, request))
+ assertEquals(url, request?.url.toString())
+ }
+// Commenting out the below test cases since we are not using shouldOverrideUrlLoading()
+ /* @Test
+ fun testChildWebViewClient_ShouldOverrideUrl_Valid_PDF() {
+ mPresenter.baseView = mView
+
+ val url = "someUrl.pdf"
+ val popup = mock(WebView::class.java)
+ val request = mock(WebResourceRequest::class.java)
+ val uri = mock(Uri::class.java)
+ `when`(request.url).thenReturn(uri)
+ `when`(uri.toString()).thenReturn(url)
+
+ assertTrue(mPresenter.childWebClient.shouldOverrideUrlLoading(popup, request))
+ verify(popup).loadUrl("${mPresenter.onlinePDFView}${request?.url?.toString()}")
+ }
+
+ @Test
+ fun testChildWebViewClient_ShouldOverrideUrl_Invalid() {
+ mPresenter.baseView = mView
+
+ val url: String? = null
+ val popup = mock(WebView::class.java)
+ val request = mock(WebResourceRequest::class.java)
+ val uri = mock(Uri::class.java)
+ `when`(request.url).thenReturn(uri)
+ `when`(uri.toString()).thenReturn(url)
+
+ assertFalse(mPresenter.childWebClient.shouldOverrideUrlLoading(popup, request))
+ }
+
+ @Test
+ fun testChildWebViewClient_ShouldOverrideUrl_NullValues_PDF() {
+ mPresenter.baseView = mView
+
+ val popup: WebView? = null
+ val request: WebResourceRequest? = null
+
+ assertFalse(mPresenter.childWebClient.shouldOverrideUrlLoading(popup, request))
+ }
+
+ @Test
+ fun testChildWebViewClient_ShouldOverrideUrl_NullWebView_PDF() {
+ mPresenter.baseView = mView
+
+ val url = "someUrl.pdf"
+ val popup: WebView? = null
+ val request = mock(WebResourceRequest::class.java)
+ val uri = mock(Uri::class.java)
+ `when`(request.url).thenReturn(uri)
+ `when`(uri.toString()).thenReturn(url)
+
+ assertTrue(mPresenter.childWebClient.shouldOverrideUrlLoading(popup, request))
+ assertNull(popup?.loadUrl("${mPresenter.onlinePDFView}${request?.url?.toString()}"))
+ }
+*/
+ @Test
+ fun testChildWebViewClient_OnPageStarted() {
+ mPresenter.baseView = mView
+
+ val url = "someUrl"
+ val popup = mock(WebView::class.java)
+
+ mPresenter.childWebClient.onPageStarted(popup, url, mock(Bitmap::class.java))
+
+ verify(mView).showProgressView(true)
+ }
+
+ @Test
+ fun testChildWebViewClient_OnPageStarted_NullWebView() {
+ val nullView: BaseWebView? = null
+ mPresenter.baseView = nullView
+
+ val url = "someUrl"
+ val popup = mock(WebView::class.java)
+
+ mPresenter.childWebClient.onPageStarted(popup, url, mock(Bitmap::class.java))
+
+ assertNull(nullView?.showProgressView(true))
+ }
+
+ @Test
+ fun testChildWebViewClient_OnPageFinished() {
+ mPresenter.baseView = mView
+
+ val url = "someUrl"
+ val popup = mock(WebView::class.java)
+
+ mPresenter.childWebClient.onPageFinished(popup, url)
+
+ verify(mView).showProgressView(false)
+ verify(popup).loadUrl(any(String::class.java))
+ }
+
+
+ @Test
+ fun testChildWebViewClient_OnPageFinished_NullWebView() {
+ mPresenter.baseView = mView
+
+ val url = "someUrl"
+ val popup: WebView? = null
+
+ mPresenter.childWebClient.onPageFinished(popup, url)
+
+ assertNull(popup?.loadUrl(any(String::class.java)))
+ }
+
+ @Test
+ fun testChildWebViewClient_OnPageFinished_NullView() {
+ val nullView: BaseWebView? = null
+ mPresenter.baseView = nullView
+
+ val url = "someUrl"
+ val popup = mock(WebView::class.java)
+
+ mPresenter.childWebClient.onPageFinished(popup, url)
+
+ assertNull(nullView?.showProgressView(false))
+ }
+
+ @Test
+ fun testConfigureWebView_NullWebView() {
+ mPresenter.baseView = mView
+
+ mPresenter.configureWebView(null)
+
+ verify(mPresenter).applyWebViewSettings(null)
+ }
+
+ @Test
+ fun testCreateChildWebView_NullRoot() {
+ `when`(mView.getRootFrame()).thenReturn(null)
+ mPresenter.mView = mView
+
+ assertNull(mPresenter.createChildWebView())
+ }
+
+ @Test
+ fun testCreateChildWebView_NullView() {
+ val nullView: BaseWebView? = null
+ mPresenter.mView = null
+
+ `when`(mPresenter.applyWebViewSettings(null)).thenReturn(mock(WebView::class.java))
+ assertNull(mPresenter.createChildWebView())
+ assertNull(nullView?.getRootFrame())
+ }
+
+ @Test
+ fun testOnBackPressed_ParentWebView() {
+ mPresenter.mView = mView
+
+ val parentWebView = mock(WebView::class.java)
+ val childList = spy(ArrayList())
+
+ mPresenter.childList = childList
+ mPresenter.mParentWebview = parentWebView
+
+ mPresenter.onBackPressed()
+
+ verify(mPresenter).removeLatestWebView()
+ verify(mView).showProgressView(false)
+ verify(mPresenter).handleNavBarActionIcon(ArgumentMatchers.any(Int::class.java))
+ verify(mPresenter).notifyNavigationEnabled()
+ }
+
+ @Test
+ fun testOnBackPressed_ParentWebView_NullView() {
+ val nullView: BaseWebView? = null
+ mPresenter.mView = nullView
+
+ val parentWebView = mock(WebView::class.java)
+ val childList = spy(ArrayList())
+
+ mPresenter.childList = childList
+ mPresenter.mParentWebview = parentWebView
+
+ mPresenter.onBackPressed()
+
+ verify(mPresenter).removeLatestWebView()
+ //if view is null, null value is returned; otherwise Unit is returned
+ assertNull(nullView?.showProgressView(false))
+ verify(mPresenter).handleNavBarActionIcon(ArgumentMatchers.any(Int::class.java))
+ verify(mPresenter).notifyNavigationEnabled()
+ }
+
+ @Test
+ fun testOnBackPressed_ChildWebView() {
+ mPresenter.mView = mView
+
+ val parentWebView = mock(WebView::class.java)
+ val childWebView = mock(WebView::class.java)
+ val childList = spy(ArrayList())
+ childList.add(childWebView)
+
+ val rootFrame = mock(FrameLayout::class.java)
+ `when`(mView.getRootFrame()).thenReturn(rootFrame)
+
+ mPresenter.childList = childList
+ mPresenter.mParentWebview = parentWebView
+
+ mPresenter.onBackPressed()
+
+ verify(mPresenter).removeLatestWebView()
+ verify(mView).showProgressView(false)
+ verify(rootFrame).removeView(childWebView)
+ verify(childWebView).destroy()
+ verify(childList).remove(childWebView)
+ verify(mPresenter).handleNavBarActionIcon(ArgumentMatchers.any(Int::class.java))
+ verify(mPresenter).notifyNavigationEnabled()
+ }
+
+ @Test
+ fun testOnBackPressed_ChildWebView_NullView() {
+ val nullView: BaseWebView? = null
+ mPresenter.mView = nullView
+
+ val parentWebView = mock(WebView::class.java)
+ val childWebView = mock(WebView::class.java)
+ val childList = spy(ArrayList())
+ childList.add(childWebView)
+
+
+ mPresenter.childList = childList
+ mPresenter.mParentWebview = parentWebView
+
+ mPresenter.onBackPressed()
+
+ verify(mPresenter).removeLatestWebView()
+ //if view is null, null value is returned; otherwise Unit is returned
+ assertNull(nullView?.showProgressView(false))
+ assertNull(nullView?.getRootFrame()?.removeView(childWebView))
+ verify(childWebView).destroy()
+ verify(childList).remove(childWebView)
+ verify(mPresenter).handleNavBarActionIcon(ArgumentMatchers.any(Int::class.java))
+ verify(mPresenter).notifyNavigationEnabled()
+ }
+
+ @Test
+ fun testOnNavigateBack_ParentWebView_CanNavigate() {
+ mPresenter.mView = mView
+
+ val childList = spy(ArrayList())
+ val parentWebView = mock(WebView::class.java)
+
+ `when`(parentWebView.canGoBack()).thenReturn(true)
+
+ mPresenter.mParentWebview = parentWebView
+ mPresenter.childList = childList
+
+ mPresenter.onNavigateBack()
+
+ verify(parentWebView).goBack()
+ }
+
+ @Test
+ fun testOnNavigateBack_ParentWebView_CannotNavigate() {
+ mPresenter.mView = mView
+
+ val childList = spy(ArrayList())
+ val parentWebView = mock(WebView::class.java)
+
+ `when`(parentWebView.canGoBack()).thenReturn(false)
+
+ mPresenter.mParentWebview = parentWebView
+ mPresenter.childList = childList
+
+ mPresenter.onNavigateBack()
+
+ verify(parentWebView, times(0)).goBack()
+ }
+
+ @Test
+ fun testOnNavigateBack_ChildWebView_CanNavigate() {
+ mPresenter.mView = mView
+
+ val childList = spy(ArrayList())
+ val childWebView = mock(WebView::class.java)
+
+ `when`(childWebView.canGoBack()).thenReturn(true)
+
+ childList.add(childWebView)
+ mPresenter.childList = childList
+
+ mPresenter.onNavigateBack()
+
+ verify(childWebView).goBack()
+ }
+
+ @Test
+ fun testOnNavigateBack_ChildWebView_CannotNavigate() {
+ mPresenter.mView = mView
+
+ val childList = spy(ArrayList())
+ val childWebView = mock(WebView::class.java)
+
+ `when`(childWebView.canGoBack()).thenReturn(false)
+
+ childList.add(childWebView)
+ mPresenter.childList = childList
+
+ mPresenter.onNavigateBack()
+
+ verify(childWebView, times(0)).goBack()
+ }
+
+ @Test
+ fun testOnNavigateForward_ParentWebView_CanNavigate() {
+ mPresenter.mView = mView
+
+ val childList = spy(ArrayList())
+ val parentWebView = mock(WebView::class.java)
+
+ `when`(parentWebView.canGoForward()).thenReturn(true)
+
+ mPresenter.mParentWebview = parentWebView
+ mPresenter.childList = childList
+
+ mPresenter.onNavigateForward()
+
+ verify(parentWebView).goForward()
+ }
+
+ @Test
+ fun testOnNavigateForward_ParentWebView_CannotNavigate() {
+ mPresenter.mView = mView
+
+ val childList = spy(ArrayList())
+ val parentWebView = mock(WebView::class.java)
+
+ `when`(parentWebView.canGoForward()).thenReturn(false)
+
+ mPresenter.mParentWebview = parentWebView
+ mPresenter.childList = childList
+
+ mPresenter.onNavigateForward()
+
+ verify(parentWebView, times(0)).goForward()
+ }
+
+ @Test
+ fun testOnNavigateForward_NullParentWebView() {
+ mPresenter.mView = mView
+
+ val childList = spy(ArrayList())
+ val parentWebView: WebView? = null
+
+ mPresenter.mParentWebview = parentWebView
+ mPresenter.childList = childList
+
+ mPresenter.onNavigateForward()
+
+ assertFalse(parentWebView?.canGoForward() == true)
+ }
+
+ @Test
+ fun testOnNavigateForward_ChildWebView_CanNavigate() {
+ mPresenter.mView = mView
+
+ val childList = spy(ArrayList())
+ val childWebView = mock(WebView::class.java)
+
+ `when`(childWebView.canGoForward()).thenReturn(true)
+
+ childList.add(childWebView)
+ mPresenter.childList = childList
+
+ mPresenter.onNavigateForward()
+
+ verify(childWebView).goForward()
+ }
+
+ @Test
+ fun testOnNavigateForward_ChildWebView_CannotNavigate() {
+ mPresenter.mView = mView
+
+ val childList = spy(ArrayList())
+ val childWebView = mock(WebView::class.java)
+
+ `when`(childWebView.canGoForward()).thenReturn(false)
+
+ childList.add(childWebView)
+ mPresenter.childList = childList
+
+ mPresenter.onNavigateForward()
+
+ verify(childWebView, times(0)).goForward()
+ }
+
+ @Test
+ fun testEnableBackNavigation_Enable() {
+ val expected = true
+
+ mPresenter.mView = mView
+
+ mPresenter.enableBackNavigation(expected)
+
+ verify(mView).enableBackNavigation(expected)
+ }
+
+ @Test
+ fun testEnableBackNavigation_Enable_NullView() {
+ val expected = false
+
+ val baseView: BaseWebView? = null
+ mPresenter.mView = baseView
+
+ mPresenter.enableBackNavigation(expected)
+
+ verify(mView, times(0)).enableBackNavigation(expected)
+ }
+
+ @Test
+ fun testEnableBackNavigation_Disable() {
+ val expected = false
+
+ mPresenter.mView = mView
+
+ mPresenter.enableBackNavigation(expected)
+
+ verify(mView).enableBackNavigation(expected)
+ }
+
+ @Test
+ fun testEnableBackNavigation_Disable_NullView() {
+ val expected = false
+
+ val baseView: BaseWebView? = null
+ mPresenter.mView = baseView
+
+ mPresenter.enableBackNavigation(expected)
+
+ verify(mView, times(0)).enableBackNavigation(expected)
+ }
+
+ @Test
+ fun testEnableForwardNavigation_Enable() {
+ val expected = true
+
+ mPresenter.mView = mView
+
+ mPresenter.enableForwardNavigation(expected)
+
+ verify(mView).enableForwardNavigation(expected)
+ }
+
+ @Test
+ fun testEnableForwardNavigation_Enable_NullView() {
+ val expected = true
+
+ val baseView: BaseWebView? = null
+ mPresenter.mView = baseView
+
+ mPresenter.enableForwardNavigation(expected)
+
+ verify(mView, times(0)).enableForwardNavigation(expected)
+ }
+
+ @Test
+ fun testEnableForwardNavigation_Disable() {
+ val expected = false
+
+ mPresenter.mView = mView
+
+ mPresenter.enableForwardNavigation(expected)
+
+ verify(mView).enableForwardNavigation(expected)
+ }
+
+ @Test
+ fun testEnableForwardNavigation_Disable_NullView() {
+ val expected = false
+
+ val baseView: BaseWebView? = null
+ mPresenter.mView = baseView
+
+ mPresenter.enableForwardNavigation(expected)
+
+ verify(mView, times(0)).enableForwardNavigation(expected)
+ }
+
+ @Test
+ fun testGetLatestWebView_NullChild() {
+ val childList = spy(ArrayList())
+ mPresenter.childList = childList
+
+ assertNull(mPresenter.getLatestWebView())
+ }
+
+ @Test
+ fun testGetLatestWebView_ValidChild() {
+ val childList = spy(ArrayList())
+ val childWebView = mock(WebView::class.java)
+ childList.add(childWebView)
+ mPresenter.childList = childList
+
+ assertEquals(childWebView, mPresenter.getLatestWebView())
+ }
+
+ @Test
+ fun testPauseTimers() {
+ val parentWebView = mock(WebView::class.java)
+ mPresenter.mParentWebview = parentWebView
+
+ mPresenter.pauseTimers()
+
+ verify(parentWebView).pauseTimers()
+ }
+
+ @Test
+ fun testPauseTimers_NullParent() {
+ val parentWebView = mock(WebView::class.java)
+ mPresenter.mParentWebview = null
+
+ mPresenter.pauseTimers()
+
+ verify(parentWebView, times(0)).pauseTimers()
+ }
+
+ @Test
+ fun testResumeTimers() {
+ val parentWebView = mock(WebView::class.java)
+ mPresenter.mParentWebview = parentWebView
+
+ mPresenter.resumeTimers()
+
+ verify(parentWebView).resumeTimers()
+ }
+
+ @Test
+ fun testResumeTimers_NullParent() {
+ val parentWebView = mock(WebView::class.java)
+ mPresenter.mParentWebview = null
+
+ mPresenter.resumeTimers()
+
+ verify(parentWebView, times(0)).resumeTimers()
+ }
+
+
+ @Test
+ fun testNotifyNavigationEnabled_ChildWebView_CanNavigate() {
+
+ val expected = true
+
+ mPresenter.baseView = mView
+
+ val childWebView = mock(WebView::class.java)
+ val childList = spy(ArrayList())
+ childList.add(childWebView)
+ `when`(childWebView.canGoForward()).thenReturn(expected)
+ `when`(childWebView.canGoBack()).thenReturn(expected)
+ mPresenter.childList = childList
+
+ mPresenter.notifyNavigationEnabled()
+
+ verify(mPresenter).enableBackNavigation(expected)
+ verify(mPresenter).enableForwardNavigation(expected)
+ }
+
+ @Test
+ fun testNotifyNavigationEnabled_ChildWebView_CannotNavigate() {
+
+ val expected = false
+
+ mPresenter.baseView = mView
+
+ val childWebView = mock(WebView::class.java)
+ val childList = spy(ArrayList())
+ childList.add(childWebView)
+ `when`(childWebView.canGoForward()).thenReturn(expected)
+ `when`(childWebView.canGoBack()).thenReturn(expected)
+ mPresenter.childList = childList
+
+ mPresenter.notifyNavigationEnabled()
+
+ verify(mPresenter).enableBackNavigation(expected)
+ verify(mPresenter).enableForwardNavigation(expected)
+ }
+
+ @Test
+ fun testNotifyNavigationEnabled_ParentWebView() {
+
+ val expected = false
+
+ mPresenter.baseView = mView
+
+ val childList = spy(ArrayList())
+ mPresenter.childList = childList
+
+ mPresenter.notifyNavigationEnabled()
+
+ verify(mPresenter).enableBackNavigation(expected)
+ verify(mPresenter).enableForwardNavigation(expected)
+ }
+
+ @Test
+ fun testRemoveLatestWebView_MultipleChilds() {
+ `when`(mView.getRootFrame()).thenReturn(null)
+ mPresenter.baseView = mView
+
+ val child1 = mock(WebView::class.java)
+ val child2 = mock(WebView::class.java)
+ val childList = spy(ArrayList())
+ childList.add(child1)
+ childList.add(child2)
+ mPresenter.childList = childList
+
+ mPresenter.removeLatestWebView()
+
+ assertNull(mView.getRootFrame()?.removeView(child2))
+ verify(mPresenter, times(0)).handleNavBarActionIcon(any(Int::class.java))
+ }
+
+ @Test
+ fun testOnPageFinished_NoError() {
+ mPresenter.baseView = mView
+
+ val urlLoaded = "http://someUrl.com"
+
+ mPresenter.handlePageFinished(urlLoaded)
+
+ verify(mView, times(0)).sendCancelResult()
+ }
+
+ @Test
+ fun testOnPageFinished_UserNotAuthenticated() {
+ mPresenter.baseView = mView
+
+ val urlLoaded = "http://someUrl.com?authenticated=false"
+
+ mPresenter.handlePageFinished(urlLoaded)
+
+ verify(mView, times(0)).sendCancelResult()
+
+ mPresenter.handlePageFinished(urlLoaded)
+
+ verify(mView).sendCancelResult()
+ }
+
+ @Test
+ fun testOnPageFinished_NullView() {
+ val nullView: BaseWebView? = null
+ mPresenter.baseView = nullView
+
+ val urlLoaded = "http://someUrl.com?authenticated=false"
+
+ mPresenter.handlePageFinished(urlLoaded)
+
+ verify(mView, times(0)).sendCancelResult()
+
+ mPresenter.handlePageFinished(urlLoaded)
+
+ assertNull(nullView?.sendCancelResult())
+ }
+
+ @Test
+ fun testOnPageFinished_NullUrl() {
+ mPresenter.baseView = mView
+
+ var urlLoaded: String? = null
+
+ mPresenter.handlePageFinished(urlLoaded)
+
+ verify(mView, times(0)).sendCancelResult()
+
+ urlLoaded = "http://someUrl.com?authenticated=false"
+
+ mPresenter.handlePageFinished(urlLoaded)
+
+ verify(mView, times(0)).sendCancelResult()
+ }
+
+ @Test
+ fun testHandleNavBarActionText() {
+ mPresenter.baseView = mView
+ val resId = 100
+ mPresenter.handleNavBarActionIcon(resId)
+
+ verify(mView).handleNavBarActionText(resId)
+ }
+
+ @Test
+ fun testOnResume() {
+ mPresenter.baseView = mView
+
+ val newView = mock(BaseWebView::class.java)
+
+ mPresenter.onResume(newView)
+ assertEquals(newView, mPresenter.baseView)
+ verify(mPresenter).resumeTimers()
+ }
+
+ @Test
+ fun testOnStop() {
+ mPresenter.baseView = mView
+
+ mPresenter.onStop()
+
+ assertNull(mPresenter.baseView)
+ }
+
+ @Test
+ fun testOnPause() {
+ mPresenter.baseView = mView
+
+ mPresenter.onPause()
+
+ verify(mPresenter).pauseTimers()
+ }
+
+ @Test
+ fun testOnPaymentCompleted() {
+ mPresenter.baseView = mView
+
+ mPresenter.onPaymentCompleted()
+
+ verify(mView).sendOKResult()
+ }
+
+ @Test
+ fun testOnPaymentCompleted_NullView() {
+ val view: BaseWebView? = null
+ mPresenter.baseView = view
+
+ mPresenter.onPaymentCompleted()
+
+ assertNull(view?.sendOKResult())
+ }
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/util_closures.gradle b/MiA-SDK/mia/util_closures.gradle
new file mode 100644
index 0000000..83af76b
--- /dev/null
+++ b/MiA-SDK/mia/util_closures.gradle
@@ -0,0 +1,44 @@
+ext.getRepoType = {
+ project.hasProperty(REPO_TYPE_PARAMETER) ? project.property(REPO_TYPE_PARAMETER) : DEFAULT_REPO_TYPE_RELEASE
+}
+
+ext.getBuildType = {
+ def repoType = getRepoType()
+ def buildTypeArray
+ if (project.hasProperty(BUILD_TYPE_PARAMETER)) {
+ buildTypeArray = new String[1]
+ buildTypeArray[0] = project.property(BUILD_TYPE_PARAMETER)
+ } else {
+ if (repoType == REPO_TYPE_SNAPSHOT) {
+ buildTypeArray = [BUILD_TYPE_DEBUG, BUILD_TYPE_RELEASE]
+ } else {
+ buildTypeArray = [BUILD_TYPE_RELEASE]
+ }
+ }
+ buildTypeArray
+}
+
+ext.getSDKVersion = {
+ def repoType = getRepoType()
+ VERSION_NAME + (repoType == REPO_TYPE_SNAPSHOT ? SNAPSHOT_POSTFIX : "")
+}
+
+ext.getArtifactId = { buildType ->
+ buildType == BUILD_TYPE_RELEASE ? ARTIFACT : "$ARTIFACT-$buildType"
+}
+
+ext.getOutputFileName = { buildType ->
+ "${getArtifactId(buildType)}-${getSDKVersion()}.aar"
+}
+
+ext.getPomFileName = { buildType ->
+ "pom-${buildType}.xml"
+}
+
+/**
+ * Returns if the SDK Source code should be included into release package.
+ */
+ext.shouldIncludeSDKSourceCode = {
+ def includeSDKSourceCode = project.hasProperty(INCLUDE_SDK_SOURCE_CODE_PARAMETER) ? project.property(INCLUDE_SDK_SOURCE_CODE_PARAMETER) : INCLUDE_SDK_SOURCE_CODE_NO
+ includeSDKSourceCode == INCLUDE_SDK_SOURCE_CODE_YES
+}
\ No newline at end of file
diff --git a/MiA-SDK/mia/util_tasks.gradle b/MiA-SDK/mia/util_tasks.gradle
new file mode 100644
index 0000000..5abadff
--- /dev/null
+++ b/MiA-SDK/mia/util_tasks.gradle
@@ -0,0 +1,25 @@
+def PROPERTY_FILE_PATH_PARAMETER = "propFilePath"
+def PROPERTY_FILE_NAME_PARAMETER = "propFileName"
+
+task addVersionNameToFile {
+ doLast {
+ if (project.hasProperty(PROPERTY_FILE_PATH_PARAMETER) && project.hasProperty(PROPERTY_FILE_NAME_PARAMETER)) {
+ def path = project.property(PROPERTY_FILE_PATH_PARAMETER)
+ def filename = project.property(PROPERTY_FILE_NAME_PARAMETER)
+
+ File rootFolder = new File(path)
+ if (!rootFolder.exists()) {
+ rootFolder.mkdirs()
+ }
+
+ Properties props = new Properties()
+ File propsFile = new File(rootFolder, filename)
+ if (!propsFile.exists()) {
+ propsFile.createNewFile()
+ }
+ props.load(propsFile.newDataInputStream())
+ props.setProperty('sdkVersionName', VERSION_NAME)
+ props.store(propsFile.newWriter(), null)
+ }
+ }
+}
\ No newline at end of file
diff --git a/MiA-SDK/plantuml.jar b/MiA-SDK/plantuml.jar
new file mode 100644
index 0000000..630b011
Binary files /dev/null and b/MiA-SDK/plantuml.jar differ
diff --git a/MiA-SDK/settings.gradle b/MiA-SDK/settings.gradle
new file mode 100644
index 0000000..2d23a18
--- /dev/null
+++ b/MiA-SDK/settings.gradle
@@ -0,0 +1 @@
+include ':mia'
diff --git a/MiaSample/app/build.gradle b/MiaSample/app/build.gradle
index a72f056..443522e 100644
--- a/MiaSample/app/build.gradle
+++ b/MiaSample/app/build.gradle
@@ -60,7 +60,7 @@ dependencies {
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'org.nanohttpd:nanohttpd:2.3.1'
- implementation('eu.nets.mia:mia-sdk:1.2.1@aar') { transitive = true; changing=true; }
+ implementation('eu.nets.mia:mia-sdk:1.3.0@aar') { transitive = true; changing=true; }
}
apply plugin: 'com.google.gms.google-services'
diff --git a/MiaSample/app/gradle.properties b/MiaSample/app/gradle.properties
index 9c131db..95b4201 100644
--- a/MiaSample/app/gradle.properties
+++ b/MiaSample/app/gradle.properties
@@ -1,11 +1,11 @@
-#Tue Jun 02 08:47:08 EEST 2020
+#Tue Feb 02 16:00:02 EET 2021
PROD_BASE_URL="https\://api.dibspayment.eu/"
-VERSION_NAME=1.2.1
+VERSION_NAME=1.3.0
TEST_CHECKOUT_JS="https\://test.checkout.dibspayment.eu/v1/checkout.js?v\=1"
-VERSION_CODE=26
+VERSION_CODE=29
PROD_CHECKOUT_KEY = "YOUR PROD CHECKOUT KEY HERE"
TEST_CHECKOUT_KEY ="YOUR TEST CHECKOUT KEY HERE"
PROD_CHECKOUT_JS="https\://checkout.dibspayment.eu/v1/checkout.js?v\=1"
TEST_SECRET_KEY = "YOUR TEST SECRET KEY HERE"
-TEST_BASE_URL="https\://test.api.dibspayment.eu/"
PROD_SECRET_KEY = "YOUR PROD SECRET KEY HERE"
+TEST_BASE_URL="https\://test.api.dibspayment.eu/"
diff --git a/MiaSample/app/src/main/java/eu/nets/miasample/activity/MainActivity.kt b/MiaSample/app/src/main/java/eu/nets/miasample/activity/MainActivity.kt
index 9865aae..4823fde 100644
--- a/MiaSample/app/src/main/java/eu/nets/miasample/activity/MainActivity.kt
+++ b/MiaSample/app/src/main/java/eu/nets/miasample/activity/MainActivity.kt
@@ -72,6 +72,14 @@ class MainActivity : AppCompatActivity(), MainActivityView {
//end
//easy hosted payment window helper constants
const val RETURN_URL = "http://localhost/redirect.php"
+
+ // Cancellation URL passed to EASY and the SDK to indentify
+ // user cancellation by using the "Go back" link rendered
+ // in the checkout webview.
+ // Note: Pass the same `cancelURL` for
+ // payment registration with Easy API and
+ // when presenting Mia SDK following payment registration.
+ const val CANCEL_URL = "https://cancellation-identifier-url"
const val INTEGRATION_TYPE_PARAM = "HostedPaymentPage"
const val CONSUMER_DATA_NONE = "None"
@@ -342,13 +350,14 @@ class MainActivity : AppCompatActivity(), MainActivityView {
* @param paymentId the paymentId received in registerPayment API call
* @param checkoutUrl the checkout page url sent in the register payment API call
* @param returnUrl the return url of success case when Integration Type is Easy Hosted Checkout
+ * @param cancelUrl the url that you would want to redirect to in case of cancel.
*/
- override fun launchEasySDK(paymentId: String?, checkoutUrl: String?, returnUrl: String?) {
+ override fun launchEasySDK(paymentId: String?, checkoutUrl: String?, returnUrl: String?, cancelUrl: String?) {
if (paymentId == null || checkoutUrl == null) {
showAlert(getString(R.string.error_title), getString(R.string.error_message))
return
} else if (validateAmount()) {
- MiASDK.getInstance().startSDK(this, MiAPaymentInfo(paymentId, checkoutUrl, returnUrl))
+ MiASDK.getInstance().startSDK(this, MiAPaymentInfo(paymentId, checkoutUrl, returnUrl, cancelUrl))
}
}
diff --git a/MiaSample/app/src/main/java/eu/nets/miasample/activity/MainActivityPresenterImpl.kt b/MiaSample/app/src/main/java/eu/nets/miasample/activity/MainActivityPresenterImpl.kt
index 031dc44..923e180 100644
--- a/MiaSample/app/src/main/java/eu/nets/miasample/activity/MainActivityPresenterImpl.kt
+++ b/MiaSample/app/src/main/java/eu/nets/miasample/activity/MainActivityPresenterImpl.kt
@@ -5,18 +5,22 @@ import android.util.Patterns
import android.view.View
import android.widget.TextView
import eu.nets.miasample.R
+import eu.nets.miasample.activity.MainActivity.Companion.CANCEL_URL
import eu.nets.miasample.activity.MainActivity.Companion.CONSUMER_DATA_MERCHANT_INJECTED
import eu.nets.miasample.activity.MainActivity.Companion.CONSUMER_DATA_NONE
import eu.nets.miasample.activity.MainActivity.Companion.CONSUMER_DATA_NO_SHIPPING_ADDR
import eu.nets.miasample.network.APIManager
import eu.nets.miasample.network.callback.HttpResponse
import eu.nets.miasample.network.request.*
+import eu.nets.miasample.network.response.ChargePaymentResponse
+import eu.nets.miasample.network.response.HttpError
+import eu.nets.miasample.network.response.PaymentResponse
+import eu.nets.miasample.network.response.RegisterPaymentResponse
import eu.nets.miasample.utils.SampleHtmlProvider
import eu.nets.miasample.utils.SampleLocalHost
import eu.nets.miasample.utils.SharedPrefs
import java.util.*
import kotlin.collections.ArrayList
-import eu.nets.miasample.network.response.*
/**
@@ -89,11 +93,11 @@ class MainActivityPresenterImpl(private var mView: MainActivityView?) : MainActi
when (SharedPrefs.getInstance().integrationType) {
MainActivity.MERCHANT_HOSTED_PAYMENT_WINDOW -> {
//is merchant hosted payment window - do not send return url
- mView?.launchEasySDK(mPaymentId, mCheckoutUrl, null)
+ mView?.launchEasySDK(mPaymentId, mCheckoutUrl, null, MainActivity.CANCEL_URL)
}
MainActivity.EASY_HOSTED_PAYMENT_WINDOW -> {
//is easy hosted payment window - send the return url
- mView?.launchEasySDK(mPaymentId, response?.hostedPaymentPageUrl, MainActivity.RETURN_URL)
+ mView?.launchEasySDK(mPaymentId, response?.hostedPaymentPageUrl, MainActivity.RETURN_URL, MainActivity.CANCEL_URL)
}
else -> {
//to be continued on future integration types
@@ -104,8 +108,10 @@ class MainActivityPresenterImpl(private var mView: MainActivityView?) : MainActi
override fun onError(code: Int, error: HttpError) {
mView?.showLoader(false)
if (error.errors == null) {
- mView?.showAlert("${error.code ?: code}: ${error.source
- ?: getContext().getString(R.string.error_title)}",
+ mView?.showAlert("${error.code ?: code}: ${
+ error.source
+ ?: getContext().getString(R.string.error_title)
+ }",
error.message ?: getContext().getString(R.string.error_message))
} else {
mView?.showAlert(getContext().getString(R.string.error_title), error.parseErrors())
@@ -168,8 +174,10 @@ class MainActivityPresenterImpl(private var mView: MainActivityView?) : MainActi
override fun onError(code: Int, error: HttpError) {
mView?.showLoader(false)
if (error.errors == null) {
- mView?.showAlert("${error.code ?: code}: ${error.source
- ?: getContext().getString(R.string.error_title)}",
+ mView?.showAlert("${error.code ?: code}: ${
+ error.source
+ ?: getContext().getString(R.string.error_title)
+ }",
error.message ?: getContext().getString(R.string.error_message))
} else {
mView?.showAlert(getContext().getString(R.string.error_message), error.parseErrors())
@@ -197,8 +205,10 @@ class MainActivityPresenterImpl(private var mView: MainActivityView?) : MainActi
override fun onError(code: Int, error: HttpError) {
mView?.showLoader(false)
if (error.errors == null) {
- mView?.showAlert("${error.code ?: code}: ${error.source
- ?: getContext().getString(R.string.error_title)}",
+ mView?.showAlert("${error.code ?: code}: ${
+ error.source
+ ?: getContext().getString(R.string.error_title)
+ }",
error.message ?: getContext().getString(R.string.error_message))
} else {
mView?.showAlert(getContext().getString(R.string.error_message), error.parseErrors())
@@ -273,6 +283,7 @@ class MainActivityPresenterImpl(private var mView: MainActivityView?) : MainActi
*/
checkout.integrationType = MainActivity.INTEGRATION_TYPE_PARAM
checkout.returnURL = MainActivity.RETURN_URL
+ checkout.cancelUrl = MainActivity.CANCEL_URL
}
else -> {//to be continued for future integration types
}
diff --git a/MiaSample/app/src/main/java/eu/nets/miasample/activity/MainActivityView.kt b/MiaSample/app/src/main/java/eu/nets/miasample/activity/MainActivityView.kt
index 1b8ea10..7c0ba88 100644
--- a/MiaSample/app/src/main/java/eu/nets/miasample/activity/MainActivityView.kt
+++ b/MiaSample/app/src/main/java/eu/nets/miasample/activity/MainActivityView.kt
@@ -38,10 +38,10 @@ interface MainActivityView {
* @param paymentId the paymentId received in registerPayment API call
* @param checkoutUrl the checkout page url sent in the register payment API call
* @param returnUrl the return url of success case when Integration Type is Easy Hosted Checkout
- * @param isSubscription Checks if the call is for subscription
+ * @param cancelUrl the url that you would want to redirect to in case of cancel.
*/
- fun launchEasySDK(paymentId: String?, checkoutUrl: String?, returnUrl: String?)
+ fun launchEasySDK(paymentId: String?, checkoutUrl: String?, returnUrl: String?, cancelUrl: String?)
/**
* Show/hide progress view based on the boolean flag
diff --git a/MiaSample/app/src/main/java/eu/nets/miasample/activity/SubscriptionActivity.kt b/MiaSample/app/src/main/java/eu/nets/miasample/activity/SubscriptionActivity.kt
index 707b689..4ef6ee2 100644
--- a/MiaSample/app/src/main/java/eu/nets/miasample/activity/SubscriptionActivity.kt
+++ b/MiaSample/app/src/main/java/eu/nets/miasample/activity/SubscriptionActivity.kt
@@ -3,8 +3,8 @@ package eu.nets.miasample.activity
import android.app.Activity
import android.app.AlertDialog
import android.content.Intent
-import android.support.v7.app.AppCompatActivity
import android.os.Bundle
+import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.LinearLayoutManager
import android.view.View
import com.google.gson.Gson
@@ -19,7 +19,6 @@ import eu.nets.miasample.network.response.SubscriptionDetailsResponse
import eu.nets.miasample.utils.SampleLocalHost
import eu.nets.miasample.utils.SharedPrefs
import kotlinx.android.synthetic.main.activity_subscription.*
-import java.lang.Exception
/**
* *****Copyright (c) 2020 Nets Denmark A/S*****
@@ -149,12 +148,12 @@ class SubscriptionActivity : AppCompatActivity(), SubscriptionActivityView {
}
}
- override fun launchEasySDK(paymentId: String?, checkoutUrl: String?, returnUrl: String?) {
+ override fun launchEasySDK(paymentId: String?, checkoutUrl: String?, returnUrl: String?, cancelUrl: String?) {
if (paymentId == null || checkoutUrl == null) {
showAlert(getString(R.string.error_title), getString(R.string.error_message))
return
} else {
- MiASDK.getInstance().startSDK(this, MiAPaymentInfo(paymentId, checkoutUrl, returnUrl))
+ MiASDK.getInstance().startSDK(this, MiAPaymentInfo(paymentId, checkoutUrl, returnUrl, cancelUrl))
}
}
diff --git a/MiaSample/app/src/main/java/eu/nets/miasample/activity/SubscriptionActivityPresenterImpl.kt b/MiaSample/app/src/main/java/eu/nets/miasample/activity/SubscriptionActivityPresenterImpl.kt
index 18bd4cf..2c1c837 100644
--- a/MiaSample/app/src/main/java/eu/nets/miasample/activity/SubscriptionActivityPresenterImpl.kt
+++ b/MiaSample/app/src/main/java/eu/nets/miasample/activity/SubscriptionActivityPresenterImpl.kt
@@ -64,11 +64,11 @@ class SubscriptionActivityPresenterImpl(private var mView: SubscriptionActivityV
when (SharedPrefs.getInstance().integrationType) {
MainActivity.MERCHANT_HOSTED_PAYMENT_WINDOW -> {
//is merchant hosted payment window - do not send return url
- mView?.launchEasySDK(mPaymentId, mCheckoutUrl, null)
+ mView?.launchEasySDK(mPaymentId, mCheckoutUrl, null, MainActivity.CANCEL_URL)
}
MainActivity.EASY_HOSTED_PAYMENT_WINDOW -> {
//is easy hosted payment window - send the return url
- mView?.launchEasySDK(mPaymentId, response?.hostedPaymentPageUrl, MainActivity.RETURN_URL)
+ mView?.launchEasySDK(mPaymentId, response?.hostedPaymentPageUrl, MainActivity.RETURN_URL, MainActivity.CANCEL_URL)
}
else -> {
//to be continued on future integration types
@@ -79,8 +79,10 @@ class SubscriptionActivityPresenterImpl(private var mView: SubscriptionActivityV
override fun onError(code: Int, error: HttpError) {
mView?.showLoader(false)
if (error.errors == null) {
- mView?.showAlert("${error.code ?: code}: ${error.source
- ?: getContext().getString(R.string.error_title)}",
+ mView?.showAlert("${error.code ?: code}: ${
+ error.source
+ ?: getContext().getString(R.string.error_title)
+ }",
error.message ?: getContext().getString(R.string.error_message))
} else {
mView?.showAlert(getContext().getString(R.string.error_title), error.parseErrors())
@@ -131,8 +133,10 @@ class SubscriptionActivityPresenterImpl(private var mView: SubscriptionActivityV
override fun onError(code: Int, error: HttpError) {
mView?.showLoader(false)
if (error.errors == null) {
- mView?.showAlert("${error.code ?: code}: ${error.source
- ?: getContext().getString(R.string.error_title)}",
+ mView?.showAlert("${error.code ?: code}: ${
+ error.source
+ ?: getContext().getString(R.string.error_title)
+ }",
error.message ?: getContext().getString(R.string.error_message))
} else {
mView?.showAlert(getContext().getString(R.string.error_message), error.parseErrors())
@@ -156,8 +160,10 @@ class SubscriptionActivityPresenterImpl(private var mView: SubscriptionActivityV
override fun onError(code: Int, error: HttpError) {
mView?.showLoader(false)
if (error.errors == null) {
- mView?.showAlert("${error.code ?: code}: ${error.source
- ?: getContext().getString(R.string.error_title)}",
+ mView?.showAlert("${error.code ?: code}: ${
+ error.source
+ ?: getContext().getString(R.string.error_title)
+ }",
error.message ?: getContext().getString(R.string.error_message))
} else {
mView?.showAlert(getContext().getString(R.string.error_message), error.parseErrors())
@@ -253,6 +259,7 @@ class SubscriptionActivityPresenterImpl(private var mView: SubscriptionActivityV
*/
checkout.integrationType = MainActivity.INTEGRATION_TYPE_PARAM
checkout.returnURL = MainActivity.RETURN_URL
+ checkout.cancelUrl = MainActivity.CANCEL_URL
}
else -> {//to be continued for future integration types
}
diff --git a/MiaSample/app/src/main/java/eu/nets/miasample/activity/SubscriptionActivityView.kt b/MiaSample/app/src/main/java/eu/nets/miasample/activity/SubscriptionActivityView.kt
index e42c616..9edd8c2 100644
--- a/MiaSample/app/src/main/java/eu/nets/miasample/activity/SubscriptionActivityView.kt
+++ b/MiaSample/app/src/main/java/eu/nets/miasample/activity/SubscriptionActivityView.kt
@@ -35,9 +35,10 @@ interface SubscriptionActivityView {
* @param paymentId the paymentId received in registerPayment API call
* @param checkoutUrl the checkout page url sent in the register payment API call
* @param returnUrl the return url of success case when Integration Type is Easy Hosted Checkout
+ * @param cancelUrl the url that you would want to redirect to in case of cancel.
*/
- fun launchEasySDK(paymentId: String?, checkoutUrl: String?, returnUrl: String?)
+ fun launchEasySDK(paymentId: String?, checkoutUrl: String?, returnUrl: String?, cancelUrl: String?)
/**
* Show/hide progress view based on the boolean flag
diff --git a/MiaSample/app/src/main/java/eu/nets/miasample/network/request/RegisterPaymentRequest.kt b/MiaSample/app/src/main/java/eu/nets/miasample/network/request/RegisterPaymentRequest.kt
index 86c19ba..2e2ef09 100644
--- a/MiaSample/app/src/main/java/eu/nets/miasample/network/request/RegisterPaymentRequest.kt
+++ b/MiaSample/app/src/main/java/eu/nets/miasample/network/request/RegisterPaymentRequest.kt
@@ -108,6 +108,9 @@ class Checkout {
@SerializedName("returnURL")
var returnURL: String? = null
@Expose
+ @SerializedName("cancelUrl")
+ var cancelUrl: String? = null
+ @Expose
@SerializedName("merchantHandlesConsumerData")
var merchantHandlesConsumerData: Boolean = false
@Expose
diff --git a/MiaSample/app/src/main/java/eu/nets/miasample/utils/SampleLocalHost.kt b/MiaSample/app/src/main/java/eu/nets/miasample/utils/SampleLocalHost.kt
index 5501617..8a9fd36 100644
--- a/MiaSample/app/src/main/java/eu/nets/miasample/utils/SampleLocalHost.kt
+++ b/MiaSample/app/src/main/java/eu/nets/miasample/utils/SampleLocalHost.kt
@@ -1,7 +1,6 @@
package eu.nets.miasample.utils
import fi.iki.elonen.NanoHTTPD
-import java.lang.Exception
/**
diff --git a/README.md b/README.md
index 1178fb3..da397f9 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Easy - Android SDK v1.2.1
+# Easy - Android SDK v1.3.0
----

@@ -18,7 +18,7 @@ MiA Easy Android SDK is a library which facilitates the Embedded DIBS Easy Check
----
In your `build.gradle` application level file, add:
```gradle
-implementation('eu.nets.mia:mia-sdk:1.2.1') { transitive = true;}
+implementation('eu.nets.mia:mia-sdk:1.3.0') { transitive = true;}
```
**Note:** the library is available through both `jcenter()` and `mavenCentral()` repositories.
diff --git a/ReactNative/MiaSample/yarn.lock b/ReactNative/MiaSample/yarn.lock
index a5d70b4..313ba56 100644
--- a/ReactNative/MiaSample/yarn.lock
+++ b/ReactNative/MiaSample/yarn.lock
@@ -5491,7 +5491,7 @@ react-is@^16.12.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6:
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
react-native-rn-mia@./../react-native-rn-mia:
- version "1.0.0"
+ version "1.2.0"
react-native@0.62.2:
version "0.62.2"
@@ -6645,9 +6645,9 @@ typedarray@^0.0.6:
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
ua-parser-js@^0.7.18:
- version "0.7.21"
- resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777"
- integrity sha512-+O8/qh/Qj8CgC6eYBVBykMrNtp5Gebn4dlGD/kKXVkJNDwyrAwSIqwz8CDf+tsAIWVycKcku6gIXJ0qwx/ZXaQ==
+ version "0.7.28"
+ resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.28.tgz#8ba04e653f35ce210239c64661685bf9121dec31"
+ integrity sha512-6Gurc1n//gjp9eQNXjD9O3M/sMwVtN5S8Lv9bvOYBfKfDNiIIhqiyi01vMBO45u4zkDE420w/e0se7Vs+sIg+g==
uglify-es@^3.1.9:
version "3.3.9"
diff --git a/ReactNative/react-native-rn-mia/android/build.gradle b/ReactNative/react-native-rn-mia/android/build.gradle
index 7edfc7c..3429f21 100644
--- a/ReactNative/react-native-rn-mia/android/build.gradle
+++ b/ReactNative/react-native-rn-mia/android/build.gradle
@@ -75,7 +75,7 @@ dependencies {
implementation 'com.facebook.react:react-native:+' // From node_modules
// Mia SDK
- implementation 'eu.nets.mia:mia-sdk:1.2.1'
+ implementation 'eu.nets.mia:mia-sdk:1.3.0'
}
def configureReactNativePom(def pom) {
diff --git a/Xamarin/DLL Files/MiASDKBinding.dll b/Xamarin/DLL Files/MiASDKBinding.dll
index d7a05f7..01ffbf4 100644
Binary files a/Xamarin/DLL Files/MiASDKBinding.dll and b/Xamarin/DLL Files/MiASDKBinding.dll differ
diff --git a/Xamarin/MiASampleXamarin/MiASampleXamarin/MainActivity.cs b/Xamarin/MiASampleXamarin/MiASampleXamarin/MainActivity.cs
index e1298a1..52424c0 100644
--- a/Xamarin/MiASampleXamarin/MiASampleXamarin/MainActivity.cs
+++ b/Xamarin/MiASampleXamarin/MiASampleXamarin/MainActivity.cs
@@ -111,7 +111,7 @@ private async void RegisterPayment(String payMode)
_paymentId = response.paymentId;
_hostedPaymentPageUrl = response.hostedPaymentPageUrl;
//start SDK
- MiASDK.Instance.StartSDK(this, new MiAPaymentInfo(response.paymentId, response.hostedPaymentPageUrl, APIService.returnURL));
+ MiASDK.Instance.StartSDK(this, new MiAPaymentInfo(response.paymentId, response.hostedPaymentPageUrl, APIService.returnURL, APIService.cancelURL));
}
else
{
@@ -122,68 +122,13 @@ private async void RegisterPayment(String payMode)
private String GetRegisterPaymentBody()
{
- return "{" +
- " \"checkout\": {" +
- " \"charge\": false," +
- " \"consumerType\": {" +
- " \"default\": \"B2C\"," +
- " \"supportedTypes\": [\"B2B\", \"B2C\"]" +
- " }," +
- " \"termsUrl\": \"http://localhost:6500\"," +
- " \"returnURL\": \"http://localhost/redirect.php\"," +
- " \"integrationType\": \"HostedPaymentPage\"" +
- " }," +
- " \"order\": {" +
- " \"amount\": 1000," +
- " \"currency\": \"SEK\"," +
- " \"items\": [{" +
- " \"grossTotalAmount\": 1000," +
- " \"name\": \"Lightning Cable\"," +
- " \"quantity\": 1," +
- " \"reference\": \"MiASDK-Xamarin-Android\"," +
- " \"taxAmount\": 0," +
- " \"taxRate\": 0," +
- " \"unit\": \"pcs\"" +
- " }]," +
- " \"reference\": \"MiASDK-Xamarin-Android\"" +
- " }" +
- "}";
+ return "{\"checkout\":{\"cancelUrl\":\"" + APIService.cancelURL + "\",\"charge\":false,\"consumerType\":{\"default\":\"B2C\",\"supportedTypes\":[\"B2B\",\"B2C\"]},\"integrationType\":\"HostedPaymentPage\",\"merchantHandlesConsumerData\":false,\"returnURL\":\"http://localhost/redirect.php\",\"termsUrl\":\"http://localhost:6500\"},\"order\":{\"amount\":1000,\"currency\":\"SEK\",\"items\":[{\"grossTotalAmount\":1000,\"name\":\"Lightning Cable\",\"quantity\":1,\"reference\":\"MiASDK-Android\",\"taxAmount\":0,\"taxRate\":0,\"unit\":\"pcs\"}],\"reference\":\"MiASDK-Android\"}}";
}
private String GetSubscriptionRequest()
{
- return "{\"checkout\":{" +
- "\"charge\":true," +
- "\"consumerType\":{" +
- "\"default\":\"B2C\"," +
- "\"supportedTypes\":[\"B2B\",\"B2C\"]" +
- "}," +
- "\"integrationType\":\"HostedPaymentPage\"," +
- "\"merchantHandlesConsumerData\":false," +
- "\"returnURL\":\"http://localhost/redirect.php\"," +
- "\"termsUrl\":\"http://localhost:6500\"" +
- "}," +
- "\"order\":{" +
- "\"amount\":1000," +
- "\"currency\":\"SEK\"," +
- "\"items\":[{" +
- "\"grossTotalAmount\":1000," +
- "\"name\":\"Lightning Cable\"," +
- "\"quantity\":1," +
- "\"reference\":\"MiASDK-Android\"," +
- "\"taxAmount\":0," +
- "\"taxRate\":0," +
- "\"unit\":\"pcs\"" +
- "}]," +
- "\"reference\":\"MiASDK-Android\"" +
- "}," +
- "\"subscription\":{" +
- "\"endDate\":\""
- + CreateSubscriptionEndDate()
- + "\",\"interval\":0" +
- "}" +
- "}";
+ return "{\"checkout\":{\"cancelUrl\":\"" + APIService.cancelURL + "\",\"charge\":true,\"consumerType\":{\"default\":\"B2C\",\"supportedTypes\":[\"B2B\",\"B2C\"]},\"integrationType\":\"HostedPaymentPage\",\"merchantHandlesConsumerData\":false,\"returnURL\":\"http://localhost/redirect.php\",\"termsUrl\":\"http://localhost:6500\"},\"order\":{\"amount\":1000,\"currency\":\"SEK\",\"items\":[{\"grossTotalAmount\":1000,\"name\":\"Lightning Cable\",\"quantity\":1,\"reference\":\"MiASDK-Android\",\"taxAmount\":0,\"taxRate\":0,\"unit\":\"pcs\"}],\"reference\":\"MiASDK-Android\"},\"subscription\":{\"endDate\":\"2024-04-01\",\"interval\":0}}";
}
/**
diff --git a/Xamarin/MiASampleXamarin/MiASampleXamarin/http/APIService.cs b/Xamarin/MiASampleXamarin/MiASampleXamarin/http/APIService.cs
index 0c6a08d..3b3c96c 100644
--- a/Xamarin/MiASampleXamarin/MiASampleXamarin/http/APIService.cs
+++ b/Xamarin/MiASampleXamarin/MiASampleXamarin/http/APIService.cs
@@ -45,6 +45,14 @@ public class APIService
public static String baseUrl = "YOUR_BASE_URL";
public static String endPoint = "YOUR_API_ENDPOINT";
public static String returnURL = "YOUR_RETURN_URL";
+
+ // Cancellation URL passed to EASY and the SDK to indentify
+ // user cancellation by using the "Go back" link rendered
+ // in the checkout webview.
+ // Note: Pass the same `cancelURL` for
+ // payment registration with Easy API and
+ // when presenting Mia SDK following payment registration.
+ public static String cancelURL = "YOUR_CANCEL_URL";
#external_code_section_end*/
//#internal_code_section_start
@@ -53,6 +61,7 @@ public class APIService
public static String baseUrl = "https://test.api.dibspayment.eu/";
public static String endPoint = "v1/payments";
public static String returnURL = "http://localhost/redirect.php";
+ public static String cancelURL = "https://cancellation-identifier-url";
//#internal_code_section_end
private APIService()
diff --git a/apk/mia-sdk-android-release-sample-1.2.1.apk b/apk/mia-sdk-android-release-sample-1.3.0.apk
similarity index 70%
rename from apk/mia-sdk-android-release-sample-1.2.1.apk
rename to apk/mia-sdk-android-release-sample-1.3.0.apk
index aa38f09..82b3db1 100644
Binary files a/apk/mia-sdk-android-release-sample-1.2.1.apk and b/apk/mia-sdk-android-release-sample-1.3.0.apk differ
diff --git a/documentation/Start - Overview of MiA Android SDK.html b/documentation/Start - Overview of MiA Android SDK.html
index fb1cb79..e75b06b 100644
--- a/documentation/Start - Overview of MiA Android SDK.html
+++ b/documentation/Start - Overview of MiA Android SDK.html
@@ -76,7 +76,7 @@
Installation
Please add the following line in your application's build.gradle file.
Important: Make sure the returnUrl is the same one you are sending in the API call to retrieve the paymentId. Without this, the SDK cannot detect when the payment has completed in order to deliver a result back to your application.
Support of Android API version extended to API 21 and above.
+
v1.2.2 Released: 20-Apr-2021
+
Release notes:
+
+
Added support for cancel URL in SDK API, allowing users to close the Easy checkout (using the “Go back” button) and come back to the app or target URL. Just like returnURL, cancelURL it is a string to specify in the register payment API.
+
Added Xamarin and ReactNative wrappers for SDK integration
+
+
Note:
For any bug reports or question, please contact: mobile-acceptance@nets.eu
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL, IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT. BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM. IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL, IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT. BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM. IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL, IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT. BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM. IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL, IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT. BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM. IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL, IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT. BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM. IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL, IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT. BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM. IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+IN THIS LICENSE AGREEMENT.
+BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with
+Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL, IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT. BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM. IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL, IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT. BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM. IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+IN THIS LICENSE AGREEMENT.
+BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with
+Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+IN THIS LICENSE AGREEMENT.
+BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with
+Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+IN THIS LICENSE AGREEMENT.
+BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with
+Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
+
+
diff --git a/documentation/eu.nets.mia.webview.base/-base-web-view-presenter-impl/-t-a-g.html b/documentation/eu.nets.mia.webview.base/-base-web-view-presenter-impl/-t-a-g.html
new file mode 100644
index 0000000..592b134
--- /dev/null
+++ b/documentation/eu.nets.mia.webview.base/-base-web-view-presenter-impl/-t-a-g.html
@@ -0,0 +1,14 @@
+
+
+
+BaseWebViewPresenterImpl.TAG - mia
+
+
+
+mia / eu.nets.mia.webview.base / BaseWebViewPresenterImpl / TAG
+
+
Creates a new WebView called "Child" to be loaded on top of the parent (pop-up)
+It will have same functionalities as the parent, except the detection of the payment status.
+Usually, this child will only show pages like: Help, Terms&Conditions, etc.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+IN THIS LICENSE AGREEMENT.
+BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with
+Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
Creates a new WebView called "Child" to be loaded on top of the parent (pop-up)
+It will have same functionalities as the parent, except the detection of the payment status.
+Usually, this child will only show pages like: Help, Terms&Conditions, etc.
Creates a new WebView called "Child" to be loaded on top of the parent (pop-up)
+It will have same functionalities as the parent, except the detection of the payment status.
+Usually, this child will only show pages like: Help, Terms&Conditions, etc.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+IN THIS LICENSE AGREEMENT.
+BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with
+Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
Creates a new WebView called "Child" to be loaded on top of the parent (pop-up)
+It will have same functionalities as the parent, except the detection of the payment status.
+Usually, this child will only show pages like: Help, Terms&Conditions, etc.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+IN THIS LICENSE AGREEMENT.
+BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with
+Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+IN THIS LICENSE AGREEMENT.
+BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with
+Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+IN THIS LICENSE AGREEMENT.
+BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with
+Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
Initialize the data received from the merchant app, and load the checkoutUrl receive from merchat app into the WebView
+
Parameters
+
+bundle - Can be the Intent bundle data (from the merchant app directly), or
+ savedInstanceState bundle data (SDK stored in case the app goes to background)
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+IN THIS LICENSE AGREEMENT.
+BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with
+Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
Initialize the data received from the merchant app, and load the checkoutUrl receive from merchat app into the WebView
+
Parameters
+
+bundle - Can be the Intent bundle data (from the merchant app directly), or
+ savedInstanceState bundle data (SDK stored in case the app goes to background)
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+IN THIS LICENSE AGREEMENT.
+BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with
+Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
Initialize the data received from the merchant app
+
Parameters
+
+bundle - Can be the Intent bundle data (from the merchant app directly), or
+ savedInstanceState bundle data (SDK stored in case the app goes to background)
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+IN THIS LICENSE AGREEMENT.
+BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with
+Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
NETS DENMARK A/S, ("NETS"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL,
+IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED
+IN THIS LICENSE AGREEMENT.
+BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.
+IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY,
+YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY,
+OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.
+
Software is copyrighted. Title to Software and all associated intellectual property rights is retained by NETS and/or its licensors.
+Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.
+
No right, title or interest in or to any trademark, service mark, logo or trade name of NETS or its licensors is granted under this Agreement.
+
Permission is hereby granted, 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.
+
Software may only be used for commercial or production purpose together with
+Easy services (as per https://tech.dibspayment.com/easy) provided from NETS, its subsidiaries or affiliates under common control.
+
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.
BaseWebViewActivity callback
+Notifies this activity that the payment has finished with success
+Handle here the way the result gets delivered to the application
Initialize the data received from the merchant app
+
Parameters
+
+bundle - Can be the Intent bundle data (from the merchant app directly), or
+ savedInstanceState bundle data (SDK stored in case the app goes to background)
BaseWebViewActivity callback
+Notifies this activity that the payment has finished with success
+Handle here the way the result gets delivered to the application