payme-mini-app 1.0.2 → 1.1.0-beta.1
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 +1 -1
- package/android/build.gradle +4 -4
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +0 -1
- package/android/src/main/java/com/paymeminiapp/PaymeMiniAppModule.kt +331 -0
- package/android/src/main/java/com/paymeminiapp/{RNPayMEMiniAppPackage.kt → PaymeMiniAppPackage.kt} +2 -2
- package/ios/{RNPayMEMiniApp.m → PaymeMiniApp.mm} +1 -3
- package/ios/{RNPayMEMiniApp.swift → PaymeMiniApp.swift} +2 -2
- package/lib/commonjs/index.js +3 -7
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.type.js.map +1 -1
- package/lib/module/index.js +4 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.type.js +1 -1
- package/lib/module/index.type.js.map +1 -1
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/{index.type.d.ts → commonjs/src/index.type.d.ts} +5 -5
- package/lib/typescript/commonjs/src/index.type.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/index.d.ts +10 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/index.type.d.ts +80 -0
- package/lib/typescript/module/src/index.type.d.ts.map +1 -0
- package/package.json +52 -23
- package/payme-mini-app.podspec +1 -2
- package/src/index.tsx +1 -1
- package/src/index.type.ts +5 -5
- package/android/src/main/java/com/paymeminiapp/JsonConvert.kt +0 -102
- package/android/src/main/java/com/paymeminiapp/RNPayMEMiniAppModule.kt +0 -333
- package/ios/RNPayMEMiniApp.xcodeproj/project.pbxproj +0 -283
- package/ios/RNPayMEMiniApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
- package/ios/RNPayMEMiniApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/RNPayMEMiniApp.xcodeproj/project.xcworkspace/xcuserdata/montossc.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNPayMEMiniApp.xcodeproj/xcuserdata/montossc.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/index.type.d.ts.map +0 -1
- /package/ios/{RNPayMEMiniApp-Bridging-Header.h → PaymeMiniApp-Bridging-Header.h} +0 -0
- /package/lib/typescript/{index.d.ts → commonjs/src/index.d.ts} +0 -0
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2024 Trần Minh Đạt
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
|
6
6
|
in the Software without restriction, including without limitation the rights
|
package/android/build.gradle
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
buildscript {
|
|
2
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["
|
|
3
|
+
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["PaymeMiniApp_kotlinVersion"]
|
|
4
4
|
|
|
5
5
|
repositories {
|
|
6
6
|
google()
|
|
@@ -31,11 +31,11 @@ if (isNewArchitectureEnabled()) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
def getExtOrDefault(name) {
|
|
34
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["
|
|
34
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["PaymeMiniApp_" + name]
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
def getExtOrIntegerDefault(name) {
|
|
38
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["
|
|
38
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["PaymeMiniApp_" + name]).toInteger()
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
def supportsNamespace() {
|
|
@@ -63,6 +63,7 @@ android {
|
|
|
63
63
|
defaultConfig {
|
|
64
64
|
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
65
65
|
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
66
|
+
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
buildTypes {
|
|
@@ -84,7 +85,6 @@ android {
|
|
|
84
85
|
repositories {
|
|
85
86
|
mavenCentral()
|
|
86
87
|
google()
|
|
87
|
-
maven { url 'https://jitpack.io' }
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
PaymeMiniApp_kotlinVersion=1.7.0
|
|
2
|
+
PaymeMiniApp_minSdkVersion=21
|
|
3
|
+
PaymeMiniApp_targetSdkVersion=31
|
|
4
|
+
PaymeMiniApp_compileSdkVersion=31
|
|
5
|
+
PaymeMiniApp_ndkversion=21.4.7075529
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
package com.paymeminiapp
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
4
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
5
|
+
import com.facebook.react.bridge.ReactMethod
|
|
6
|
+
import com.payme.sdk.PayMEMiniApp
|
|
7
|
+
import com.payme.sdk.models.*
|
|
8
|
+
import com.payme.sdk.ui.MiniAppFragment
|
|
9
|
+
import org.json.JSONObject
|
|
10
|
+
|
|
11
|
+
class PaymeMiniAppModule(reactContext: ReactApplicationContext) :
|
|
12
|
+
ReactContextBaseJavaModule(reactContext) {
|
|
13
|
+
private var payMEMiniApp: PayMEMiniApp? = null
|
|
14
|
+
override fun getName(): String {
|
|
15
|
+
return NAME
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
private val eventNames = arrayListOf("onResponse", "onError")
|
|
19
|
+
|
|
20
|
+
private var listenerCount = 0
|
|
21
|
+
|
|
22
|
+
@ReactMethod
|
|
23
|
+
fun addListener(eventName: String) {
|
|
24
|
+
if (listenerCount == 0) {
|
|
25
|
+
// Set up any upstream listeners or background tasks as necessary
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
listenerCount += 1
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@ReactMethod
|
|
32
|
+
fun removeListeners(count: Int) {
|
|
33
|
+
listenerCount -= count
|
|
34
|
+
if (listenerCount == 0) {
|
|
35
|
+
// Remove upstream listeners, stop unnecessary background tasks
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@ReactMethod
|
|
40
|
+
fun initPayME(appId: String, publicKey: String, privateKey: String, locale: String, env: String, mode: String) {
|
|
41
|
+
val fragmentActivity: Activity? = currentActivity
|
|
42
|
+
|
|
43
|
+
payMEMiniApp = fragmentActivity?.let {
|
|
44
|
+
PayMEMiniApp(
|
|
45
|
+
it, appId, publicKey, privateKey, getEnv(env), getLocale(locale)
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
// payMEMiniApp?.setLanguage(locale)
|
|
49
|
+
payMEMiniApp?.setMode(mode)
|
|
50
|
+
payMEMiniApp?.setUpListener(onResponse = { actionOpenMiniApp: ActionOpenMiniApp, jsonObject: JSONObject? ->
|
|
51
|
+
onResponse(actionOpenMiniApp, jsonObject)
|
|
52
|
+
},
|
|
53
|
+
onError = { actionOpenMiniApp: ActionOpenMiniApp, payMEError: PayMEError ->
|
|
54
|
+
onError(actionOpenMiniApp, payMEError)
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@ReactMethod
|
|
59
|
+
fun getBalance(phone: String) {
|
|
60
|
+
payMEMiniApp?.getBalance(phone)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@ReactMethod
|
|
64
|
+
fun getAccountInfo(phone: String) {
|
|
65
|
+
payMEMiniApp?.getAccountInformation(phone)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@ReactMethod
|
|
69
|
+
fun setLanguage(language: String) {
|
|
70
|
+
val locale = getLocale(language)
|
|
71
|
+
payMEMiniApp?.setLanguage(locale)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@ReactMethod
|
|
75
|
+
fun closeMiniApp() {
|
|
76
|
+
payMEMiniApp?.close()
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@ReactMethod
|
|
80
|
+
fun open(type: String, openingParam: ReadableMap) {
|
|
81
|
+
val action = openingParam.getString("action") ?: "PAYME"
|
|
82
|
+
val phone = openingParam.getString("phone") ?: ""
|
|
83
|
+
val data = openingParam.getMap("data")
|
|
84
|
+
|
|
85
|
+
if (action == "DEPOSIT" || action == "WITHDRAW" || action == "TRANSFER") {
|
|
86
|
+
val description = if (data?.hasKey("description") == true) data.getString("description") else ""
|
|
87
|
+
val extraData = if (data?.hasKey("extraData") == true) data.getMap("extraData")?.toHashMap() else null
|
|
88
|
+
val isBackToApp = if (data?.hasKey("isBackToApp") == true) data.getBoolean("isBackToApp") else true
|
|
89
|
+
val isShowResult = if (data?.hasKey("isShowResult") == true) data.getBoolean("isShowResult") else true
|
|
90
|
+
val amount = if (data?.hasKey("amount") == true) data.getInt("amount") else null
|
|
91
|
+
val additionalData = DepositWithdrawTransferData(description, amount, extraData, isBackToApp, isShowResult)
|
|
92
|
+
val openMiniAppData = getOpenMiniAppData(action, phone, additionalData)
|
|
93
|
+
payMEMiniApp?.openMiniApp(
|
|
94
|
+
getTypeOpenMiniApp(type),
|
|
95
|
+
openMiniAppData
|
|
96
|
+
)
|
|
97
|
+
return
|
|
98
|
+
}
|
|
99
|
+
if (action == "SERVICE") {
|
|
100
|
+
val service = data?.getString("service") ?: ""
|
|
101
|
+
val extraData = if (data?.hasKey("extraData") == true) data.getMap("extraData")?.toHashMap() else null
|
|
102
|
+
val isBackToApp = if (data?.hasKey("isBackToApp") == true) data.getBoolean("isBackToApp") else true
|
|
103
|
+
val isShowResult = if (data?.hasKey("isShowResult") == true) data.getBoolean("isShowResult") else true
|
|
104
|
+
val additionalData = ServiceData(service, extraData, isBackToApp, isShowResult)
|
|
105
|
+
val openMiniAppData = getOpenMiniAppData(action, phone, additionalData)
|
|
106
|
+
payMEMiniApp?.openMiniApp(
|
|
107
|
+
getTypeOpenMiniApp(type),
|
|
108
|
+
openMiniAppData
|
|
109
|
+
)
|
|
110
|
+
return
|
|
111
|
+
}
|
|
112
|
+
if (action == "PAY") {
|
|
113
|
+
val transactionId = data?.getString("transactionId")
|
|
114
|
+
val amount = data?.getInt("amount")
|
|
115
|
+
val note = if (data?.hasKey("note") == true) data.getString("note") else ""
|
|
116
|
+
val ipnUrl = if (data?.hasKey("ipnUrl") == true) data.getString("ipnUrl") else ""
|
|
117
|
+
val extraData = if (data?.hasKey("extraData") == true) data.getMap("extraData")?.toHashMap() else null
|
|
118
|
+
val isShowResult = if (data?.hasKey("isShowResult") == true) data.getBoolean("isShowResult") else true
|
|
119
|
+
var paymentData: PaymentData?= null
|
|
120
|
+
if (amount != null && transactionId != null) {
|
|
121
|
+
paymentData = PaymentData(transactionId, amount, note, ipnUrl, extraData, isShowResult)
|
|
122
|
+
}
|
|
123
|
+
val openMiniAppData = getOpenMiniAppData(action, phone, paymentData)
|
|
124
|
+
payMEMiniApp?.openMiniApp(
|
|
125
|
+
getTypeOpenMiniApp(type),
|
|
126
|
+
openMiniAppData
|
|
127
|
+
)
|
|
128
|
+
return
|
|
129
|
+
}
|
|
130
|
+
if (action == "PAYMENT") {
|
|
131
|
+
val transaction = data?.getString("transaction")
|
|
132
|
+
val extraData = if (data?.hasKey("extraData") == true) data.getMap("extraData")?.toHashMap() else null
|
|
133
|
+
val isShowResult = if (data?.hasKey("isShowResult") == true) data.getBoolean("isShowResult") else true
|
|
134
|
+
var paymentData: PaymentDirectData?= null
|
|
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
|
|
144
|
+
}
|
|
145
|
+
if (action == "TRANSFER_QR") {
|
|
146
|
+
val amount = data?.getInt("amount")
|
|
147
|
+
val bankNumber = data?.getString("bankNumber")
|
|
148
|
+
val swiftCode = data?.getString("swiftCode")
|
|
149
|
+
val cardHolder = data?.getString("cardHolder")
|
|
150
|
+
val extraData = if (data?.hasKey("extraData") == true) data.getMap("extraData")?.toHashMap() else null
|
|
151
|
+
val partnerTransaction = if (data?.hasKey("partnerTransaction") == true) data.getString("partnerTransaction") else ""
|
|
152
|
+
val note = if (data?.hasKey("note") == true) data.getString("note") else ""
|
|
153
|
+
val isShowResult = if (data?.hasKey("isShowResult") == true) data.getBoolean("isShowResult") else true
|
|
154
|
+
var transferQRData: TransferQRData?= null
|
|
155
|
+
if (amount != null && bankNumber != null && swiftCode != null && cardHolder != null) {
|
|
156
|
+
transferQRData = TransferQRData(amount, bankNumber, swiftCode, cardHolder, note, partnerTransaction, extraData, isShowResult)
|
|
157
|
+
}
|
|
158
|
+
val openMiniAppData = getOpenMiniAppData(action, phone, transferQRData)
|
|
159
|
+
payMEMiniApp?.openMiniApp(
|
|
160
|
+
getTypeOpenMiniApp(type),
|
|
161
|
+
openMiniAppData
|
|
162
|
+
)
|
|
163
|
+
return
|
|
164
|
+
}
|
|
165
|
+
if (action == "OPEN" || action == "KYC" || action == "PAYME") {
|
|
166
|
+
val openMiniAppData = getOpenMiniAppData(action, phone)
|
|
167
|
+
payMEMiniApp?.openMiniApp(
|
|
168
|
+
getTypeOpenMiniApp(type),
|
|
169
|
+
openMiniAppData
|
|
170
|
+
)
|
|
171
|
+
return
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
private fun onResponse(actionOpenMiniApp: ActionOpenMiniApp, jsonObject: JSONObject?) {
|
|
176
|
+
if (jsonObject != null) {
|
|
177
|
+
try {
|
|
178
|
+
Log.d("PAYMELOG", "jsonObject $jsonObject")
|
|
179
|
+
val payload = JsonConvert.jsonToReact(jsonObject)
|
|
180
|
+
if (!payload.hasKey("action")) {
|
|
181
|
+
payload.putString("action", actionOpenMiniApp.toString())
|
|
182
|
+
}
|
|
183
|
+
sendEvent(
|
|
184
|
+
reactApplicationContext,
|
|
185
|
+
"onResponse", payload
|
|
186
|
+
)
|
|
187
|
+
} catch (e: Exception) {
|
|
188
|
+
Log.d("PAYMELOG", "exception $e")
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
private fun onError(actionOpenMiniApp: ActionOpenMiniApp, payMEError: PayMEError) {
|
|
194
|
+
val payload = Arguments.createMap()
|
|
195
|
+
payload.putString("action", actionOpenMiniApp.toString())
|
|
196
|
+
payload.putString("code", payMEError.code)
|
|
197
|
+
payload.putString("description", payMEError.description)
|
|
198
|
+
sendEvent(
|
|
199
|
+
reactApplicationContext,
|
|
200
|
+
"onError", payload
|
|
201
|
+
)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
private fun getEnv(env: String): ENV {
|
|
205
|
+
if (env == ENV.SANDBOX.toString()) {
|
|
206
|
+
return ENV.SANDBOX
|
|
207
|
+
}
|
|
208
|
+
if (env == ENV.PRODUCTION.toString()) {
|
|
209
|
+
return ENV.PRODUCTION
|
|
210
|
+
}
|
|
211
|
+
return ENV.PRODUCTION
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
private fun getLocale(locale: String): Locale {
|
|
215
|
+
if (locale == Locale.en.toString()) {
|
|
216
|
+
return Locale.en
|
|
217
|
+
}
|
|
218
|
+
if (locale == Locale.vi.toString()) {
|
|
219
|
+
return Locale.vi
|
|
220
|
+
}
|
|
221
|
+
return Locale.vi
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
private fun getTypeOpenMiniApp(type: String): OpenMiniAppType {
|
|
225
|
+
if (type.lowercase() == OpenMiniAppType.modal.toString()) {
|
|
226
|
+
return OpenMiniAppType.modal
|
|
227
|
+
}
|
|
228
|
+
if (type.lowercase() == OpenMiniAppType.screen.toString()) {
|
|
229
|
+
return OpenMiniAppType.screen
|
|
230
|
+
}
|
|
231
|
+
return OpenMiniAppType.screen
|
|
232
|
+
// return OpenMiniAppType.screen
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
private fun getActionOpenMiniApp(action: String): ActionOpenMiniApp {
|
|
236
|
+
return try {
|
|
237
|
+
ActionOpenMiniApp.valueOf(action.uppercase())
|
|
238
|
+
} catch (e: Exception) {
|
|
239
|
+
ActionOpenMiniApp.PAYME
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
private fun getOpenMiniAppData(
|
|
244
|
+
action: String,
|
|
245
|
+
phone: String,
|
|
246
|
+
): OpenMiniAppDataInterface {
|
|
247
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.OPEN) {
|
|
248
|
+
return OpenMiniAppOpenData(phone)
|
|
249
|
+
}
|
|
250
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.PAYME) {
|
|
251
|
+
return OpenMiniAppPayMEData()
|
|
252
|
+
}
|
|
253
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.KYC) {
|
|
254
|
+
return OpenMiniAppKYCData(phone)
|
|
255
|
+
}
|
|
256
|
+
return OpenMiniAppPayMEData()
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
private fun getOpenMiniAppData(
|
|
260
|
+
action: String,
|
|
261
|
+
phone: String,
|
|
262
|
+
additionalData: DepositWithdrawTransferData? = null
|
|
263
|
+
): OpenMiniAppDataInterface {
|
|
264
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.DEPOSIT && additionalData != null) {
|
|
265
|
+
return OpenMiniAppDepositData(phone, additionalData)
|
|
266
|
+
}
|
|
267
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.WITHDRAW && additionalData != null) {
|
|
268
|
+
return OpenMiniAppWithdrawData(phone, additionalData)
|
|
269
|
+
}
|
|
270
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.TRANSFER && additionalData != null) {
|
|
271
|
+
return OpenMiniAppTransferData(phone, additionalData)
|
|
272
|
+
}
|
|
273
|
+
return OpenMiniAppPayMEData()
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
private fun getOpenMiniAppData(
|
|
277
|
+
action: String,
|
|
278
|
+
phone: String,
|
|
279
|
+
paymentData: PaymentData? = null,
|
|
280
|
+
): OpenMiniAppDataInterface {
|
|
281
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.PAY && paymentData != null) {
|
|
282
|
+
return OpenMiniAppPaymentData(phone, paymentData)
|
|
283
|
+
}
|
|
284
|
+
return OpenMiniAppPayMEData()
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
private fun getOpenMiniAppData(
|
|
288
|
+
action: String,
|
|
289
|
+
phone: String,
|
|
290
|
+
paymentData: PaymentDirectData? = null,
|
|
291
|
+
): OpenMiniAppDataInterface {
|
|
292
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.PAYMENT && paymentData != null) {
|
|
293
|
+
return OpenMiniAppPaymentDirectData(phone, paymentData)
|
|
294
|
+
}
|
|
295
|
+
return OpenMiniAppPayMEData()
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
private fun getOpenMiniAppData(
|
|
299
|
+
action: String,
|
|
300
|
+
phone: String,
|
|
301
|
+
transferQRData: TransferQRData? = null,
|
|
302
|
+
): OpenMiniAppDataInterface {
|
|
303
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.TRANSFER_QR && transferQRData != null) {
|
|
304
|
+
return OpenMiniAppTransferQRData(phone, transferQRData)
|
|
305
|
+
}
|
|
306
|
+
return OpenMiniAppPayMEData()
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
private fun getOpenMiniAppData(
|
|
310
|
+
action: String,
|
|
311
|
+
phone: String,
|
|
312
|
+
additionalData: ServiceData? = null
|
|
313
|
+
): OpenMiniAppDataInterface {
|
|
314
|
+
if (getActionOpenMiniApp(action) == ActionOpenMiniApp.SERVICE && additionalData != null) {
|
|
315
|
+
return OpenMiniAppServiceData(phone, additionalData)
|
|
316
|
+
}
|
|
317
|
+
return OpenMiniAppPayMEData()
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
private fun sendEvent(reactContext: ReactContext, eventName: String, params: WritableMap?) {
|
|
321
|
+
if (eventNames.contains(eventName)) {
|
|
322
|
+
reactContext
|
|
323
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
324
|
+
.emit(eventName, params)
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
companion object {
|
|
329
|
+
const val NAME = "PaymeMiniApp"
|
|
330
|
+
}
|
|
331
|
+
}
|
package/android/src/main/java/com/paymeminiapp/{RNPayMEMiniAppPackage.kt → PaymeMiniAppPackage.kt}
RENAMED
|
@@ -6,9 +6,9 @@ import com.facebook.react.bridge.ReactApplicationContext
|
|
|
6
6
|
import com.facebook.react.uimanager.ViewManager
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class
|
|
9
|
+
class PaymeMiniAppPackage : ReactPackage {
|
|
10
10
|
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
|
|
11
|
-
return listOf(
|
|
11
|
+
return listOf(PaymeMiniAppModule(reactContext))
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#import <React/RCTBridgeModule.h>
|
|
2
2
|
#import <React/RCTEventEmitter.h>
|
|
3
3
|
|
|
4
|
-
@interface RCT_EXTERN_MODULE(
|
|
4
|
+
@interface RCT_EXTERN_MODULE(PaymeMiniApp, RCTEventEmitter)
|
|
5
5
|
|
|
6
6
|
RCT_EXTERN_METHOD(initPayME:(NSString*)appId publicKey:(NSString)publicKey privateKey:(NSString)privateKey locale:(NSString)locale env:(NSString)env mode:(NSString)mode)
|
|
7
7
|
RCT_EXTERN_METHOD(open:(NSString*)type param:(NSDictionary)param)
|
|
@@ -16,5 +16,3 @@ RCT_EXTERN_METHOD(closeMiniApp)
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
@end
|
|
19
|
-
|
|
20
|
-
|
package/lib/commonjs/index.js
CHANGED
|
@@ -11,11 +11,8 @@ exports.init = init;
|
|
|
11
11
|
exports.open = open;
|
|
12
12
|
exports.setLanguage = setLanguage;
|
|
13
13
|
var _reactNative = require("react-native");
|
|
14
|
-
const RNPayMEMiniApp = _reactNative.NativeModules.
|
|
15
|
-
function init(appId, publicKey, privateKey) {
|
|
16
|
-
let locale = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'vi';
|
|
17
|
-
let env = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'PRODUCTION';
|
|
18
|
-
let mode = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'miniapp_product';
|
|
14
|
+
const RNPayMEMiniApp = _reactNative.NativeModules.PaymeMiniApp;
|
|
15
|
+
function init(appId, publicKey, privateKey, locale = 'vi', env = 'PRODUCTION', mode = 'miniapp_product') {
|
|
19
16
|
return RNPayMEMiniApp.initPayME(appId, publicKey, privateKey, locale, env, mode);
|
|
20
17
|
}
|
|
21
18
|
function open(type, openingParam) {
|
|
@@ -33,6 +30,5 @@ function setLanguage(language) {
|
|
|
33
30
|
function close() {
|
|
34
31
|
return RNPayMEMiniApp.closeMiniApp();
|
|
35
32
|
}
|
|
36
|
-
const PayMEMiniAppEvents = new _reactNative.NativeEventEmitter(RNPayMEMiniApp);
|
|
37
|
-
exports.PayMEMiniAppEvents = PayMEMiniAppEvents;
|
|
33
|
+
const PayMEMiniAppEvents = exports.PayMEMiniAppEvents = new _reactNative.NativeEventEmitter(RNPayMEMiniApp);
|
|
38
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RNPayMEMiniApp","NativeModules","init","appId","publicKey","privateKey","locale","env","mode","initPayME","open","type","openingParam","getBalance","phone","getAccountInfo","setLanguage","language","close","closeMiniApp","PayMEMiniAppEvents","NativeEventEmitter"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;AAAA;AASA,
|
|
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;AAEO,MAAMC,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAIE,+BAAkB,CAACvB,cAAc,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.type.ts"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.type.ts"],"mappings":"","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
import { NativeEventEmitter, NativeModules } from 'react-native';
|
|
2
|
-
const RNPayMEMiniApp = NativeModules.
|
|
3
|
-
export function init(appId, publicKey, privateKey) {
|
|
4
|
-
let locale = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'vi';
|
|
5
|
-
let env = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'PRODUCTION';
|
|
6
|
-
let mode = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'miniapp_product';
|
|
4
|
+
const RNPayMEMiniApp = NativeModules.PaymeMiniApp;
|
|
5
|
+
export function init(appId, publicKey, privateKey, locale = 'vi', env = 'PRODUCTION', mode = 'miniapp_product') {
|
|
7
6
|
return RNPayMEMiniApp.initPayME(appId, publicKey, privateKey, locale, env, mode);
|
|
8
7
|
}
|
|
9
8
|
export function open(type, openingParam) {
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","NativeModules","RNPayMEMiniApp","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,
|
|
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,OAAO,MAAMC,kBAAkB,GAAG,IAAItB,kBAAkB,CAACE,cAAc,CAAC","ignoreList":[]}
|
package/lib/module/index.type.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
//# sourceMappingURL=index.type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.type.ts"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.type.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +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;AAED,eAAO,MAAM,kBAAkB,oBAAyC,CAAC"}
|
|
@@ -3,12 +3,12 @@ type PayMEPaymentParam = {
|
|
|
3
3
|
transactionId: string;
|
|
4
4
|
note?: string;
|
|
5
5
|
ipnUrl: string;
|
|
6
|
-
extraData?: Record<string,
|
|
6
|
+
extraData?: Record<string, object>;
|
|
7
7
|
isShowResult?: boolean;
|
|
8
8
|
};
|
|
9
9
|
type PayMEPaymentDirectParam = {
|
|
10
10
|
transaction: string;
|
|
11
|
-
extraData?: Record<string,
|
|
11
|
+
extraData?: Record<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,
|
|
21
|
+
extraData?: Record<string, object>;
|
|
22
22
|
isShowResult?: boolean;
|
|
23
23
|
};
|
|
24
24
|
type PayMEServiceParam = {
|
|
25
25
|
service: string;
|
|
26
|
-
extraData?: Record<string,
|
|
26
|
+
extraData?: Record<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,
|
|
33
|
+
extraData?: Record<string, object>;
|
|
34
34
|
isBackToApp?: boolean;
|
|
35
35
|
isShowResult?: boolean;
|
|
36
36
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.type.d.ts","sourceRoot":"","sources":["../../../../src/index.type.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NativeEventEmitter } from 'react-native';
|
|
2
|
+
import type { PayMEEnv, PayMELocale, PayMEMode, PayMEOpeningParam, PayMEOpeningType } from './index.type';
|
|
3
|
+
export declare function init(appId: string, publicKey: string, privateKey: string, locale?: PayMELocale, env?: PayMEEnv, mode?: PayMEMode): any;
|
|
4
|
+
export declare function open(type: PayMEOpeningType, openingParam: PayMEOpeningParam): any;
|
|
5
|
+
export declare function getBalance(phone: string): any;
|
|
6
|
+
export declare function getAccountInfo(phone: string): any;
|
|
7
|
+
export declare function setLanguage(language: string): any;
|
|
8
|
+
export declare function close(): any;
|
|
9
|
+
export declare const PayMEMiniAppEvents: NativeEventEmitter;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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;AAED,eAAO,MAAM,kBAAkB,oBAAyC,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
type PayMEPaymentParam = {
|
|
2
|
+
amount: number;
|
|
3
|
+
transactionId: string;
|
|
4
|
+
note?: string;
|
|
5
|
+
ipnUrl: string;
|
|
6
|
+
extraData?: Record<string, object>;
|
|
7
|
+
isShowResult?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type PayMEPaymentDirectParam = {
|
|
10
|
+
transaction: string;
|
|
11
|
+
extraData?: Record<string, object>;
|
|
12
|
+
isShowResult?: boolean;
|
|
13
|
+
};
|
|
14
|
+
type PayMETransferQRParam = {
|
|
15
|
+
amount: number;
|
|
16
|
+
bankNumber: string;
|
|
17
|
+
swiftCode: string;
|
|
18
|
+
cardHolder: string;
|
|
19
|
+
note?: string;
|
|
20
|
+
partnerTransaction?: string;
|
|
21
|
+
extraData?: Record<string, object>;
|
|
22
|
+
isShowResult?: boolean;
|
|
23
|
+
};
|
|
24
|
+
type PayMEServiceParam = {
|
|
25
|
+
service: string;
|
|
26
|
+
extraData?: Record<string, object>;
|
|
27
|
+
isBackToApp?: boolean;
|
|
28
|
+
isShowResult?: boolean;
|
|
29
|
+
};
|
|
30
|
+
type PayMEPayParam = {
|
|
31
|
+
amount?: number;
|
|
32
|
+
description?: string;
|
|
33
|
+
extraData?: Record<string, object>;
|
|
34
|
+
isBackToApp?: boolean;
|
|
35
|
+
isShowResult?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export type PayMEOpeningParam = {
|
|
38
|
+
action: 'PAYME';
|
|
39
|
+
phone: string;
|
|
40
|
+
} | {
|
|
41
|
+
action: 'OPEN';
|
|
42
|
+
phone: string;
|
|
43
|
+
} | {
|
|
44
|
+
action: 'KYC';
|
|
45
|
+
phone: string;
|
|
46
|
+
} | {
|
|
47
|
+
action: 'PAY';
|
|
48
|
+
phone: string;
|
|
49
|
+
data: PayMEPaymentParam;
|
|
50
|
+
} | {
|
|
51
|
+
action: 'TRANSFER_QR';
|
|
52
|
+
phone: string;
|
|
53
|
+
data: PayMETransferQRParam;
|
|
54
|
+
} | {
|
|
55
|
+
action: 'PAYMENT';
|
|
56
|
+
phone?: string;
|
|
57
|
+
data: PayMEPaymentDirectParam;
|
|
58
|
+
} | {
|
|
59
|
+
action: 'SERVICE';
|
|
60
|
+
phone: string;
|
|
61
|
+
data: PayMEServiceParam;
|
|
62
|
+
} | {
|
|
63
|
+
action: 'DEPOSIT';
|
|
64
|
+
phone: string;
|
|
65
|
+
data: PayMEPayParam;
|
|
66
|
+
} | {
|
|
67
|
+
action: 'WITHDRAW';
|
|
68
|
+
phone: string;
|
|
69
|
+
data: PayMEPayParam;
|
|
70
|
+
} | {
|
|
71
|
+
action: 'TRANSFER';
|
|
72
|
+
phone: string;
|
|
73
|
+
data: PayMEPayParam;
|
|
74
|
+
};
|
|
75
|
+
export type PayMEEnv = 'PRODUCTION' | 'SANDBOX';
|
|
76
|
+
export type PayMEMode = 'miniapp_sandbox' | 'miniapp_product';
|
|
77
|
+
export type PayMEOpeningType = 'screen' | 'modal';
|
|
78
|
+
export type PayMELocale = 'vi' | 'en';
|
|
79
|
+
export {};
|
|
80
|
+
//# sourceMappingURL=index.type.d.ts.map
|