payme-mini-app 0.4.8 → 0.4.10
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.
|
@@ -60,18 +60,32 @@ class RNPayMEMiniAppModule(reactContext: ReactApplicationContext) :
|
|
|
60
60
|
val action = openingParam.getString("action") ?: "PAYME"
|
|
61
61
|
val phone = openingParam.getString("phone") ?: ""
|
|
62
62
|
val data = openingParam.getMap("data")
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
var amount: Int? = null
|
|
64
|
+
var service: String? = null
|
|
65
|
+
if (action != "SERVICE") {
|
|
66
|
+
amount = data?.getInt("amount")
|
|
67
|
+
}
|
|
68
|
+
if (action == "SERVICE") {
|
|
69
|
+
service = data?.getString("service") ?: ""
|
|
70
|
+
}
|
|
71
|
+
var description: String? = null
|
|
72
|
+
if (action == "DEPOSIT" || action == "WITHDRAW" || action == "TRANSFER") {
|
|
73
|
+
description = data?.getString("description")
|
|
74
|
+
}
|
|
75
|
+
var transactionId: String? = null
|
|
76
|
+
var note: String? = null
|
|
77
|
+
var ipnUrl: String? = null
|
|
78
|
+
if (action == "PAY") {
|
|
79
|
+
transactionId = data?.getString("transactionId")
|
|
80
|
+
note = data?.getString("note")
|
|
81
|
+
ipnUrl = data?.getString("ipnUrl")
|
|
82
|
+
}
|
|
69
83
|
var paymentData: PaymentData? = null
|
|
70
84
|
var additionalData: DepositWithdrawTransferData? = null
|
|
71
85
|
if (amount != null && transactionId != null && action === "PAY") {
|
|
72
86
|
paymentData = PaymentData(transactionId, amount, note, ipnUrl)
|
|
73
87
|
}
|
|
74
|
-
if (action
|
|
88
|
+
if (action == "DEPOSIT" || action == "WITHDRAW" || action == "TRANSFER") {
|
|
75
89
|
additionalData = DepositWithdrawTransferData(description, amount)
|
|
76
90
|
}
|
|
77
91
|
val openMiniAppData = getOpenMiniAppData(action, phone, paymentData, additionalData, service)
|
|
@@ -131,19 +145,11 @@ class RNPayMEMiniAppModule(reactContext: ReactApplicationContext) :
|
|
|
131
145
|
}
|
|
132
146
|
|
|
133
147
|
private fun getActionOpenMiniApp(action: String): ActionOpenMiniApp {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return ActionOpenMiniApp.OPEN
|
|
139
|
-
}
|
|
140
|
-
if (action == ActionOpenMiniApp.PAY.toString()) {
|
|
141
|
-
return ActionOpenMiniApp.PAY
|
|
142
|
-
}
|
|
143
|
-
if (action == ActionOpenMiniApp.GET_BALANCE.toString()) {
|
|
144
|
-
return ActionOpenMiniApp.GET_BALANCE
|
|
148
|
+
return try {
|
|
149
|
+
ActionOpenMiniApp.valueOf(action.uppercase())
|
|
150
|
+
} catch (e: Exception) {
|
|
151
|
+
ActionOpenMiniApp.PAYME
|
|
145
152
|
}
|
|
146
|
-
return ActionOpenMiniApp.PAYME
|
|
147
153
|
}
|
|
148
154
|
|
|
149
155
|
private fun getOpenMiniAppData(
|