payme-mini-app 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Phan Thanh Nam
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is
9
- furnished to do so, subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be included in all
12
- copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Phan Thanh Nam
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
- ## ios
2
- - (void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)(void))completionHandler
3
- {
4
- completionHandler();
5
- }
1
+ ## ios
2
+ - (void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)(void))completionHandler
3
+ {
4
+ completionHandler();
5
+ }
@@ -1,86 +1,86 @@
1
- buildscript {
2
- // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
- def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["RNPayMEMiniApp_kotlinVersion"]
4
-
5
- repositories {
6
- google()
7
- mavenCentral()
8
- }
9
-
10
- dependencies {
11
- classpath "com.android.tools.build:gradle:7.2.1"
12
- // noinspection DifferentKotlinGradleVersion
13
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
- }
15
- }
16
-
17
- def isNewArchitectureEnabled() {
18
- return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
19
- }
20
-
21
- apply plugin: "com.android.library"
22
- apply plugin: "kotlin-android"
23
-
24
- if (isNewArchitectureEnabled()) {
25
- apply plugin: "com.facebook.react"
26
- }
27
-
28
- def getExtOrDefault(name) {
29
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["RNPayMEMiniApp_" + name]
30
- }
31
-
32
- def getExtOrIntegerDefault(name) {
33
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["RNPayMEMiniApp_" + name]).toInteger()
34
- }
35
-
36
- android {
37
- compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
38
-
39
- defaultConfig {
40
- minSdkVersion getExtOrIntegerDefault("minSdkVersion")
41
- targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
42
- buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
43
- }
44
- buildTypes {
45
- release {
46
- minifyEnabled false
47
- }
48
- }
49
-
50
- lintOptions {
51
- disable "GradleCompatible"
52
- }
53
-
54
- compileOptions {
55
- sourceCompatibility JavaVersion.VERSION_1_8
56
- targetCompatibility JavaVersion.VERSION_1_8
57
- }
58
-
59
- }
60
-
61
- repositories {
62
- mavenCentral()
63
- google()
64
- maven {
65
- url 'https://jitpack.io'
66
- }
67
- }
68
-
69
- def kotlin_version = getExtOrDefault("kotlinVersion")
70
-
71
- dependencies {
72
- // For < 0.71, this will be from the local maven repo
73
- // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
74
- //noinspection GradleDynamicVersion
75
- implementation "com.facebook.react:react-native"
76
- implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
77
- implementation 'com.github.PayME-Miniapp:native-android:0.0.30'
78
- }
79
-
80
- if (isNewArchitectureEnabled()) {
81
- react {
82
- jsRootDir = file("../src/")
83
- libraryName = "RNPayMEMiniApp"
84
- codegenJavaPackageName = "com.paymeminiapp"
85
- }
86
- }
1
+ buildscript {
2
+ // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
+ def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["RNPayMEMiniApp_kotlinVersion"]
4
+
5
+ repositories {
6
+ google()
7
+ mavenCentral()
8
+ }
9
+
10
+ dependencies {
11
+ classpath "com.android.tools.build:gradle:7.2.1"
12
+ // noinspection DifferentKotlinGradleVersion
13
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
+ }
15
+ }
16
+
17
+ def isNewArchitectureEnabled() {
18
+ return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
19
+ }
20
+
21
+ apply plugin: "com.android.library"
22
+ apply plugin: "kotlin-android"
23
+
24
+ if (isNewArchitectureEnabled()) {
25
+ apply plugin: "com.facebook.react"
26
+ }
27
+
28
+ def getExtOrDefault(name) {
29
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["RNPayMEMiniApp_" + name]
30
+ }
31
+
32
+ def getExtOrIntegerDefault(name) {
33
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["RNPayMEMiniApp_" + name]).toInteger()
34
+ }
35
+
36
+ android {
37
+ compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
38
+
39
+ defaultConfig {
40
+ minSdkVersion getExtOrIntegerDefault("minSdkVersion")
41
+ targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
42
+ buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
43
+ }
44
+ buildTypes {
45
+ release {
46
+ minifyEnabled false
47
+ }
48
+ }
49
+
50
+ lintOptions {
51
+ disable "GradleCompatible"
52
+ }
53
+
54
+ compileOptions {
55
+ sourceCompatibility JavaVersion.VERSION_1_8
56
+ targetCompatibility JavaVersion.VERSION_1_8
57
+ }
58
+
59
+ }
60
+
61
+ repositories {
62
+ mavenCentral()
63
+ google()
64
+ maven {
65
+ url 'https://jitpack.io'
66
+ }
67
+ }
68
+
69
+ def kotlin_version = getExtOrDefault("kotlinVersion")
70
+
71
+ dependencies {
72
+ // For < 0.71, this will be from the local maven repo
73
+ // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
74
+ //noinspection GradleDynamicVersion
75
+ implementation "com.facebook.react:react-native"
76
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
77
+ implementation 'com.github.PayME-Miniapp:native-android:0.0.30'
78
+ }
79
+
80
+ if (isNewArchitectureEnabled()) {
81
+ react {
82
+ jsRootDir = file("../src/")
83
+ libraryName = "RNPayMEMiniApp"
84
+ codegenJavaPackageName = "com.paymeminiapp"
85
+ }
86
+ }
@@ -1,5 +1,5 @@
1
- RNPayMEMiniApp_kotlinVersion=1.7.0
2
- RNPayMEMiniApp_minSdkVersion=21
3
- RNPayMEMiniApp_targetSdkVersion=31
4
- RNPayMEMiniApp_compileSdkVersion=31
5
- RNPayMEMiniApp_ndkversion=21.4.7075529
1
+ RNPayMEMiniApp_kotlinVersion=1.7.0
2
+ RNPayMEMiniApp_minSdkVersion=21
3
+ RNPayMEMiniApp_targetSdkVersion=31
4
+ RNPayMEMiniApp_compileSdkVersion=31
5
+ RNPayMEMiniApp_ndkversion=21.4.7075529
@@ -1,4 +1,4 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.paymeminiapp">
3
-
4
- </manifest>
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.paymeminiapp">
3
+
4
+ </manifest>
@@ -1,102 +1,102 @@
1
- package com.paymeminiapp
2
-
3
- import com.facebook.react.bridge.*
4
- import org.json.JSONArray
5
- import org.json.JSONException
6
- import org.json.JSONObject
7
-
8
- object JsonConvert {
9
- @Throws(JSONException::class)
10
- fun reactToJSON(readableMap: ReadableMap?): JSONObject {
11
- val jsonObject = JSONObject()
12
- val iterator = readableMap!!.keySetIterator()
13
- while (iterator.hasNextKey()) {
14
- val key = iterator.nextKey()
15
- val valueType = readableMap.getType(key)
16
- when (valueType) {
17
- ReadableType.Null -> jsonObject.put(key, JSONObject.NULL)
18
- ReadableType.Boolean -> jsonObject.put(key, readableMap.getBoolean(key))
19
- ReadableType.Number -> try {
20
- jsonObject.put(key, readableMap.getInt(key))
21
- } catch (e: Exception) {
22
- jsonObject.put(key, readableMap.getDouble(key))
23
- }
24
- ReadableType.String -> jsonObject.put(key, readableMap.getString(key))
25
- ReadableType.Map -> jsonObject.put(key, reactToJSON(readableMap.getMap(key)))
26
- ReadableType.Array -> jsonObject.put(key, reactToJSON(readableMap.getArray(key)))
27
- }
28
- }
29
- return jsonObject
30
- }
31
-
32
- @Throws(JSONException::class)
33
- fun reactToJSON(readableArray: ReadableArray?): JSONArray {
34
- val jsonArray = JSONArray()
35
- for (i in 0 until readableArray!!.size()) {
36
- val valueType = readableArray.getType(i)
37
- when (valueType) {
38
- ReadableType.Null -> jsonArray.put(JSONObject.NULL)
39
- ReadableType.Boolean -> jsonArray.put(readableArray.getBoolean(i))
40
- ReadableType.Number -> try {
41
- jsonArray.put(readableArray.getInt(i))
42
- } catch (e: Exception) {
43
- jsonArray.put(readableArray.getDouble(i))
44
- }
45
- ReadableType.String -> jsonArray.put(readableArray.getString(i))
46
- ReadableType.Map -> jsonArray.put(reactToJSON(readableArray.getMap(i)))
47
- ReadableType.Array -> jsonArray.put(reactToJSON(readableArray.getArray(i)))
48
- }
49
- }
50
- return jsonArray
51
- }
52
-
53
- @Throws(JSONException::class)
54
- fun jsonToReact(jsonObject: JSONObject): WritableMap {
55
- val writableMap: WritableMap = Arguments.createMap()
56
- val iterator: Iterator<*> = jsonObject.keys()
57
- while (iterator.hasNext()) {
58
- val key = iterator.next() as String
59
- val value: Any = jsonObject.get(key)
60
- if (value is Float || value is Double || value is Number) {
61
- writableMap.putDouble(key, jsonObject.getDouble(key))
62
- } else if (value is Int) {
63
- writableMap.putInt(key, jsonObject.getInt(key))
64
- } else if (value is Boolean) {
65
- writableMap.putBoolean(key, jsonObject.getBoolean(key))
66
- } else if (value is String) {
67
- writableMap.putString(key, jsonObject.getString(key))
68
- } else if (value is JSONObject) {
69
- writableMap.putMap(key, jsonToReact(jsonObject.getJSONObject(key)))
70
- } else if (value is JSONArray) {
71
- writableMap.putArray(key, jsonToReact(jsonObject.getJSONArray(key)))
72
- } else if (value === JSONObject.NULL) {
73
- writableMap.putNull(key)
74
- }
75
- }
76
- return writableMap
77
- }
78
-
79
- @Throws(JSONException::class)
80
- fun jsonToReact(jsonArray: JSONArray): WritableArray {
81
- val writableArray: WritableArray = Arguments.createArray()
82
- for (i in 0 until jsonArray.length()) {
83
- val value: Any = jsonArray.get(i)
84
- if (value is Float || value is Double || value is Number) {
85
- writableArray.pushDouble(jsonArray.getDouble(i))
86
- } else if (value is Int) {
87
- writableArray.pushInt(jsonArray.getInt(i))
88
- } else if (value is Boolean) {
89
- writableArray.pushBoolean(jsonArray.getBoolean(i))
90
- } else if (value is String) {
91
- writableArray.pushString(jsonArray.getString(i))
92
- } else if (value is JSONObject) {
93
- writableArray.pushMap(jsonToReact(jsonArray.getJSONObject(i)))
94
- } else if (value is JSONArray) {
95
- writableArray.pushArray(jsonToReact(jsonArray.getJSONArray(i)))
96
- } else if (value === JSONObject.NULL) {
97
- writableArray.pushNull()
98
- }
99
- }
100
- return writableArray
101
- }
1
+ package com.paymeminiapp
2
+
3
+ import com.facebook.react.bridge.*
4
+ import org.json.JSONArray
5
+ import org.json.JSONException
6
+ import org.json.JSONObject
7
+
8
+ object JsonConvert {
9
+ @Throws(JSONException::class)
10
+ fun reactToJSON(readableMap: ReadableMap?): JSONObject {
11
+ val jsonObject = JSONObject()
12
+ val iterator = readableMap!!.keySetIterator()
13
+ while (iterator.hasNextKey()) {
14
+ val key = iterator.nextKey()
15
+ val valueType = readableMap.getType(key)
16
+ when (valueType) {
17
+ ReadableType.Null -> jsonObject.put(key, JSONObject.NULL)
18
+ ReadableType.Boolean -> jsonObject.put(key, readableMap.getBoolean(key))
19
+ ReadableType.Number -> try {
20
+ jsonObject.put(key, readableMap.getInt(key))
21
+ } catch (e: Exception) {
22
+ jsonObject.put(key, readableMap.getDouble(key))
23
+ }
24
+ ReadableType.String -> jsonObject.put(key, readableMap.getString(key))
25
+ ReadableType.Map -> jsonObject.put(key, reactToJSON(readableMap.getMap(key)))
26
+ ReadableType.Array -> jsonObject.put(key, reactToJSON(readableMap.getArray(key)))
27
+ }
28
+ }
29
+ return jsonObject
30
+ }
31
+
32
+ @Throws(JSONException::class)
33
+ fun reactToJSON(readableArray: ReadableArray?): JSONArray {
34
+ val jsonArray = JSONArray()
35
+ for (i in 0 until readableArray!!.size()) {
36
+ val valueType = readableArray.getType(i)
37
+ when (valueType) {
38
+ ReadableType.Null -> jsonArray.put(JSONObject.NULL)
39
+ ReadableType.Boolean -> jsonArray.put(readableArray.getBoolean(i))
40
+ ReadableType.Number -> try {
41
+ jsonArray.put(readableArray.getInt(i))
42
+ } catch (e: Exception) {
43
+ jsonArray.put(readableArray.getDouble(i))
44
+ }
45
+ ReadableType.String -> jsonArray.put(readableArray.getString(i))
46
+ ReadableType.Map -> jsonArray.put(reactToJSON(readableArray.getMap(i)))
47
+ ReadableType.Array -> jsonArray.put(reactToJSON(readableArray.getArray(i)))
48
+ }
49
+ }
50
+ return jsonArray
51
+ }
52
+
53
+ @Throws(JSONException::class)
54
+ fun jsonToReact(jsonObject: JSONObject): WritableMap {
55
+ val writableMap: WritableMap = Arguments.createMap()
56
+ val iterator: Iterator<*> = jsonObject.keys()
57
+ while (iterator.hasNext()) {
58
+ val key = iterator.next() as String
59
+ val value: Any = jsonObject.get(key)
60
+ if (value is Float || value is Double) {
61
+ writableMap.putDouble(key, jsonObject.getDouble(key))
62
+ } else if (value is Number) {
63
+ writableMap.putInt(key, jsonObject.getInt(key))
64
+ } else if (value is Boolean) {
65
+ writableMap.putBoolean(key, jsonObject.getBoolean(key))
66
+ } else if (value is String) {
67
+ writableMap.putString(key, jsonObject.getString(key))
68
+ } else if (value is JSONObject) {
69
+ writableMap.putMap(key, jsonToReact(jsonObject.getJSONObject(key)))
70
+ } else if (value is JSONArray) {
71
+ writableMap.putArray(key, jsonToReact(jsonObject.getJSONArray(key)))
72
+ } else if (value === JSONObject.NULL) {
73
+ writableMap.putNull(key)
74
+ }
75
+ }
76
+ return writableMap
77
+ }
78
+
79
+ @Throws(JSONException::class)
80
+ fun jsonToReact(jsonArray: JSONArray): WritableArray {
81
+ val writableArray: WritableArray = Arguments.createArray()
82
+ for (i in 0 until jsonArray.length()) {
83
+ val value: Any = jsonArray.get(i)
84
+ if (value is Float || value is Double) {
85
+ writableArray.pushDouble(jsonArray.getDouble(i))
86
+ } else if (value is Number) {
87
+ writableArray.pushInt(jsonArray.getInt(i))
88
+ } else if (value is Boolean) {
89
+ writableArray.pushBoolean(jsonArray.getBoolean(i))
90
+ } else if (value is String) {
91
+ writableArray.pushString(jsonArray.getString(i))
92
+ } else if (value is JSONObject) {
93
+ writableArray.pushMap(jsonToReact(jsonArray.getJSONObject(i)))
94
+ } else if (value is JSONArray) {
95
+ writableArray.pushArray(jsonToReact(jsonArray.getJSONArray(i)))
96
+ } else if (value === JSONObject.NULL) {
97
+ writableArray.pushNull()
98
+ }
99
+ }
100
+ return writableArray
101
+ }
102
102
  }