payme-mini-app 1.0.2 → 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/LICENSE +1 -1
- package/android/build.gradle +9 -21
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +0 -1
- package/android/src/main/java/com/paymeminiapp/JsonConvert.kt +87 -85
- package/android/src/main/java/com/paymeminiapp/PaymeMiniAppModule.kt +394 -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 +5 -7
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.type.js.map +1 -1
- package/lib/module/index.js +7 -6
- 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 +51 -23
- package/payme-mini-app.podspec +1 -2
- package/src/index.tsx +3 -2
- package/src/index.type.ts +5 -5
- 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/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,7 @@ function setLanguage(language) {
|
|
|
33
30
|
function close() {
|
|
34
31
|
return RNPayMEMiniApp.closeMiniApp();
|
|
35
32
|
}
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
|
|
34
|
+
// Updated for React Native 0.78.0: Instantiate NativeEventEmitter without passing the native module
|
|
35
|
+
const PayMEMiniAppEvents = exports.PayMEMiniAppEvents = new _reactNative.NativeEventEmitter();
|
|
38
36
|
//# 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;;AAEA;AACO,MAAMC,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAIE,+BAAkB,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) {
|
|
@@ -21,5 +20,7 @@ export function setLanguage(language) {
|
|
|
21
20
|
export function close() {
|
|
22
21
|
return RNPayMEMiniApp.closeMiniApp();
|
|
23
22
|
}
|
|
24
|
-
|
|
23
|
+
|
|
24
|
+
// Updated for React Native 0.78.0: Instantiate NativeEventEmitter without passing the native module
|
|
25
|
+
export const PayMEMiniAppEvents = new NativeEventEmitter();
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
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;AACA,OAAO,MAAMC,kBAAkB,GAAG,IAAItB,kBAAkB,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;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,
|
|
6
|
+
extraData?: Record<string, string | object>;
|
|
7
7
|
isShowResult?: boolean;
|
|
8
8
|
};
|
|
9
9
|
type PayMEPaymentDirectParam = {
|
|
10
10
|
transaction: string;
|
|
11
|
-
extraData?: Record<string,
|
|
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,
|
|
21
|
+
extraData?: Record<string, string | object>;
|
|
22
22
|
isShowResult?: boolean;
|
|
23
23
|
};
|
|
24
24
|
type PayMEServiceParam = {
|
|
25
25
|
service: string;
|
|
26
|
-
extraData?: Record<string,
|
|
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,
|
|
33
|
+
extraData?: Record<string, 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":"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,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,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"}
|
|
@@ -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;AAGD,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
type PayMEPaymentParam = {
|
|
2
|
+
amount: number;
|
|
3
|
+
transactionId: string;
|
|
4
|
+
note?: string;
|
|
5
|
+
ipnUrl: string;
|
|
6
|
+
extraData?: Record<string, string | object>;
|
|
7
|
+
isShowResult?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type PayMEPaymentDirectParam = {
|
|
10
|
+
transaction: string;
|
|
11
|
+
extraData?: Record<string, 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, string | object>;
|
|
22
|
+
isShowResult?: boolean;
|
|
23
|
+
};
|
|
24
|
+
type PayMEServiceParam = {
|
|
25
|
+
service: string;
|
|
26
|
+
extraData?: Record<string, string | object>;
|
|
27
|
+
isBackToApp?: boolean;
|
|
28
|
+
isShowResult?: boolean;
|
|
29
|
+
};
|
|
30
|
+
type PayMEPayParam = {
|
|
31
|
+
amount?: number;
|
|
32
|
+
description?: string;
|
|
33
|
+
extraData?: Record<string, 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
|
|
@@ -0,0 +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,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;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,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
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payme-mini-app",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-beta.3",
|
|
4
4
|
"description": "Thư viện tích hợp PayME Miniapp",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
5
|
+
"source": "./src/index.tsx",
|
|
6
|
+
"main": "./lib/commonjs/index.js",
|
|
7
|
+
"module": "./lib/module/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
12
|
+
"default": "./lib/module/index.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
16
|
+
"default": "./lib/commonjs/index.js"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
10
20
|
"files": [
|
|
11
21
|
"src",
|
|
12
22
|
"lib",
|
|
@@ -14,7 +24,7 @@
|
|
|
14
24
|
"ios",
|
|
15
25
|
"cpp",
|
|
16
26
|
"*.podspec",
|
|
17
|
-
"
|
|
27
|
+
"react-native.config.json",
|
|
18
28
|
"!ios/build",
|
|
19
29
|
"!android/build",
|
|
20
30
|
"!android/gradle",
|
|
@@ -27,21 +37,23 @@
|
|
|
27
37
|
"!**/.*"
|
|
28
38
|
],
|
|
29
39
|
"scripts": {
|
|
40
|
+
"example": "yarn workspace payme-mini-app-example",
|
|
30
41
|
"test": "jest",
|
|
31
|
-
"typecheck": "tsc
|
|
42
|
+
"typecheck": "tsc",
|
|
32
43
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
44
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
33
45
|
"prepare": "bob build",
|
|
34
|
-
"release": "release-it"
|
|
35
|
-
"example": "yarn --cwd example",
|
|
36
|
-
"bootstrap": "yarn example && yarn install && yarn example pods",
|
|
37
|
-
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
|
|
46
|
+
"release": "release-it"
|
|
38
47
|
},
|
|
39
48
|
"keywords": [
|
|
40
49
|
"react-native",
|
|
41
50
|
"ios",
|
|
42
51
|
"android"
|
|
43
52
|
],
|
|
44
|
-
"repository":
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git@github.com:PayME-Miniapp/payme-mini-app.git"
|
|
56
|
+
},
|
|
45
57
|
"author": "PayME Technology Corporation <hotro@payme.vn> (https://payme.vn/web/home)",
|
|
46
58
|
"license": "MIT",
|
|
47
59
|
"bugs": {
|
|
@@ -55,21 +67,20 @@
|
|
|
55
67
|
"@commitlint/config-conventional": "^17.0.2",
|
|
56
68
|
"@evilmartians/lefthook": "^1.5.0",
|
|
57
69
|
"@react-native/eslint-config": "^0.73.1",
|
|
58
|
-
"@release-it/conventional-changelog": "^
|
|
70
|
+
"@release-it/conventional-changelog": "^9.0.2",
|
|
59
71
|
"@types/jest": "^29.5.5",
|
|
60
72
|
"@types/react": "^18.2.44",
|
|
61
73
|
"commitlint": "^17.0.2",
|
|
62
74
|
"del-cli": "^5.1.0",
|
|
63
75
|
"eslint": "^8.51.0",
|
|
64
76
|
"eslint-config-prettier": "^9.0.0",
|
|
65
|
-
"eslint-plugin-ft-flow": "^3.0.9",
|
|
66
77
|
"eslint-plugin-prettier": "^5.0.1",
|
|
67
78
|
"jest": "^29.7.0",
|
|
68
79
|
"prettier": "^3.0.3",
|
|
69
|
-
"react": "
|
|
70
|
-
"react-native": "0.
|
|
71
|
-
"react-native-builder-bob": "^0.
|
|
72
|
-
"release-it": "^
|
|
80
|
+
"react": "19.0.0",
|
|
81
|
+
"react-native": "0.78.0",
|
|
82
|
+
"react-native-builder-bob": "^0.37.0",
|
|
83
|
+
"release-it": "^17.10.0",
|
|
73
84
|
"turbo": "^1.10.7",
|
|
74
85
|
"typescript": "^5.2.2"
|
|
75
86
|
},
|
|
@@ -83,6 +94,7 @@
|
|
|
83
94
|
"workspaces": [
|
|
84
95
|
"example"
|
|
85
96
|
],
|
|
97
|
+
"packageManager": "yarn@3.6.1",
|
|
86
98
|
"jest": {
|
|
87
99
|
"preset": "react-native",
|
|
88
100
|
"modulePathIgnorePatterns": [
|
|
@@ -119,6 +131,7 @@
|
|
|
119
131
|
"prettier"
|
|
120
132
|
],
|
|
121
133
|
"rules": {
|
|
134
|
+
"react/react-in-jsx-scope": "off",
|
|
122
135
|
"prettier/prettier": [
|
|
123
136
|
"error",
|
|
124
137
|
{
|
|
@@ -146,15 +159,30 @@
|
|
|
146
159
|
"source": "src",
|
|
147
160
|
"output": "lib",
|
|
148
161
|
"targets": [
|
|
149
|
-
|
|
150
|
-
|
|
162
|
+
[
|
|
163
|
+
"commonjs",
|
|
164
|
+
{
|
|
165
|
+
"esm": true
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
[
|
|
169
|
+
"module",
|
|
170
|
+
{
|
|
171
|
+
"esm": true
|
|
172
|
+
}
|
|
173
|
+
],
|
|
151
174
|
[
|
|
152
175
|
"typescript",
|
|
153
176
|
{
|
|
154
|
-
"project": "tsconfig.build.json"
|
|
177
|
+
"project": "tsconfig.build.json",
|
|
178
|
+
"esm": true
|
|
155
179
|
}
|
|
156
180
|
]
|
|
157
181
|
]
|
|
158
182
|
},
|
|
159
|
-
"
|
|
183
|
+
"create-react-native-library": {
|
|
184
|
+
"type": "legacy-module",
|
|
185
|
+
"languages": "kotlin-swift",
|
|
186
|
+
"version": "0.48.3"
|
|
187
|
+
}
|
|
160
188
|
}
|
package/payme-mini-app.podspec
CHANGED
|
@@ -13,10 +13,9 @@ Pod::Spec.new do |s|
|
|
|
13
13
|
|
|
14
14
|
s.platforms = { :ios => "13.0" }
|
|
15
15
|
s.source = { :git => "http://git.mecorp.vn/paymeproject/payme-miniapp-reactnative.git", :tag => "#{s.version}" }
|
|
16
|
-
s.swift_versions = "5.0"
|
|
17
16
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
17
|
s.resource_bundles = {'payme-mini-app_PrivacyInfo' => ['ios/PrivacyInfo.xcprivacy'] }
|
|
19
|
-
s.dependency "PayME-Miniapp", "0.5.
|
|
18
|
+
s.dependency "PayME-Miniapp", "0.5.4"
|
|
20
19
|
s.pod_target_xcconfig = { 'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES' }
|
|
21
20
|
|
|
22
21
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
package/src/index.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
PayMEOpeningType,
|
|
8
8
|
} from './index.type';
|
|
9
9
|
|
|
10
|
-
const RNPayMEMiniApp = NativeModules.
|
|
10
|
+
const RNPayMEMiniApp = NativeModules.PaymeMiniApp;
|
|
11
11
|
|
|
12
12
|
export function init(
|
|
13
13
|
appId: string,
|
|
@@ -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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
37
|
+
extraData?: Record<string, string | object>;
|
|
38
38
|
isBackToApp?: boolean;
|
|
39
39
|
isShowResult?: boolean;
|
|
40
40
|
};
|