payme-mini-app 0.2.5 → 0.4.0
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/ios/RNPayMEMiniApp.m +1 -1
- package/ios/RNPayMEMiniApp.swift +3 -2
- package/lib/commonjs/index.js +2 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +3 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/index.type.d.ts +1 -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 +9 -4
- package/src/index.type.ts +2 -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.37'
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
if (isNewArchitectureEnabled()) {
|
package/ios/RNPayMEMiniApp.m
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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)
|
|
6
|
+
RCT_EXTERN_METHOD(initPayME:(NSString*)appId publicKey:(NSString)publicKey privateKey:(NSString)privateKey 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
|
|
package/ios/RNPayMEMiniApp.swift
CHANGED
|
@@ -4,8 +4,9 @@ import PayMEMiniApp
|
|
|
4
4
|
class RNPayMEMiniApp: RCTEventEmitter, PayMEDelegate {
|
|
5
5
|
var payme: PayME!
|
|
6
6
|
|
|
7
|
-
@objc func initPayME(_ appId: String, publicKey: String, privateKey: String, env: String) {
|
|
7
|
+
@objc func initPayME(_ appId: String, publicKey: String, privateKey: String, env: String, mode: String? = "product") {
|
|
8
8
|
DispatchQueue.main.sync {
|
|
9
|
+
PayMEConfig.instance.setMode(mode ?? "product")
|
|
9
10
|
PayMEConfig.instance.env = (env == "SANDBOX") ? .sbx : .prod
|
|
10
11
|
self.payme = PayME(key: PayMEKey(appId: appId, publicKey: publicKey, privateKey: privateKey))
|
|
11
12
|
self.payme.delegate = self
|
|
@@ -34,7 +35,7 @@ class RNPayMEMiniApp: RCTEventEmitter, PayMEDelegate {
|
|
|
34
35
|
|
|
35
36
|
DispatchQueue.main.sync {
|
|
36
37
|
let RNVC = UIApplication.shared.delegate?.window??.rootViewController
|
|
37
|
-
self.payme.open(with: PayMEOpeningParam(action: openAction, phone: param["phone"] as! String, data: openData), from: RNVC)
|
|
38
|
+
self.payme.open(with: PayMEOpeningParam(action: openAction, phone: param["phone"] as! String, data: openData), from: RNVC, type: PayMEOpeningType(rawValue: type) ?? .screen)
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
|
package/lib/commonjs/index.js
CHANGED
|
@@ -10,7 +10,8 @@ exports.open = open;
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
const RNPayMEMiniApp = _reactNative.NativeModules.RNPayMEMiniApp;
|
|
12
12
|
function init(appId, publicKey, privateKey, env) {
|
|
13
|
-
|
|
13
|
+
let mode = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'product';
|
|
14
|
+
return RNPayMEMiniApp.initPayME(appId, publicKey, privateKey, env, mode);
|
|
14
15
|
}
|
|
15
16
|
function open(type, openingParam) {
|
|
16
17
|
return RNPayMEMiniApp.open(type, openingParam);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RNPayMEMiniApp","NativeModules","init","appId","publicKey","privateKey","env","initPayME","open","type","openingParam","getBalance","phone","PayMEMiniAppEvents","NativeEventEmitter"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;AAAA;
|
|
1
|
+
{"version":3,"names":["RNPayMEMiniApp","NativeModules","init","appId","publicKey","privateKey","env","mode","initPayME","open","type","openingParam","getBalance","phone","PayMEMiniAppEvents","NativeEventEmitter"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;AAAA;AAOA,MAAMA,cAAc,GAAGC,0BAAa,CAACD,cAAc;AAE5C,SAASE,IAAI,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAClBC,GAAa,EAEb;EAAA,IADAC,IAAY,uEAAG,SAAS;EAExB,OAAOP,cAAc,CAACQ,SAAS,CAACL,KAAK,EAAEC,SAAS,EAAEC,UAAU,EAAEC,GAAG,EAAEC,IAAI,CAAC;AAC1E;AAEO,SAASE,IAAI,CAACC,IAAsB,EAAEC,YAA+B,EAAE;EAC5E,OAAOX,cAAc,CAACS,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEO,SAASC,UAAU,CAACC,KAAa,EAAE;EACxC,OAAOb,cAAc,CAACY,UAAU,CAACC,KAAK,CAAC;AACzC;AAEO,MAAMC,kBAAkB,GAAG,IAAIC,+BAAkB,CAACf,cAAc,CAAC;AAAC"}
|
package/lib/module/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { NativeEventEmitter, NativeModules } from 'react-native';
|
|
2
2
|
const RNPayMEMiniApp = NativeModules.RNPayMEMiniApp;
|
|
3
3
|
export function init(appId, publicKey, privateKey, env) {
|
|
4
|
-
|
|
4
|
+
let mode = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'product';
|
|
5
|
+
return RNPayMEMiniApp.initPayME(appId, publicKey, privateKey, env, mode);
|
|
5
6
|
}
|
|
6
7
|
export function open(type, openingParam) {
|
|
7
8
|
return RNPayMEMiniApp.open(type, openingParam);
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","NativeModules","RNPayMEMiniApp","init","appId","publicKey","privateKey","env","initPayME","open","type","openingParam","getBalance","phone","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","env","mode","initPayME","open","type","openingParam","getBalance","phone","PayMEMiniAppEvents"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAOhE,MAAMC,cAAc,GAAGD,aAAa,CAACC,cAAc;AAEnD,OAAO,SAASC,IAAI,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAClBC,GAAa,EAEb;EAAA,IADAC,IAAY,uEAAG,SAAS;EAExB,OAAON,cAAc,CAACO,SAAS,CAACL,KAAK,EAAEC,SAAS,EAAEC,UAAU,EAAEC,GAAG,EAAEC,IAAI,CAAC;AAC1E;AAEA,OAAO,SAASE,IAAI,CAACC,IAAsB,EAAEC,YAA+B,EAAE;EAC5E,OAAOV,cAAc,CAACQ,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEA,OAAO,SAASC,UAAU,CAACC,KAAa,EAAE;EACxC,OAAOZ,cAAc,CAACW,UAAU,CAACC,KAAK,CAAC;AACzC;AAEA,OAAO,MAAMC,kBAAkB,GAAG,IAAIf,kBAAkB,CAACE,cAAc,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NativeEventEmitter } from 'react-native';
|
|
2
|
-
import type { PayMEEnv, PayMEOpeningParam } from './index.type';
|
|
3
|
-
export declare function init(appId: string, publicKey: string, privateKey: string, env: PayMEEnv): any;
|
|
4
|
-
export declare function open(type:
|
|
2
|
+
import type { PayMEEnv, PayMEOpeningParam, PayMEOpeningType } from './index.type';
|
|
3
|
+
export declare function init(appId: string, publicKey: string, privateKey: string, env: PayMEEnv, mode?: string): any;
|
|
4
|
+
export declare function open(type: PayMEOpeningType, openingParam: PayMEOpeningParam): any;
|
|
5
5
|
export declare function getBalance(phone: string): any;
|
|
6
6
|
export declare const PayMEMiniAppEvents: NativeEventEmitter;
|
|
7
7
|
//# 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,
|
|
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,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAItB,wBAAgB,IAAI,CAClB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,QAAQ,EACb,IAAI,GAAE,MAAkB,OAGzB;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,OAE3E;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,OAEvC;AAED,eAAO,MAAM,kBAAkB,oBAAyC,CAAC"}
|
|
@@ -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;CAChB,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,CAAC;IAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,SAAS,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;CAChB,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,CAAC;IAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,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 "PayMEMiniApp", "~> 0.
|
|
19
|
+
s.dependency "PayMEMiniApp", "~> 0.2.0"
|
|
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,5 +1,9 @@
|
|
|
1
1
|
import { NativeEventEmitter, NativeModules } from 'react-native';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
PayMEEnv,
|
|
4
|
+
PayMEOpeningParam,
|
|
5
|
+
PayMEOpeningType,
|
|
6
|
+
} from './index.type';
|
|
3
7
|
|
|
4
8
|
const RNPayMEMiniApp = NativeModules.RNPayMEMiniApp;
|
|
5
9
|
|
|
@@ -7,12 +11,13 @@ export function init(
|
|
|
7
11
|
appId: string,
|
|
8
12
|
publicKey: string,
|
|
9
13
|
privateKey: string,
|
|
10
|
-
env: PayMEEnv
|
|
14
|
+
env: PayMEEnv,
|
|
15
|
+
mode: string = 'product'
|
|
11
16
|
) {
|
|
12
|
-
return RNPayMEMiniApp.initPayME(appId, publicKey, privateKey, env);
|
|
17
|
+
return RNPayMEMiniApp.initPayME(appId, publicKey, privateKey, env, mode);
|
|
13
18
|
}
|
|
14
19
|
|
|
15
|
-
export function open(type:
|
|
20
|
+
export function open(type: PayMEOpeningType, openingParam: PayMEOpeningParam) {
|
|
16
21
|
return RNPayMEMiniApp.open(type, openingParam);
|
|
17
22
|
}
|
|
18
23
|
|