payme-mini-app 0.5.0 → 0.5.2
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 +1 -1
- package/android/src/main/java/com/paymeminiapp/RNPayMEMiniAppModule.kt +26 -6
- package/ios/RNPayMEMiniApp.m +2 -1
- package/ios/RNPayMEMiniApp.swift +19 -7
- package/ios/RNPayMEMiniApp.xcodeproj/project.xcworkspace/xcuserdata/dattm.tran.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/lib/commonjs/index.js +8 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +7 -3
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +3 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/index.type.d.ts +5 -0
- package/lib/typescript/index.type.d.ts.map +1 -1
- package/package.json +1 -1
- package/payme-mini-app.podspec +1 -1
- package/src/index.tsx +14 -1
- package/src/index.type.ts +6 -0
package/android/build.gradle
CHANGED
|
@@ -74,7 +74,7 @@ dependencies {
|
|
|
74
74
|
//noinspection GradleDynamicVersion
|
|
75
75
|
implementation "com.facebook.react:react-native"
|
|
76
76
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
77
|
-
implementation 'com.github.PayME-Miniapp:native-android:0.0.
|
|
77
|
+
implementation 'com.github.PayME-Miniapp:native-android:0.0.81'
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
if (isNewArchitectureEnabled()) {
|
|
@@ -37,10 +37,11 @@ class RNPayMEMiniAppModule(reactContext: ReactApplicationContext) :
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
@ReactMethod
|
|
40
|
-
fun initPayME(appId: String, publicKey: String, privateKey: String, env: String, mode: String) {
|
|
40
|
+
fun initPayME(appId: String, publicKey: String, privateKey: String, locale: String, env: String, mode: String) {
|
|
41
41
|
payMEMiniApp = PayMEMiniApp(
|
|
42
|
-
reactApplicationContext.applicationContext, appId, publicKey, privateKey, getEnv(env)
|
|
42
|
+
reactApplicationContext.applicationContext, appId, publicKey, privateKey, getEnv(env), getLocale(locale)
|
|
43
43
|
)
|
|
44
|
+
// payMEMiniApp?.setLanguage(locale)
|
|
44
45
|
payMEMiniApp?.setMode(mode)
|
|
45
46
|
payMEMiniApp?.setUpListener(onResponse = { actionOpenMiniApp: ActionOpenMiniApp, jsonObject: JSONObject? ->
|
|
46
47
|
onResponse(actionOpenMiniApp, jsonObject)
|
|
@@ -60,6 +61,11 @@ class RNPayMEMiniAppModule(reactContext: ReactApplicationContext) :
|
|
|
60
61
|
payMEMiniApp?.getAccountInformation(phone)
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
@ReactMethod
|
|
65
|
+
fun setLanguage(language: Locale) {
|
|
66
|
+
payMEMiniApp?.setLanguage(language)
|
|
67
|
+
}
|
|
68
|
+
|
|
63
69
|
@ReactMethod
|
|
64
70
|
fun open(type: String, openingParam: ReadableMap) {
|
|
65
71
|
val action = openingParam.getString("action") ?: "PAYME"
|
|
@@ -69,8 +75,9 @@ class RNPayMEMiniAppModule(reactContext: ReactApplicationContext) :
|
|
|
69
75
|
if (action == "DEPOSIT" || action == "WITHDRAW" || action == "TRANSFER") {
|
|
70
76
|
val description = if (data?.hasKey("description") == true) data.getString("description") else ""
|
|
71
77
|
val isBackToApp = if (data?.hasKey("isBackToApp") == true) data.getBoolean("isBackToApp") else true
|
|
78
|
+
val isShowResult = if (data?.hasKey("isShowResult") == true) data.getBoolean("isShowResult") else true
|
|
72
79
|
val amount = if (data?.hasKey("amount") == true) data.getInt("amount") else null
|
|
73
|
-
val additionalData = DepositWithdrawTransferData(description, amount, isBackToApp)
|
|
80
|
+
val additionalData = DepositWithdrawTransferData(description, amount, isBackToApp, isShowResult)
|
|
74
81
|
val openMiniAppData = getOpenMiniAppData(action, phone, additionalData)
|
|
75
82
|
payMEMiniApp?.openMiniApp(
|
|
76
83
|
getTypeOpenMiniApp(type),
|
|
@@ -81,7 +88,8 @@ class RNPayMEMiniAppModule(reactContext: ReactApplicationContext) :
|
|
|
81
88
|
if (action == "SERVICE") {
|
|
82
89
|
val service = data?.getString("service") ?: ""
|
|
83
90
|
val isBackToApp = if (data?.hasKey("isBackToApp") == true) data.getBoolean("isBackToApp") else true
|
|
84
|
-
val
|
|
91
|
+
val isShowResult = if (data?.hasKey("isShowResult") == true) data.getBoolean("isShowResult") else true
|
|
92
|
+
val additionalData = ServiceData(service, isBackToApp, isShowResult)
|
|
85
93
|
val openMiniAppData = getOpenMiniAppData(action, phone, additionalData)
|
|
86
94
|
payMEMiniApp?.openMiniApp(
|
|
87
95
|
getTypeOpenMiniApp(type),
|
|
@@ -94,9 +102,10 @@ class RNPayMEMiniAppModule(reactContext: ReactApplicationContext) :
|
|
|
94
102
|
val amount = data?.getInt("amount")
|
|
95
103
|
val note = if (data?.hasKey("note") == true) data.getString("note") else ""
|
|
96
104
|
val ipnUrl = if (data?.hasKey("ipnUrl") == true) data.getString("ipnUrl") else ""
|
|
105
|
+
val isShowResult = if (data?.hasKey("isShowResult") == true) data.getBoolean("isShowResult") else true
|
|
97
106
|
var paymentData: PaymentData?= null
|
|
98
107
|
if (amount != null && transactionId != null) {
|
|
99
|
-
paymentData = PaymentData(transactionId, amount, note, ipnUrl)
|
|
108
|
+
paymentData = PaymentData(transactionId, amount, note, ipnUrl, isShowResult)
|
|
100
109
|
}
|
|
101
110
|
val openMiniAppData = getOpenMiniAppData(action, phone, paymentData)
|
|
102
111
|
payMEMiniApp?.openMiniApp(
|
|
@@ -107,9 +116,10 @@ class RNPayMEMiniAppModule(reactContext: ReactApplicationContext) :
|
|
|
107
116
|
}
|
|
108
117
|
if (action == "PAYMENT") {
|
|
109
118
|
val transaction = data?.getString("transaction")
|
|
119
|
+
val isShowResult = if (data?.hasKey("isShowResult") == true) data.getBoolean("isShowResult") else true
|
|
110
120
|
var paymentData: PaymentDirectData?= null
|
|
111
121
|
if (transaction != null) {
|
|
112
|
-
paymentData = PaymentDirectData(transaction)
|
|
122
|
+
paymentData = PaymentDirectData(transaction, isShowResult)
|
|
113
123
|
}
|
|
114
124
|
val openMiniAppData = getOpenMiniAppData(action, phone, paymentData)
|
|
115
125
|
payMEMiniApp?.openMiniApp(
|
|
@@ -167,6 +177,16 @@ class RNPayMEMiniAppModule(reactContext: ReactApplicationContext) :
|
|
|
167
177
|
return ENV.PRODUCTION
|
|
168
178
|
}
|
|
169
179
|
|
|
180
|
+
private fun getLocale(locale: String): Locale {
|
|
181
|
+
if (locale == Locale.en.toString()) {
|
|
182
|
+
return Locale.en
|
|
183
|
+
}
|
|
184
|
+
if (locale == Locale.vi.toString()) {
|
|
185
|
+
return Locale.vi
|
|
186
|
+
}
|
|
187
|
+
return Locale.vi
|
|
188
|
+
}
|
|
189
|
+
|
|
170
190
|
private fun getTypeOpenMiniApp(type: String): OpenMiniAppType {
|
|
171
191
|
// if (type.lowercase() == OpenMiniAppType.modal.toString()) {
|
|
172
192
|
// return OpenMiniAppType.modal
|
package/ios/RNPayMEMiniApp.m
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
@interface RCT_EXTERN_MODULE(RNPayMEMiniApp, RCTEventEmitter)
|
|
5
5
|
|
|
6
|
-
RCT_EXTERN_METHOD(initPayME:(NSString*)appId publicKey:(NSString)publicKey privateKey:(NSString)privateKey env:(NSString)env mode:(NSString)mode)
|
|
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)
|
|
8
8
|
RCT_EXTERN_METHOD(getBalance:(NSString*)phone)
|
|
9
9
|
RCT_EXTERN_METHOD(getAccountInfo:(NSString*)phone)
|
|
10
|
+
RCT_EXTERN_METHOD(setLanguage:(NSString*)language)
|
|
10
11
|
|
|
11
12
|
+ (BOOL)requiresMainQueueSetup
|
|
12
13
|
{
|
package/ios/RNPayMEMiniApp.swift
CHANGED
|
@@ -5,12 +5,15 @@ class RNPayMEMiniApp: RCTEventEmitter, PayMEDelegate {
|
|
|
5
5
|
var payme: PayME!
|
|
6
6
|
|
|
7
7
|
@objc func initPayME(
|
|
8
|
-
_ appId: String, publicKey: String, privateKey: String,
|
|
8
|
+
_ appId: String, publicKey: String, privateKey: String,
|
|
9
|
+
locale: String? = "vi",
|
|
10
|
+
env: String? = "PRODUCTION",
|
|
9
11
|
mode: String? = "miniapp_product"
|
|
10
12
|
) {
|
|
11
13
|
DispatchQueue.main.sync {
|
|
12
14
|
PayMEConfig.instance.setMode(mode ?? "miniapp_product")
|
|
13
15
|
PayMEConfig.instance.env = (env == "SANDBOX") ? .sbx : .prod
|
|
16
|
+
PayMEConfig.instance.locale = (locale == "en") ? .en : .vi
|
|
14
17
|
self.payme = PayME(key: PayMEKey(appId: appId, publicKey: publicKey, privateKey: privateKey))
|
|
15
18
|
self.payme.delegate = self
|
|
16
19
|
}
|
|
@@ -39,24 +42,27 @@ class RNPayMEMiniApp: RCTEventEmitter, PayMEDelegate {
|
|
|
39
42
|
case "PAY":
|
|
40
43
|
return PayMEPaymentParam(
|
|
41
44
|
amount: data["amount"] as! Int, transactionId: data["transactionId"] as! String,
|
|
42
|
-
note: data["note"] as? String, ipnUrl: data["ipnUrl"] as? String
|
|
45
|
+
note: data["note"] as? String, ipnUrl: data["ipnUrl"] as? String,
|
|
46
|
+
isShowResult: data["isShowResult"] as? Bool)
|
|
43
47
|
case "PAYMENT":
|
|
44
|
-
return PayMEPaymentDirectParam(
|
|
48
|
+
return PayMEPaymentDirectParam(
|
|
49
|
+
transaction: data["transaction"] as! String, isShowResult: data["isShowResult"] as? Bool)
|
|
45
50
|
case "SERVICE":
|
|
46
51
|
return PayMEServiceParam(
|
|
47
|
-
service: data["service"] as! String, isBackToApp: data["isBackToApp"] as? Bool
|
|
52
|
+
service: data["service"] as! String, isBackToApp: data["isBackToApp"] as? Bool,
|
|
53
|
+
isShowResult: data["isShowResult"] as? Bool)
|
|
48
54
|
case "DEPOSIT":
|
|
49
55
|
return PayMEPayParam(
|
|
50
56
|
amount: data["amount"] as? Int, description: data["description"] as? String,
|
|
51
|
-
isBackToApp: data["isBackToApp"] as? Bool)
|
|
57
|
+
isBackToApp: data["isBackToApp"] as? Bool, isShowResult: data["isShowResult"] as? Bool)
|
|
52
58
|
case "WITHDRAW":
|
|
53
59
|
return PayMEPayParam(
|
|
54
60
|
amount: data["amount"] as? Int, description: data["description"] as? String,
|
|
55
|
-
isBackToApp: data["isBackToApp"] as? Bool)
|
|
61
|
+
isBackToApp: data["isBackToApp"] as? Bool, isShowResult: data["isShowResult"] as? Bool)
|
|
56
62
|
case "TRANSFER":
|
|
57
63
|
return PayMEPayParam(
|
|
58
64
|
amount: data["amount"] as? Int, description: data["description"] as? String,
|
|
59
|
-
isBackToApp: data["isBackToApp"] as? Bool)
|
|
65
|
+
isBackToApp: data["isBackToApp"] as? Bool, isShowResult: data["isShowResult"] as? Bool)
|
|
60
66
|
default: fatalError("Invalid action!")
|
|
61
67
|
}
|
|
62
68
|
}
|
|
@@ -76,6 +82,12 @@ class RNPayMEMiniApp: RCTEventEmitter, PayMEDelegate {
|
|
|
76
82
|
}
|
|
77
83
|
}
|
|
78
84
|
|
|
85
|
+
@objc func setLanguage(_ language: String) {
|
|
86
|
+
DispatchQueue.main.sync {
|
|
87
|
+
self.payme.setLanguage(of: (language == "en") ? .en : .vi)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
79
91
|
@objc func getAccountInfo(_ phone: String) {
|
|
80
92
|
DispatchQueue.main.sync {
|
|
81
93
|
self.payme.getAccountInformation(of: phone)
|
|
Binary file
|
package/lib/commonjs/index.js
CHANGED
|
@@ -8,12 +8,14 @@ exports.getAccountInfo = getAccountInfo;
|
|
|
8
8
|
exports.getBalance = getBalance;
|
|
9
9
|
exports.init = init;
|
|
10
10
|
exports.open = open;
|
|
11
|
+
exports.setLanguage = setLanguage;
|
|
11
12
|
var _reactNative = require("react-native");
|
|
12
13
|
const RNPayMEMiniApp = _reactNative.NativeModules.RNPayMEMiniApp;
|
|
13
14
|
function init(appId, publicKey, privateKey) {
|
|
14
|
-
let
|
|
15
|
-
let
|
|
16
|
-
|
|
15
|
+
let locale = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'vi';
|
|
16
|
+
let env = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'PRODUCTION';
|
|
17
|
+
let mode = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'miniapp_product';
|
|
18
|
+
return RNPayMEMiniApp.initPayME(appId, publicKey, privateKey, locale, env, mode);
|
|
17
19
|
}
|
|
18
20
|
function open(type, openingParam) {
|
|
19
21
|
return RNPayMEMiniApp.open(type, openingParam);
|
|
@@ -24,6 +26,9 @@ function getBalance(phone) {
|
|
|
24
26
|
function getAccountInfo(phone) {
|
|
25
27
|
return RNPayMEMiniApp.getAccountInfo(phone);
|
|
26
28
|
}
|
|
29
|
+
function setLanguage(language) {
|
|
30
|
+
return RNPayMEMiniApp.setLanguage(language);
|
|
31
|
+
}
|
|
27
32
|
const PayMEMiniAppEvents = new _reactNative.NativeEventEmitter(RNPayMEMiniApp);
|
|
28
33
|
exports.PayMEMiniAppEvents = PayMEMiniAppEvents;
|
|
29
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RNPayMEMiniApp","NativeModules","init","appId","publicKey","privateKey","env","mode","initPayME","open","type","openingParam","getBalance","phone","getAccountInfo","PayMEMiniAppEvents","NativeEventEmitter"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"names":["RNPayMEMiniApp","NativeModules","init","appId","publicKey","privateKey","locale","env","mode","initPayME","open","type","openingParam","getBalance","phone","getAccountInfo","setLanguage","language","PayMEMiniAppEvents","NativeEventEmitter"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;AAAA;AASA,MAAMA,cAAc,GAAGC,0BAAa,CAACD,cAAc;AAE5C,SAASE,IAAI,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAIlB;EAAA,IAHAC,MAAmB,uEAAG,IAAI;EAAA,IAC1BC,GAAa,uEAAG,YAAY;EAAA,IAC5BC,IAAe,uEAAG,iBAAiB;EAEnC,OAAOR,cAAc,CAACS,SAAS,CAC7BN,KAAK,EACLC,SAAS,EACTC,UAAU,EACVC,MAAM,EACNC,GAAG,EACHC,IAAI,CACL;AACH;AAEO,SAASE,IAAI,CAACC,IAAsB,EAAEC,YAA+B,EAAE;EAC5E,OAAOZ,cAAc,CAACU,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEO,SAASC,UAAU,CAACC,KAAa,EAAE;EACxC,OAAOd,cAAc,CAACa,UAAU,CAACC,KAAK,CAAC;AACzC;AAEO,SAASC,cAAc,CAACD,KAAa,EAAE;EAC5C,OAAOd,cAAc,CAACe,cAAc,CAACD,KAAK,CAAC;AAC7C;AAEO,SAASE,WAAW,CAACC,QAAgB,EAAE;EAC5C,OAAOjB,cAAc,CAACgB,WAAW,CAACC,QAAQ,CAAC;AAC7C;AAEO,MAAMC,kBAAkB,GAAG,IAAIC,+BAAkB,CAACnB,cAAc,CAAC;AAAC"}
|
package/lib/module/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { NativeEventEmitter, NativeModules } from 'react-native';
|
|
2
2
|
const RNPayMEMiniApp = NativeModules.RNPayMEMiniApp;
|
|
3
3
|
export function init(appId, publicKey, privateKey) {
|
|
4
|
-
let
|
|
5
|
-
let
|
|
6
|
-
|
|
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';
|
|
7
|
+
return RNPayMEMiniApp.initPayME(appId, publicKey, privateKey, locale, env, mode);
|
|
7
8
|
}
|
|
8
9
|
export function open(type, openingParam) {
|
|
9
10
|
return RNPayMEMiniApp.open(type, openingParam);
|
|
@@ -14,5 +15,8 @@ export function getBalance(phone) {
|
|
|
14
15
|
export function getAccountInfo(phone) {
|
|
15
16
|
return RNPayMEMiniApp.getAccountInfo(phone);
|
|
16
17
|
}
|
|
18
|
+
export function setLanguage(language) {
|
|
19
|
+
return RNPayMEMiniApp.setLanguage(language);
|
|
20
|
+
}
|
|
17
21
|
export const PayMEMiniAppEvents = new NativeEventEmitter(RNPayMEMiniApp);
|
|
18
22
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","NativeModules","RNPayMEMiniApp","init","appId","publicKey","privateKey","env","mode","initPayME","open","type","openingParam","getBalance","phone","getAccountInfo","PayMEMiniAppEvents"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["NativeEventEmitter","NativeModules","RNPayMEMiniApp","init","appId","publicKey","privateKey","locale","env","mode","initPayME","open","type","openingParam","getBalance","phone","getAccountInfo","setLanguage","language","PayMEMiniAppEvents"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAShE,MAAMC,cAAc,GAAGD,aAAa,CAACC,cAAc;AAEnD,OAAO,SAASC,IAAI,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAIlB;EAAA,IAHAC,MAAmB,uEAAG,IAAI;EAAA,IAC1BC,GAAa,uEAAG,YAAY;EAAA,IAC5BC,IAAe,uEAAG,iBAAiB;EAEnC,OAAOP,cAAc,CAACQ,SAAS,CAC7BN,KAAK,EACLC,SAAS,EACTC,UAAU,EACVC,MAAM,EACNC,GAAG,EACHC,IAAI,CACL;AACH;AAEA,OAAO,SAASE,IAAI,CAACC,IAAsB,EAAEC,YAA+B,EAAE;EAC5E,OAAOX,cAAc,CAACS,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEA,OAAO,SAASC,UAAU,CAACC,KAAa,EAAE;EACxC,OAAOb,cAAc,CAACY,UAAU,CAACC,KAAK,CAAC;AACzC;AAEA,OAAO,SAASC,cAAc,CAACD,KAAa,EAAE;EAC5C,OAAOb,cAAc,CAACc,cAAc,CAACD,KAAK,CAAC;AAC7C;AAEA,OAAO,SAASE,WAAW,CAACC,QAAgB,EAAE;EAC5C,OAAOhB,cAAc,CAACe,WAAW,CAACC,QAAQ,CAAC;AAC7C;AAEA,OAAO,MAAMC,kBAAkB,GAAG,IAAInB,kBAAkB,CAACE,cAAc,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { NativeEventEmitter } from 'react-native';
|
|
2
|
-
import type { PayMEEnv, PayMEMode, PayMEOpeningParam, PayMEOpeningType } from './index.type';
|
|
3
|
-
export declare function init(appId: string, publicKey: string, privateKey: string, env?: PayMEEnv, mode?: PayMEMode): any;
|
|
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
4
|
export declare function open(type: PayMEOpeningType, openingParam: PayMEOpeningParam): any;
|
|
5
5
|
export declare function getBalance(phone: string): any;
|
|
6
6
|
export declare function getAccountInfo(phone: string): any;
|
|
7
|
+
export declare function setLanguage(language: string): any;
|
|
7
8
|
export declare const PayMEMiniAppEvents: NativeEventEmitter;
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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,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,GAAG,GAAE,QAAuB,EAC5B,IAAI,GAAE,SAA6B,
|
|
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,eAAO,MAAM,kBAAkB,oBAAyC,CAAC"}
|
|
@@ -3,18 +3,22 @@ type PayMEPaymentParam = {
|
|
|
3
3
|
transactionId: string;
|
|
4
4
|
note?: string;
|
|
5
5
|
ipnUrl: string;
|
|
6
|
+
isShowResult?: boolean;
|
|
6
7
|
};
|
|
7
8
|
type PayMEPaymentDirectParam = {
|
|
8
9
|
transaction: string;
|
|
10
|
+
isShowResult?: boolean;
|
|
9
11
|
};
|
|
10
12
|
type PayMEServiceParam = {
|
|
11
13
|
service: string;
|
|
12
14
|
isBackToApp?: boolean;
|
|
15
|
+
isShowResult?: boolean;
|
|
13
16
|
};
|
|
14
17
|
type PayMEPayParam = {
|
|
15
18
|
amount?: number;
|
|
16
19
|
description?: string;
|
|
17
20
|
isBackToApp?: boolean;
|
|
21
|
+
isShowResult?: boolean;
|
|
18
22
|
};
|
|
19
23
|
export type PayMEOpeningParam = {
|
|
20
24
|
action: 'PAYME';
|
|
@@ -53,5 +57,6 @@ export type PayMEOpeningParam = {
|
|
|
53
57
|
export type PayMEEnv = 'PRODUCTION' | 'SANDBOX';
|
|
54
58
|
export type PayMEMode = 'miniapp_sandbox' | 'miniapp_product';
|
|
55
59
|
export type PayMEOpeningType = 'screen' | 'modal';
|
|
60
|
+
export type PayMELocale = 'vi' | 'en';
|
|
56
61
|
export {};
|
|
57
62
|
//# sourceMappingURL=index.type.d.ts.map
|
|
@@ -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;
|
|
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,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,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,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,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"}
|
package/package.json
CHANGED
package/payme-mini-app.podspec
CHANGED
|
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.swift_versions = "5.0"
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
18
|
|
|
19
|
-
s.dependency "PayME-Miniapp", "0.2.
|
|
19
|
+
s.dependency "PayME-Miniapp", "0.2.31"
|
|
20
20
|
s.dependency "React-Core"
|
|
21
21
|
s.pod_target_xcconfig = { 'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES' }
|
|
22
22
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|
package/src/index.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NativeEventEmitter, NativeModules } from 'react-native';
|
|
2
2
|
import type {
|
|
3
3
|
PayMEEnv,
|
|
4
|
+
PayMELocale,
|
|
4
5
|
PayMEMode,
|
|
5
6
|
PayMEOpeningParam,
|
|
6
7
|
PayMEOpeningType,
|
|
@@ -12,10 +13,18 @@ export function init(
|
|
|
12
13
|
appId: string,
|
|
13
14
|
publicKey: string,
|
|
14
15
|
privateKey: string,
|
|
16
|
+
locale: PayMELocale = 'vi',
|
|
15
17
|
env: PayMEEnv = 'PRODUCTION',
|
|
16
18
|
mode: PayMEMode = 'miniapp_product'
|
|
17
19
|
) {
|
|
18
|
-
return RNPayMEMiniApp.initPayME(
|
|
20
|
+
return RNPayMEMiniApp.initPayME(
|
|
21
|
+
appId,
|
|
22
|
+
publicKey,
|
|
23
|
+
privateKey,
|
|
24
|
+
locale,
|
|
25
|
+
env,
|
|
26
|
+
mode
|
|
27
|
+
);
|
|
19
28
|
}
|
|
20
29
|
|
|
21
30
|
export function open(type: PayMEOpeningType, openingParam: PayMEOpeningParam) {
|
|
@@ -30,4 +39,8 @@ export function getAccountInfo(phone: string) {
|
|
|
30
39
|
return RNPayMEMiniApp.getAccountInfo(phone);
|
|
31
40
|
}
|
|
32
41
|
|
|
42
|
+
export function setLanguage(language: string) {
|
|
43
|
+
return RNPayMEMiniApp.setLanguage(language);
|
|
44
|
+
}
|
|
45
|
+
|
|
33
46
|
export const PayMEMiniAppEvents = new NativeEventEmitter(RNPayMEMiniApp);
|
package/src/index.type.ts
CHANGED
|
@@ -3,21 +3,25 @@ type PayMEPaymentParam = {
|
|
|
3
3
|
transactionId: string;
|
|
4
4
|
note?: string;
|
|
5
5
|
ipnUrl: string;
|
|
6
|
+
isShowResult?: boolean;
|
|
6
7
|
};
|
|
7
8
|
|
|
8
9
|
type PayMEPaymentDirectParam = {
|
|
9
10
|
transaction: string;
|
|
11
|
+
isShowResult?: boolean;
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
type PayMEServiceParam = {
|
|
13
15
|
service: string;
|
|
14
16
|
isBackToApp?: boolean;
|
|
17
|
+
isShowResult?: boolean;
|
|
15
18
|
};
|
|
16
19
|
|
|
17
20
|
type PayMEPayParam = {
|
|
18
21
|
amount?: number;
|
|
19
22
|
description?: string;
|
|
20
23
|
isBackToApp?: boolean;
|
|
24
|
+
isShowResult?: boolean;
|
|
21
25
|
};
|
|
22
26
|
|
|
23
27
|
export type PayMEOpeningParam =
|
|
@@ -36,3 +40,5 @@ export type PayMEEnv = 'PRODUCTION' | 'SANDBOX';
|
|
|
36
40
|
export type PayMEMode = 'miniapp_sandbox' | 'miniapp_product';
|
|
37
41
|
|
|
38
42
|
export type PayMEOpeningType = 'screen' | 'modal';
|
|
43
|
+
|
|
44
|
+
export type PayMELocale = 'vi' | 'en';
|