payme-mini-app 1.1.0-beta.1 → 1.1.0-beta.3
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/android/build.gradle +7 -19
- package/android/gradle.properties +5 -5
- package/android/src/main/java/com/paymeminiapp/JsonConvert.kt +104 -0
- package/android/src/main/java/com/paymeminiapp/PaymeMiniAppModule.kt +286 -223
- package/lib/commonjs/index.js +3 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.type.d.ts +5 -5
- package/lib/typescript/commonjs/src/index.type.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/index.type.d.ts +5 -5
- package/lib/typescript/module/src/index.type.d.ts.map +1 -1
- package/package.json +6 -7
- package/src/index.tsx +2 -1
- package/src/index.type.ts +5 -5
package/android/build.gradle
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
buildscript {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
ext.getExtOrDefault = {name ->
|
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['PaymeMiniApp_' + name]
|
|
4
|
+
}
|
|
4
5
|
|
|
5
6
|
repositories {
|
|
6
7
|
google()
|
|
@@ -8,17 +9,11 @@ buildscript {
|
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
dependencies {
|
|
11
|
-
classpath "com.android.tools.build:gradle:7.2
|
|
12
|
-
|
|
13
|
-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
13
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
def reactNativeArchitectures() {
|
|
18
|
-
def value = rootProject.getProperties().get("reactNativeArchitectures")
|
|
19
|
-
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
|
20
|
-
}
|
|
21
|
-
|
|
22
17
|
def isNewArchitectureEnabled() {
|
|
23
18
|
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
24
19
|
}
|
|
@@ -30,10 +25,6 @@ if (isNewArchitectureEnabled()) {
|
|
|
30
25
|
apply plugin: "com.facebook.react"
|
|
31
26
|
}
|
|
32
27
|
|
|
33
|
-
def getExtOrDefault(name) {
|
|
34
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["PaymeMiniApp_" + name]
|
|
35
|
-
}
|
|
36
|
-
|
|
37
28
|
def getExtOrIntegerDefault(name) {
|
|
38
29
|
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["PaymeMiniApp_" + name]).toInteger()
|
|
39
30
|
}
|
|
@@ -90,11 +81,8 @@ repositories {
|
|
|
90
81
|
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
91
82
|
|
|
92
83
|
dependencies {
|
|
93
|
-
|
|
94
|
-
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
|
95
|
-
//noinspection GradleDynamicVersion
|
|
96
|
-
implementation "com.facebook.react:react-native:+"
|
|
84
|
+
implementation "com.facebook.react:react-android"
|
|
97
85
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
98
|
-
implementation 'com.github.PayME-Miniapp:native-android:0.
|
|
86
|
+
implementation 'com.github.PayME-Miniapp:native-android:0.5.0-alpha.3'
|
|
99
87
|
}
|
|
100
88
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
PaymeMiniApp_kotlinVersion=
|
|
2
|
-
PaymeMiniApp_minSdkVersion=
|
|
3
|
-
PaymeMiniApp_targetSdkVersion=
|
|
4
|
-
PaymeMiniApp_compileSdkVersion=
|
|
5
|
-
PaymeMiniApp_ndkversion=
|
|
1
|
+
PaymeMiniApp_kotlinVersion=2.0.21
|
|
2
|
+
PaymeMiniApp_minSdkVersion=24
|
|
3
|
+
PaymeMiniApp_targetSdkVersion=34
|
|
4
|
+
PaymeMiniApp_compileSdkVersion=35
|
|
5
|
+
PaymeMiniApp_ndkversion=27.1.12297006
|
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
|
|
25
|
+
ReadableType.String -> jsonObject.put(key, readableMap.getString(key))
|
|
26
|
+
ReadableType.Map -> jsonObject.put(key, reactToJSON(readableMap.getMap(key)))
|
|
27
|
+
ReadableType.Array -> jsonObject.put(key, reactToJSON(readableMap.getArray(key)))
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return jsonObject
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@Throws(JSONException::class)
|
|
34
|
+
fun reactToJSON(readableArray: ReadableArray?): JSONArray {
|
|
35
|
+
val jsonArray = JSONArray()
|
|
36
|
+
for (i in 0 until readableArray!!.size()) {
|
|
37
|
+
val valueType = readableArray.getType(i)
|
|
38
|
+
when (valueType) {
|
|
39
|
+
ReadableType.Null -> jsonArray.put(JSONObject.NULL)
|
|
40
|
+
ReadableType.Boolean -> jsonArray.put(readableArray.getBoolean(i))
|
|
41
|
+
ReadableType.Number -> try {
|
|
42
|
+
jsonArray.put(readableArray.getInt(i))
|
|
43
|
+
} catch (e: Exception) {
|
|
44
|
+
jsonArray.put(readableArray.getDouble(i))
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
ReadableType.String -> jsonArray.put(readableArray.getString(i))
|
|
48
|
+
ReadableType.Map -> jsonArray.put(reactToJSON(readableArray.getMap(i)))
|
|
49
|
+
ReadableType.Array -> jsonArray.put(reactToJSON(readableArray.getArray(i)))
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return jsonArray
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@Throws(JSONException::class)
|
|
56
|
+
fun jsonToReact(jsonObject: JSONObject): WritableMap {
|
|
57
|
+
val writableMap: WritableMap = Arguments.createMap()
|
|
58
|
+
val iterator: Iterator<*> = jsonObject.keys()
|
|
59
|
+
while (iterator.hasNext()) {
|
|
60
|
+
val key = iterator.next() as String
|
|
61
|
+
val value: Any = jsonObject.get(key)
|
|
62
|
+
if (value is Int) {
|
|
63
|
+
writableMap.putInt(key, jsonObject.getInt(key))
|
|
64
|
+
} else if (value is Float || value is Double || value is Number) {
|
|
65
|
+
writableMap.putDouble(key, jsonObject.getDouble(key))
|
|
66
|
+
} else if (value is Boolean) {
|
|
67
|
+
writableMap.putBoolean(key, jsonObject.getBoolean(key))
|
|
68
|
+
} else if (value is String) {
|
|
69
|
+
writableMap.putString(key, jsonObject.getString(key))
|
|
70
|
+
} else if (value is JSONObject) {
|
|
71
|
+
writableMap.putMap(key, jsonToReact(jsonObject.getJSONObject(key)))
|
|
72
|
+
} else if (value is JSONArray) {
|
|
73
|
+
writableMap.putArray(key, jsonToReact(jsonObject.getJSONArray(key)))
|
|
74
|
+
} else if (value === JSONObject.NULL) {
|
|
75
|
+
writableMap.putNull(key)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return writableMap
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@Throws(JSONException::class)
|
|
82
|
+
fun jsonToReact(jsonArray: JSONArray): WritableArray {
|
|
83
|
+
val writableArray: WritableArray = Arguments.createArray()
|
|
84
|
+
for (i in 0 until jsonArray.length()) {
|
|
85
|
+
val value: Any = jsonArray.get(i)
|
|
86
|
+
if (value is Int) {
|
|
87
|
+
writableArray.pushInt(jsonArray.getInt(i))
|
|
88
|
+
} else if (value is Float || value is Double || value is Number) {
|
|
89
|
+
writableArray.pushDouble(jsonArray.getDouble(i))
|
|
90
|
+
} else if (value is Boolean) {
|
|
91
|
+
writableArray.pushBoolean(jsonArray.getBoolean(i))
|
|
92
|
+
} else if (value is String) {
|
|
93
|
+
writableArray.pushString(jsonArray.getString(i))
|
|
94
|
+
} else if (value is JSONObject) {
|
|
95
|
+
writableArray.pushMap(jsonToReact(jsonArray.getJSONObject(i)))
|
|
96
|
+
} else if (value is JSONArray) {
|
|
97
|
+
writableArray.pushArray(jsonToReact(jsonArray.getJSONArray(i)))
|
|
98
|
+
} else if (value === JSONObject.NULL) {
|
|
99
|
+
writableArray.pushNull()
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return writableArray
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -1,18 +1,45 @@
|
|
|
1
1
|
package com.paymeminiapp
|
|
2
2
|
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.util.Log
|
|
5
|
+
import com.facebook.react.bridge.Arguments
|
|
3
6
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
7
|
+
import com.facebook.react.bridge.ReactContext
|
|
4
8
|
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
5
9
|
import com.facebook.react.bridge.ReactMethod
|
|
10
|
+
import com.facebook.react.bridge.ReadableMap
|
|
11
|
+
import com.facebook.react.bridge.WritableMap
|
|
12
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
6
13
|
import com.payme.sdk.PayMEMiniApp
|
|
7
|
-
import com.payme.sdk.models
|
|
8
|
-
import com.payme.sdk.
|
|
14
|
+
import com.payme.sdk.models.ActionOpenMiniApp
|
|
15
|
+
import com.payme.sdk.models.DepositWithdrawTransferData
|
|
16
|
+
import com.payme.sdk.models.ENV
|
|
17
|
+
import com.payme.sdk.models.Locale
|
|
18
|
+
import com.payme.sdk.models.OpenMiniAppDataInterface
|
|
19
|
+
import com.payme.sdk.models.OpenMiniAppDepositData
|
|
20
|
+
import com.payme.sdk.models.OpenMiniAppKYCData
|
|
21
|
+
import com.payme.sdk.models.OpenMiniAppOpenData
|
|
22
|
+
import com.payme.sdk.models.OpenMiniAppPayMEData
|
|
23
|
+
import com.payme.sdk.models.OpenMiniAppPaymentData
|
|
24
|
+
import com.payme.sdk.models.OpenMiniAppPaymentDirectData
|
|
25
|
+
import com.payme.sdk.models.OpenMiniAppServiceData
|
|
26
|
+
import com.payme.sdk.models.OpenMiniAppTransferData
|
|
27
|
+
import com.payme.sdk.models.OpenMiniAppTransferQRData
|
|
28
|
+
import com.payme.sdk.models.OpenMiniAppType
|
|
29
|
+
import com.payme.sdk.models.OpenMiniAppWithdrawData
|
|
30
|
+
import com.payme.sdk.models.PayMEError
|
|
31
|
+
import com.payme.sdk.models.PaymentData
|
|
32
|
+
import com.payme.sdk.models.PaymentDirectData
|
|
33
|
+
import com.payme.sdk.models.ServiceData
|
|
34
|
+
import com.payme.sdk.models.TransferQRData
|
|
9
35
|
import org.json.JSONObject
|
|
10
36
|
|
|
37
|
+
|
|
11
38
|
class PaymeMiniAppModule(reactContext: ReactApplicationContext) :
|
|
12
39
|
ReactContextBaseJavaModule(reactContext) {
|
|
13
40
|
private var payMEMiniApp: PayMEMiniApp? = null
|
|
14
41
|
override fun getName(): String {
|
|
15
|
-
|
|
42
|
+
return NAME
|
|
16
43
|
}
|
|
17
44
|
|
|
18
45
|
private val eventNames = arrayListOf("onResponse", "onError")
|
|
@@ -20,309 +47,345 @@ class PaymeMiniAppModule(reactContext: ReactApplicationContext) :
|
|
|
20
47
|
private var listenerCount = 0
|
|
21
48
|
|
|
22
49
|
@ReactMethod
|
|
23
|
-
fun addListener(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
50
|
+
fun addListener() {
|
|
51
|
+
if (listenerCount == 0) {
|
|
52
|
+
// Set up any upstream listeners or background tasks as necessary
|
|
53
|
+
}
|
|
27
54
|
|
|
28
|
-
|
|
55
|
+
listenerCount += 1
|
|
29
56
|
}
|
|
30
57
|
|
|
31
58
|
@ReactMethod
|
|
32
59
|
fun removeListeners(count: Int) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
60
|
+
listenerCount -= count
|
|
61
|
+
if (listenerCount == 0) {
|
|
62
|
+
// Remove upstream listeners, stop unnecessary background tasks
|
|
63
|
+
}
|
|
37
64
|
}
|
|
38
65
|
|
|
39
66
|
@ReactMethod
|
|
40
|
-
fun initPayME(
|
|
41
|
-
|
|
67
|
+
fun initPayME(
|
|
68
|
+
appId: String,
|
|
69
|
+
publicKey: String,
|
|
70
|
+
privateKey: String,
|
|
71
|
+
locale: String,
|
|
72
|
+
env: String,
|
|
73
|
+
mode: String
|
|
74
|
+
) {
|
|
75
|
+
val fragmentActivity: Activity? = currentActivity
|
|
42
76
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
77
|
+
payMEMiniApp = fragmentActivity?.let {
|
|
78
|
+
PayMEMiniApp(
|
|
79
|
+
it, appId, publicKey, privateKey, getEnv(env), getLocale(locale)
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
// payMEMiniApp?.setLanguage(locale)
|
|
83
|
+
payMEMiniApp?.setMode(mode)
|
|
84
|
+
payMEMiniApp?.setUpListener(onResponse = { actionOpenMiniApp: ActionOpenMiniApp, jsonObject: JSONObject? ->
|
|
85
|
+
onResponse(actionOpenMiniApp, jsonObject)
|
|
86
|
+
},
|
|
87
|
+
onError = { actionOpenMiniApp: ActionOpenMiniApp, payMEError: PayMEError ->
|
|
88
|
+
onError(actionOpenMiniApp, payMEError)
|
|
89
|
+
})
|
|
56
90
|
}
|
|
57
91
|
|
|
58
92
|
@ReactMethod
|
|
59
93
|
fun getBalance(phone: String) {
|
|
60
|
-
|
|
94
|
+
payMEMiniApp?.getBalance(phone)
|
|
61
95
|
}
|
|
62
96
|
|
|
63
97
|
@ReactMethod
|
|
64
98
|
fun getAccountInfo(phone: String) {
|
|
65
|
-
|
|
99
|
+
payMEMiniApp?.getAccountInformation(phone)
|
|
66
100
|
}
|
|
67
101
|
|
|
68
102
|
@ReactMethod
|
|
69
103
|
fun setLanguage(language: String) {
|
|
70
|
-
|
|
71
|
-
|
|
104
|
+
val locale = getLocale(language)
|
|
105
|
+
payMEMiniApp?.setLanguage(locale)
|
|
72
106
|
}
|
|
73
107
|
|
|
74
108
|
@ReactMethod
|
|
75
109
|
fun closeMiniApp() {
|
|
76
|
-
|
|
110
|
+
payMEMiniApp?.close()
|
|
77
111
|
}
|
|
78
112
|
|
|
79
113
|
@ReactMethod
|
|
80
114
|
fun open(type: String, openingParam: ReadableMap) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
115
|
+
val action = openingParam.getString("action") ?: "PAYME"
|
|
116
|
+
val phone = openingParam.getString("phone") ?: ""
|
|
117
|
+
val data = openingParam.getMap("data")
|
|
84
118
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if (transaction != null) {
|
|
136
|
-
paymentData = PaymentDirectData(transaction, extraData, isShowResult)
|
|
137
|
-
}
|
|
138
|
-
val openMiniAppData = getOpenMiniAppData(action, phone, paymentData)
|
|
139
|
-
payMEMiniApp?.openMiniApp(
|
|
140
|
-
getTypeOpenMiniApp(type),
|
|
141
|
-
openMiniAppData
|
|
142
|
-
)
|
|
143
|
-
return
|
|
119
|
+
if (action == "DEPOSIT" || action == "WITHDRAW" || action == "TRANSFER") {
|
|
120
|
+
val description =
|
|
121
|
+
if (data?.hasKey("description") == true) data.getString("description") else ""
|
|
122
|
+
val extraData =
|
|
123
|
+
if (data?.hasKey("extraData") == true) data.getMap("extraData")?.toHashMap()
|
|
124
|
+
?.filterValues { it != null }?.mapValues { it.value!! } else null
|
|
125
|
+
val isBackToApp =
|
|
126
|
+
if (data?.hasKey("isBackToApp") == true) data.getBoolean("isBackToApp") else true
|
|
127
|
+
val isShowResult =
|
|
128
|
+
if (data?.hasKey("isShowResult") == true) data.getBoolean("isShowResult") else true
|
|
129
|
+
val amount = if (data?.hasKey("amount") == true) data.getInt("amount") else null
|
|
130
|
+
val additionalData =
|
|
131
|
+
DepositWithdrawTransferData(description, amount, extraData, isBackToApp, isShowResult)
|
|
132
|
+
val openMiniAppData = getOpenMiniAppData(action, phone, additionalData)
|
|
133
|
+
payMEMiniApp?.openMiniApp(
|
|
134
|
+
getTypeOpenMiniApp(type),
|
|
135
|
+
openMiniAppData
|
|
136
|
+
)
|
|
137
|
+
return
|
|
138
|
+
}
|
|
139
|
+
if (action == "SERVICE") {
|
|
140
|
+
val service = data?.getString("service") ?: ""
|
|
141
|
+
val extraData =
|
|
142
|
+
if (data?.hasKey("extraData") == true) data.getMap("extraData")?.toHashMap()
|
|
143
|
+
?.filterValues { it != null }?.mapValues { it.value!! } else null
|
|
144
|
+
val isBackToApp =
|
|
145
|
+
if (data?.hasKey("isBackToApp") == true) data.getBoolean("isBackToApp") else true
|
|
146
|
+
val isShowResult =
|
|
147
|
+
if (data?.hasKey("isShowResult") == true) data.getBoolean("isShowResult") else true
|
|
148
|
+
val additionalData = ServiceData(service, extraData, isBackToApp, isShowResult)
|
|
149
|
+
val openMiniAppData = getOpenMiniAppData(action, phone, additionalData)
|
|
150
|
+
payMEMiniApp?.openMiniApp(
|
|
151
|
+
getTypeOpenMiniApp(type),
|
|
152
|
+
openMiniAppData
|
|
153
|
+
)
|
|
154
|
+
return
|
|
155
|
+
}
|
|
156
|
+
if (action == "PAY") {
|
|
157
|
+
val transactionId = data?.getString("transactionId")
|
|
158
|
+
val amount = data?.getInt("amount")
|
|
159
|
+
val note = if (data?.hasKey("note") == true) data.getString("note") else ""
|
|
160
|
+
val ipnUrl = if (data?.hasKey("ipnUrl") == true) data.getString("ipnUrl") else ""
|
|
161
|
+
val extraData =
|
|
162
|
+
if (data?.hasKey("extraData") == true) data.getMap("extraData")?.toHashMap()
|
|
163
|
+
?.filterValues { it != null }?.mapValues { it.value!! } else null
|
|
164
|
+
val isShowResult =
|
|
165
|
+
if (data?.hasKey("isShowResult") == true) data.getBoolean("isShowResult") else true
|
|
166
|
+
var paymentData: PaymentData? = null
|
|
167
|
+
if (amount != null && transactionId != null) {
|
|
168
|
+
paymentData = PaymentData(transactionId, amount, note, ipnUrl, extraData, isShowResult)
|
|
144
169
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
)
|
|
163
|
-
return
|
|
170
|
+
val openMiniAppData = getOpenMiniAppData(action, phone, paymentData)
|
|
171
|
+
payMEMiniApp?.openMiniApp(
|
|
172
|
+
getTypeOpenMiniApp(type),
|
|
173
|
+
openMiniAppData
|
|
174
|
+
)
|
|
175
|
+
return
|
|
176
|
+
}
|
|
177
|
+
if (action == "PAYMENT") {
|
|
178
|
+
val transaction = data?.getString("transaction")
|
|
179
|
+
val extraData =
|
|
180
|
+
if (data?.hasKey("extraData") == true) data.getMap("extraData")?.toHashMap()
|
|
181
|
+
?.filterValues { it != null }?.mapValues { it.value!! } else null
|
|
182
|
+
val isShowResult =
|
|
183
|
+
if (data?.hasKey("isShowResult") == true) data.getBoolean("isShowResult") else true
|
|
184
|
+
var paymentData: PaymentDirectData? = null
|
|
185
|
+
if (transaction != null) {
|
|
186
|
+
paymentData = PaymentDirectData(transaction, extraData, isShowResult)
|
|
164
187
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
188
|
+
val openMiniAppData = getOpenMiniAppData(action, phone, paymentData)
|
|
189
|
+
payMEMiniApp?.openMiniApp(
|
|
190
|
+
getTypeOpenMiniApp(type),
|
|
191
|
+
openMiniAppData
|
|
192
|
+
)
|
|
193
|
+
return
|
|
194
|
+
}
|
|
195
|
+
if (action == "TRANSFER_QR") {
|
|
196
|
+
val amount = data?.getInt("amount")
|
|
197
|
+
val bankNumber = data?.getString("bankNumber")
|
|
198
|
+
val swiftCode = data?.getString("swiftCode")
|
|
199
|
+
val cardHolder = data?.getString("cardHolder")
|
|
200
|
+
val extraData =
|
|
201
|
+
if (data?.hasKey("extraData") == true) data.getMap("extraData")?.toHashMap()
|
|
202
|
+
?.filterValues { it != null }?.mapValues { it.value!! } else null
|
|
203
|
+
val partnerTransaction =
|
|
204
|
+
if (data?.hasKey("partnerTransaction") == true) data.getString("partnerTransaction") else ""
|
|
205
|
+
val note = if (data?.hasKey("note") == true) data.getString("note") else ""
|
|
206
|
+
val isShowResult =
|
|
207
|
+
if (data?.hasKey("isShowResult") == true) data.getBoolean("isShowResult") else true
|
|
208
|
+
var transferQRData: TransferQRData? = null
|
|
209
|
+
if (amount != null && bankNumber != null && swiftCode != null && cardHolder != null) {
|
|
210
|
+
transferQRData = TransferQRData(
|
|
211
|
+
amount,
|
|
212
|
+
bankNumber,
|
|
213
|
+
swiftCode,
|
|
214
|
+
cardHolder,
|
|
215
|
+
note,
|
|
216
|
+
partnerTransaction,
|
|
217
|
+
extraData,
|
|
218
|
+
isShowResult
|
|
219
|
+
)
|
|
172
220
|
}
|
|
221
|
+
val openMiniAppData = getOpenMiniAppData(action, phone, transferQRData)
|
|
222
|
+
payMEMiniApp?.openMiniApp(
|
|
223
|
+
getTypeOpenMiniApp(type),
|
|
224
|
+
openMiniAppData
|
|
225
|
+
)
|
|
226
|
+
return
|
|
227
|
+
}
|
|
228
|
+
if (action == "OPEN" || action == "KYC" || action == "PAYME") {
|
|
229
|
+
val openMiniAppData = getOpenMiniAppData(action, phone)
|
|
230
|
+
payMEMiniApp?.openMiniApp(
|
|
231
|
+
getTypeOpenMiniApp(type),
|
|
232
|
+
openMiniAppData
|
|
233
|
+
)
|
|
234
|
+
return
|
|
235
|
+
}
|
|
173
236
|
}
|
|
174
237
|
|
|
175
238
|
private fun onResponse(actionOpenMiniApp: ActionOpenMiniApp, jsonObject: JSONObject?) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
239
|
+
if (jsonObject != null) {
|
|
240
|
+
try {
|
|
241
|
+
Log.d("PAYMELOG", "jsonObject $jsonObject")
|
|
242
|
+
val payload = JsonConvert.jsonToReact(jsonObject)
|
|
243
|
+
if (!payload.hasKey("action")) {
|
|
244
|
+
payload.putString("action", actionOpenMiniApp.toString())
|
|
245
|
+
}
|
|
246
|
+
sendEvent(
|
|
247
|
+
reactApplicationContext,
|
|
248
|
+
"onResponse", payload
|
|
249
|
+
)
|
|
250
|
+
} catch (e: Exception) {
|
|
251
|
+
Log.d("PAYMELOG", "exception $e")
|
|
190
252
|
}
|
|
253
|
+
}
|
|
191
254
|
}
|
|
192
255
|
|
|
193
256
|
private fun onError(actionOpenMiniApp: ActionOpenMiniApp, payMEError: PayMEError) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
257
|
+
val payload = Arguments.createMap()
|
|
258
|
+
payload.putString("action", actionOpenMiniApp.toString())
|
|
259
|
+
payload.putString("code", payMEError.code)
|
|
260
|
+
payload.putString("description", payMEError.description)
|
|
261
|
+
sendEvent(
|
|
262
|
+
reactApplicationContext,
|
|
263
|
+
"onError", payload
|
|
264
|
+
)
|
|
202
265
|
}
|
|
203
266
|
|
|
204
267
|
private fun getEnv(env: String): ENV {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
return ENV.PRODUCTION
|
|
210
|
-
}
|
|
268
|
+
if (env == ENV.SANDBOX.toString()) {
|
|
269
|
+
return ENV.SANDBOX
|
|
270
|
+
}
|
|
271
|
+
if (env == ENV.PRODUCTION.toString()) {
|
|
211
272
|
return ENV.PRODUCTION
|
|
273
|
+
}
|
|
274
|
+
return ENV.PRODUCTION
|
|
212
275
|
}
|
|
213
276
|
|
|
214
277
|
private fun getLocale(locale: String): Locale {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
return Locale.vi
|
|
220
|
-
}
|
|
278
|
+
if (locale == Locale.en.toString()) {
|
|
279
|
+
return Locale.en
|
|
280
|
+
}
|
|
281
|
+
if (locale == Locale.vi.toString()) {
|
|
221
282
|
return Locale.vi
|
|
283
|
+
}
|
|
284
|
+
return Locale.vi
|
|
222
285
|
}
|
|
223
286
|
|
|
224
287
|
private fun getTypeOpenMiniApp(type: String): OpenMiniAppType {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
return OpenMiniAppType.screen
|
|
230
|
-
}
|
|
288
|
+
if (type.lowercase() == OpenMiniAppType.modal.toString()) {
|
|
289
|
+
return OpenMiniAppType.modal
|
|
290
|
+
}
|
|
291
|
+
if (type.lowercase() == OpenMiniAppType.screen.toString()) {
|
|
231
292
|
return OpenMiniAppType.screen
|
|
232
|
-
|
|
293
|
+
}
|
|
294
|
+
return OpenMiniAppType.screen
|
|
295
|
+
// return OpenMiniAppType.screen
|
|
233
296
|
}
|
|
234
297
|
|
|
235
298
|
private fun getActionOpenMiniApp(action: String): ActionOpenMiniApp {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
299
|
+
return try {
|
|
300
|
+
ActionOpenMiniApp.valueOf(action.uppercase())
|
|
301
|
+
} catch (e: Exception) {
|
|
302
|
+
ActionOpenMiniApp.PAYME
|
|
303
|
+
}
|
|
241
304
|
}
|
|
242
305
|
|
|
243
306
|
private fun getOpenMiniAppData(
|
|
244
|
-
|
|
245
|
-
|
|
307
|
+
action: String,
|
|
308
|
+
phone: String,
|
|
246
309
|
): OpenMiniAppDataInterface {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
return OpenMiniAppPayMEData()
|
|
252
|
-
}
|
|
253
|
-
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.KYC) {
|
|
254
|
-
return OpenMiniAppKYCData(phone)
|
|
255
|
-
}
|
|
310
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.OPEN) {
|
|
311
|
+
return OpenMiniAppOpenData(phone)
|
|
312
|
+
}
|
|
313
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.PAYME) {
|
|
256
314
|
return OpenMiniAppPayMEData()
|
|
315
|
+
}
|
|
316
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.KYC) {
|
|
317
|
+
return OpenMiniAppKYCData(phone)
|
|
318
|
+
}
|
|
319
|
+
return OpenMiniAppPayMEData()
|
|
257
320
|
}
|
|
258
321
|
|
|
259
322
|
private fun getOpenMiniAppData(
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
323
|
+
action: String,
|
|
324
|
+
phone: String,
|
|
325
|
+
additionalData: DepositWithdrawTransferData? = null
|
|
263
326
|
): OpenMiniAppDataInterface {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
327
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.DEPOSIT && additionalData != null) {
|
|
328
|
+
return OpenMiniAppDepositData(phone, additionalData)
|
|
329
|
+
}
|
|
330
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.WITHDRAW && additionalData != null) {
|
|
331
|
+
return OpenMiniAppWithdrawData(phone, additionalData)
|
|
332
|
+
}
|
|
333
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.TRANSFER && additionalData != null) {
|
|
334
|
+
return OpenMiniAppTransferData(phone, additionalData)
|
|
335
|
+
}
|
|
336
|
+
return OpenMiniAppPayMEData()
|
|
274
337
|
}
|
|
275
338
|
|
|
276
339
|
private fun getOpenMiniAppData(
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
340
|
+
action: String,
|
|
341
|
+
phone: String,
|
|
342
|
+
paymentData: PaymentData? = null,
|
|
280
343
|
): OpenMiniAppDataInterface {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
344
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.PAY && paymentData != null) {
|
|
345
|
+
return OpenMiniAppPaymentData(phone, paymentData)
|
|
346
|
+
}
|
|
347
|
+
return OpenMiniAppPayMEData()
|
|
285
348
|
}
|
|
286
349
|
|
|
287
350
|
private fun getOpenMiniAppData(
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
351
|
+
action: String,
|
|
352
|
+
phone: String,
|
|
353
|
+
paymentData: PaymentDirectData? = null,
|
|
291
354
|
): OpenMiniAppDataInterface {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
355
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.PAYMENT && paymentData != null) {
|
|
356
|
+
return OpenMiniAppPaymentDirectData(phone, paymentData)
|
|
357
|
+
}
|
|
358
|
+
return OpenMiniAppPayMEData()
|
|
296
359
|
}
|
|
297
360
|
|
|
298
361
|
private fun getOpenMiniAppData(
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
362
|
+
action: String,
|
|
363
|
+
phone: String,
|
|
364
|
+
transferQRData: TransferQRData? = null,
|
|
302
365
|
): OpenMiniAppDataInterface {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
366
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.TRANSFER_QR && transferQRData != null) {
|
|
367
|
+
return OpenMiniAppTransferQRData(phone, transferQRData)
|
|
368
|
+
}
|
|
369
|
+
return OpenMiniAppPayMEData()
|
|
307
370
|
}
|
|
308
371
|
|
|
309
372
|
private fun getOpenMiniAppData(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
373
|
+
action: String,
|
|
374
|
+
phone: String,
|
|
375
|
+
additionalData: ServiceData? = null
|
|
313
376
|
): OpenMiniAppDataInterface {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
377
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.SERVICE && additionalData != null) {
|
|
378
|
+
return OpenMiniAppServiceData(phone, additionalData)
|
|
379
|
+
}
|
|
380
|
+
return OpenMiniAppPayMEData()
|
|
318
381
|
}
|
|
319
382
|
|
|
320
383
|
private fun sendEvent(reactContext: ReactContext, eventName: String, params: WritableMap?) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
384
|
+
if (eventNames.contains(eventName)) {
|
|
385
|
+
reactContext
|
|
386
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
387
|
+
.emit(eventName, params)
|
|
388
|
+
}
|
|
326
389
|
}
|
|
327
390
|
|
|
328
391
|
companion object {
|
package/lib/commonjs/index.js
CHANGED
|
@@ -30,5 +30,7 @@ function setLanguage(language) {
|
|
|
30
30
|
function close() {
|
|
31
31
|
return RNPayMEMiniApp.closeMiniApp();
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
// Updated for React Native 0.78.0: Instantiate NativeEventEmitter without passing the native module
|
|
35
|
+
const PayMEMiniAppEvents = exports.PayMEMiniAppEvents = new _reactNative.NativeEventEmitter();
|
|
34
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","RNPayMEMiniApp","NativeModules","PaymeMiniApp","init","appId","publicKey","privateKey","locale","env","mode","initPayME","open","type","openingParam","getBalance","phone","getAccountInfo","setLanguage","language","close","closeMiniApp","PayMEMiniAppEvents","exports","NativeEventEmitter"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AASA,MAAMC,cAAc,GAAGC,0BAAa,CAACC,YAAY;AAE1C,SAASC,IAAIA,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAClBC,MAAmB,GAAG,IAAI,EAC1BC,GAAa,GAAG,YAAY,EAC5BC,IAAe,GAAG,iBAAiB,EACnC;EACA,OAAOT,cAAc,CAACU,SAAS,CAC7BN,KAAK,EACLC,SAAS,EACTC,UAAU,EACVC,MAAM,EACNC,GAAG,EACHC,IACF,CAAC;AACH;AAEO,SAASE,IAAIA,CAACC,IAAsB,EAAEC,YAA+B,EAAE;EAC5E,OAAOb,cAAc,CAACW,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEO,SAASC,UAAUA,CAACC,KAAa,EAAE;EACxC,OAAOf,cAAc,CAACc,UAAU,CAACC,KAAK,CAAC;AACzC;AAEO,SAASC,cAAcA,CAACD,KAAa,EAAE;EAC5C,OAAOf,cAAc,CAACgB,cAAc,CAACD,KAAK,CAAC;AAC7C;AAEO,SAASE,WAAWA,CAACC,QAAgB,EAAE;EAC5C,OAAOlB,cAAc,CAACiB,WAAW,CAACC,QAAQ,CAAC;AAC7C;AAEO,SAASC,KAAKA,CAAA,EAAG;EACtB,OAAOnB,cAAc,CAACoB,YAAY,CAAC,CAAC;AACtC;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","RNPayMEMiniApp","NativeModules","PaymeMiniApp","init","appId","publicKey","privateKey","locale","env","mode","initPayME","open","type","openingParam","getBalance","phone","getAccountInfo","setLanguage","language","close","closeMiniApp","PayMEMiniAppEvents","exports","NativeEventEmitter"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AASA,MAAMC,cAAc,GAAGC,0BAAa,CAACC,YAAY;AAE1C,SAASC,IAAIA,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAClBC,MAAmB,GAAG,IAAI,EAC1BC,GAAa,GAAG,YAAY,EAC5BC,IAAe,GAAG,iBAAiB,EACnC;EACA,OAAOT,cAAc,CAACU,SAAS,CAC7BN,KAAK,EACLC,SAAS,EACTC,UAAU,EACVC,MAAM,EACNC,GAAG,EACHC,IACF,CAAC;AACH;AAEO,SAASE,IAAIA,CAACC,IAAsB,EAAEC,YAA+B,EAAE;EAC5E,OAAOb,cAAc,CAACW,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEO,SAASC,UAAUA,CAACC,KAAa,EAAE;EACxC,OAAOf,cAAc,CAACc,UAAU,CAACC,KAAK,CAAC;AACzC;AAEO,SAASC,cAAcA,CAACD,KAAa,EAAE;EAC5C,OAAOf,cAAc,CAACgB,cAAc,CAACD,KAAK,CAAC;AAC7C;AAEO,SAASE,WAAWA,CAACC,QAAgB,EAAE;EAC5C,OAAOlB,cAAc,CAACiB,WAAW,CAACC,QAAQ,CAAC;AAC7C;AAEO,SAASC,KAAKA,CAAA,EAAG;EACtB,OAAOnB,cAAc,CAACoB,YAAY,CAAC,CAAC;AACtC;;AAEA;AACO,MAAMC,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAIE,+BAAkB,CAAC,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -20,5 +20,7 @@ export function setLanguage(language) {
|
|
|
20
20
|
export function close() {
|
|
21
21
|
return RNPayMEMiniApp.closeMiniApp();
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
// Updated for React Native 0.78.0: Instantiate NativeEventEmitter without passing the native module
|
|
25
|
+
export const PayMEMiniAppEvents = new NativeEventEmitter();
|
|
24
26
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","NativeModules","RNPayMEMiniApp","PaymeMiniApp","init","appId","publicKey","privateKey","locale","env","mode","initPayME","open","type","openingParam","getBalance","phone","getAccountInfo","setLanguage","language","close","closeMiniApp","PayMEMiniAppEvents"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAShE,MAAMC,cAAc,GAAGD,aAAa,CAACE,YAAY;AAEjD,OAAO,SAASC,IAAIA,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAClBC,MAAmB,GAAG,IAAI,EAC1BC,GAAa,GAAG,YAAY,EAC5BC,IAAe,GAAG,iBAAiB,EACnC;EACA,OAAOR,cAAc,CAACS,SAAS,CAC7BN,KAAK,EACLC,SAAS,EACTC,UAAU,EACVC,MAAM,EACNC,GAAG,EACHC,IACF,CAAC;AACH;AAEA,OAAO,SAASE,IAAIA,CAACC,IAAsB,EAAEC,YAA+B,EAAE;EAC5E,OAAOZ,cAAc,CAACU,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEA,OAAO,SAASC,UAAUA,CAACC,KAAa,EAAE;EACxC,OAAOd,cAAc,CAACa,UAAU,CAACC,KAAK,CAAC;AACzC;AAEA,OAAO,SAASC,cAAcA,CAACD,KAAa,EAAE;EAC5C,OAAOd,cAAc,CAACe,cAAc,CAACD,KAAK,CAAC;AAC7C;AAEA,OAAO,SAASE,WAAWA,CAACC,QAAgB,EAAE;EAC5C,OAAOjB,cAAc,CAACgB,WAAW,CAACC,QAAQ,CAAC;AAC7C;AAEA,OAAO,SAASC,KAAKA,CAAA,EAAG;EACtB,OAAOlB,cAAc,CAACmB,YAAY,CAAC,CAAC;AACtC;
|
|
1
|
+
{"version":3,"names":["NativeEventEmitter","NativeModules","RNPayMEMiniApp","PaymeMiniApp","init","appId","publicKey","privateKey","locale","env","mode","initPayME","open","type","openingParam","getBalance","phone","getAccountInfo","setLanguage","language","close","closeMiniApp","PayMEMiniAppEvents"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAShE,MAAMC,cAAc,GAAGD,aAAa,CAACE,YAAY;AAEjD,OAAO,SAASC,IAAIA,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAClBC,MAAmB,GAAG,IAAI,EAC1BC,GAAa,GAAG,YAAY,EAC5BC,IAAe,GAAG,iBAAiB,EACnC;EACA,OAAOR,cAAc,CAACS,SAAS,CAC7BN,KAAK,EACLC,SAAS,EACTC,UAAU,EACVC,MAAM,EACNC,GAAG,EACHC,IACF,CAAC;AACH;AAEA,OAAO,SAASE,IAAIA,CAACC,IAAsB,EAAEC,YAA+B,EAAE;EAC5E,OAAOZ,cAAc,CAACU,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEA,OAAO,SAASC,UAAUA,CAACC,KAAa,EAAE;EACxC,OAAOd,cAAc,CAACa,UAAU,CAACC,KAAK,CAAC;AACzC;AAEA,OAAO,SAASC,cAAcA,CAACD,KAAa,EAAE;EAC5C,OAAOd,cAAc,CAACe,cAAc,CAACD,KAAK,CAAC;AAC7C;AAEA,OAAO,SAASE,WAAWA,CAACC,QAAgB,EAAE;EAC5C,OAAOjB,cAAc,CAACgB,WAAW,CAACC,QAAQ,CAAC;AAC7C;AAEA,OAAO,SAASC,KAAKA,CAAA,EAAG;EACtB,OAAOlB,cAAc,CAACmB,YAAY,CAAC,CAAC;AACtC;;AAEA;AACA,OAAO,MAAMC,kBAAkB,GAAG,IAAItB,kBAAkB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAiB,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAItB,wBAAgB,IAAI,CAClB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,WAAkB,EAC1B,GAAG,GAAE,QAAuB,EAC5B,IAAI,GAAE,SAA6B,OAUpC;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,OAE3E;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,OAEvC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,OAE3C;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,OAE3C;AAED,wBAAgB,KAAK,QAEpB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAiB,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAItB,wBAAgB,IAAI,CAClB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,WAAkB,EAC1B,GAAG,GAAE,QAAuB,EAC5B,IAAI,GAAE,SAA6B,OAUpC;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,OAE3E;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,OAEvC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,OAE3C;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,OAE3C;AAED,wBAAgB,KAAK,QAEpB;AAGD,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
|
|
@@ -3,12 +3,12 @@ type PayMEPaymentParam = {
|
|
|
3
3
|
transactionId: string;
|
|
4
4
|
note?: string;
|
|
5
5
|
ipnUrl: string;
|
|
6
|
-
extraData?: Record<string, object>;
|
|
6
|
+
extraData?: Record<string, string | object>;
|
|
7
7
|
isShowResult?: boolean;
|
|
8
8
|
};
|
|
9
9
|
type PayMEPaymentDirectParam = {
|
|
10
10
|
transaction: string;
|
|
11
|
-
extraData?: Record<string, object>;
|
|
11
|
+
extraData?: Record<string, string | object>;
|
|
12
12
|
isShowResult?: boolean;
|
|
13
13
|
};
|
|
14
14
|
type PayMETransferQRParam = {
|
|
@@ -18,19 +18,19 @@ type PayMETransferQRParam = {
|
|
|
18
18
|
cardHolder: string;
|
|
19
19
|
note?: string;
|
|
20
20
|
partnerTransaction?: string;
|
|
21
|
-
extraData?: Record<string, object>;
|
|
21
|
+
extraData?: Record<string, string | object>;
|
|
22
22
|
isShowResult?: boolean;
|
|
23
23
|
};
|
|
24
24
|
type PayMEServiceParam = {
|
|
25
25
|
service: string;
|
|
26
|
-
extraData?: Record<string, object>;
|
|
26
|
+
extraData?: Record<string, string | object>;
|
|
27
27
|
isBackToApp?: boolean;
|
|
28
28
|
isShowResult?: boolean;
|
|
29
29
|
};
|
|
30
30
|
type PayMEPayParam = {
|
|
31
31
|
amount?: number;
|
|
32
32
|
description?: string;
|
|
33
|
-
extraData?: Record<string, object>;
|
|
33
|
+
extraData?: Record<string, string | object>;
|
|
34
34
|
isBackToApp?: boolean;
|
|
35
35
|
isShowResult?: boolean;
|
|
36
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.type.d.ts","sourceRoot":"","sources":["../../../../src/index.type.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.type.d.ts","sourceRoot":"","sources":["../../../../src/index.type.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GACzB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,MAAM,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,MAAM,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GACzD;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,oBAAoB,CAAA;CAAE,GACpE;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,uBAAuB,CAAA;CAAE,GACpE;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GAC7D;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,aAAa,CAAA;CAAE,GACzD;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,aAAa,CAAA;CAAE,GAC1D;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC;AAE/D,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElD,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAiB,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAItB,wBAAgB,IAAI,CAClB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,WAAkB,EAC1B,GAAG,GAAE,QAAuB,EAC5B,IAAI,GAAE,SAA6B,OAUpC;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,OAE3E;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,OAEvC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,OAE3C;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,OAE3C;AAED,wBAAgB,KAAK,QAEpB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAiB,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAItB,wBAAgB,IAAI,CAClB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,WAAkB,EAC1B,GAAG,GAAE,QAAuB,EAC5B,IAAI,GAAE,SAA6B,OAUpC;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,OAE3E;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,OAEvC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,OAE3C;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,OAE3C;AAED,wBAAgB,KAAK,QAEpB;AAGD,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
|
|
@@ -3,12 +3,12 @@ type PayMEPaymentParam = {
|
|
|
3
3
|
transactionId: string;
|
|
4
4
|
note?: string;
|
|
5
5
|
ipnUrl: string;
|
|
6
|
-
extraData?: Record<string, object>;
|
|
6
|
+
extraData?: Record<string, string | object>;
|
|
7
7
|
isShowResult?: boolean;
|
|
8
8
|
};
|
|
9
9
|
type PayMEPaymentDirectParam = {
|
|
10
10
|
transaction: string;
|
|
11
|
-
extraData?: Record<string, object>;
|
|
11
|
+
extraData?: Record<string, string | object>;
|
|
12
12
|
isShowResult?: boolean;
|
|
13
13
|
};
|
|
14
14
|
type PayMETransferQRParam = {
|
|
@@ -18,19 +18,19 @@ type PayMETransferQRParam = {
|
|
|
18
18
|
cardHolder: string;
|
|
19
19
|
note?: string;
|
|
20
20
|
partnerTransaction?: string;
|
|
21
|
-
extraData?: Record<string, object>;
|
|
21
|
+
extraData?: Record<string, string | object>;
|
|
22
22
|
isShowResult?: boolean;
|
|
23
23
|
};
|
|
24
24
|
type PayMEServiceParam = {
|
|
25
25
|
service: string;
|
|
26
|
-
extraData?: Record<string, object>;
|
|
26
|
+
extraData?: Record<string, string | object>;
|
|
27
27
|
isBackToApp?: boolean;
|
|
28
28
|
isShowResult?: boolean;
|
|
29
29
|
};
|
|
30
30
|
type PayMEPayParam = {
|
|
31
31
|
amount?: number;
|
|
32
32
|
description?: string;
|
|
33
|
-
extraData?: Record<string, object>;
|
|
33
|
+
extraData?: Record<string, string | object>;
|
|
34
34
|
isBackToApp?: boolean;
|
|
35
35
|
isShowResult?: boolean;
|
|
36
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.type.d.ts","sourceRoot":"","sources":["../../../../src/index.type.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.type.d.ts","sourceRoot":"","sources":["../../../../src/index.type.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payme-mini-app",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.3",
|
|
4
4
|
"description": "Thư viện tích hợp PayME Miniapp",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@commitlint/config-conventional": "^17.0.2",
|
|
68
68
|
"@evilmartians/lefthook": "^1.5.0",
|
|
69
|
-
"@react-native-community/cli": "15.0.1",
|
|
70
69
|
"@react-native/eslint-config": "^0.73.1",
|
|
71
70
|
"@release-it/conventional-changelog": "^9.0.2",
|
|
72
71
|
"@types/jest": "^29.5.5",
|
|
@@ -78,9 +77,9 @@
|
|
|
78
77
|
"eslint-plugin-prettier": "^5.0.1",
|
|
79
78
|
"jest": "^29.7.0",
|
|
80
79
|
"prettier": "^3.0.3",
|
|
81
|
-
"react": "
|
|
82
|
-
"react-native": "0.
|
|
83
|
-
"react-native-builder-bob": "^0.
|
|
80
|
+
"react": "19.0.0",
|
|
81
|
+
"react-native": "0.78.0",
|
|
82
|
+
"react-native-builder-bob": "^0.37.0",
|
|
84
83
|
"release-it": "^17.10.0",
|
|
85
84
|
"turbo": "^1.10.7",
|
|
86
85
|
"typescript": "^5.2.2"
|
|
@@ -182,8 +181,8 @@
|
|
|
182
181
|
]
|
|
183
182
|
},
|
|
184
183
|
"create-react-native-library": {
|
|
185
|
-
"type": "module
|
|
184
|
+
"type": "legacy-module",
|
|
186
185
|
"languages": "kotlin-swift",
|
|
187
|
-
"version": "0.
|
|
186
|
+
"version": "0.48.3"
|
|
188
187
|
}
|
|
189
188
|
}
|
package/src/index.tsx
CHANGED
|
@@ -47,4 +47,5 @@ export function close() {
|
|
|
47
47
|
return RNPayMEMiniApp.closeMiniApp();
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
// Updated for React Native 0.78.0: Instantiate NativeEventEmitter without passing the native module
|
|
51
|
+
export const PayMEMiniAppEvents = new NativeEventEmitter();
|
package/src/index.type.ts
CHANGED
|
@@ -3,13 +3,13 @@ type PayMEPaymentParam = {
|
|
|
3
3
|
transactionId: string;
|
|
4
4
|
note?: string;
|
|
5
5
|
ipnUrl: string;
|
|
6
|
-
extraData?: Record<string, object>;
|
|
6
|
+
extraData?: Record<string, string | object>;
|
|
7
7
|
isShowResult?: boolean;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
type PayMEPaymentDirectParam = {
|
|
11
11
|
transaction: string;
|
|
12
|
-
extraData?: Record<string, object>;
|
|
12
|
+
extraData?: Record<string, string | object>;
|
|
13
13
|
isShowResult?: boolean;
|
|
14
14
|
};
|
|
15
15
|
|
|
@@ -20,13 +20,13 @@ type PayMETransferQRParam = {
|
|
|
20
20
|
cardHolder: string;
|
|
21
21
|
note?: string;
|
|
22
22
|
partnerTransaction?: string;
|
|
23
|
-
extraData?: Record<string, object>;
|
|
23
|
+
extraData?: Record<string, string | object>;
|
|
24
24
|
isShowResult?: boolean;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
type PayMEServiceParam = {
|
|
28
28
|
service: string;
|
|
29
|
-
extraData?: Record<string, object>;
|
|
29
|
+
extraData?: Record<string, string | object>;
|
|
30
30
|
isBackToApp?: boolean;
|
|
31
31
|
isShowResult?: boolean;
|
|
32
32
|
};
|
|
@@ -34,7 +34,7 @@ type PayMEServiceParam = {
|
|
|
34
34
|
type PayMEPayParam = {
|
|
35
35
|
amount?: number;
|
|
36
36
|
description?: string;
|
|
37
|
-
extraData?: Record<string, object>;
|
|
37
|
+
extraData?: Record<string, string | object>;
|
|
38
38
|
isBackToApp?: boolean;
|
|
39
39
|
isShowResult?: boolean;
|
|
40
40
|
};
|