payme-mini-app 0.1.8 → 0.1.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.
- package/README.md +5 -31
- package/ios/RNPayMEMiniApp.m +1 -1
- package/ios/RNPayMEMiniApp.swift +9 -3
- package/ios/RNPayMEMiniApp.xcodeproj/project.xcworkspace/xcuserdata/montossc.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/lib/commonjs/index.js +4 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/payme-mini-app.podspec +1 -1
- package/src/index.tsx +4 -0
package/README.md
CHANGED
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm install payme-mini-app
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
import { multiply } from 'payme-mini-app';
|
|
15
|
-
|
|
16
|
-
// ...
|
|
17
|
-
|
|
18
|
-
const result = await multiply(3, 7);
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Contributing
|
|
22
|
-
|
|
23
|
-
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
24
|
-
|
|
25
|
-
## License
|
|
26
|
-
|
|
27
|
-
MIT
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
|
1
|
+
## ios
|
|
2
|
+
- (void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)(void))completionHandler
|
|
3
|
+
{
|
|
4
|
+
completionHandler();
|
|
5
|
+
}
|
package/ios/RNPayMEMiniApp.m
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
RCT_EXTERN_METHOD(initPayME:(NSString*)appId publicKey:(NSString)publicKey privateKey:(NSString)privateKey env:(NSString)env)
|
|
7
7
|
RCT_EXTERN_METHOD(open:(NSString*)type param:(NSDictionary)param)
|
|
8
|
-
RCT_EXTERN_METHOD(
|
|
8
|
+
RCT_EXTERN_METHOD(getBalance:(NSString*)phone)
|
|
9
9
|
|
|
10
10
|
+ (BOOL)requiresMainQueueSetup
|
|
11
11
|
{
|
package/ios/RNPayMEMiniApp.swift
CHANGED
|
@@ -37,17 +37,23 @@ class RNPayMEMiniApp: RCTEventEmitter, PayMEDelegate {
|
|
|
37
37
|
self.payme.open(with: PayMEOpeningParam(action: openAction, phone: param["phone"] as! String, data: openData), from: RNVC)
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
|
|
41
|
+
@objc func getBalance(_ phone: String) {
|
|
42
|
+
DispatchQueue.main.sync {
|
|
43
|
+
self.payme.getBalance(of: phone)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
40
46
|
|
|
41
47
|
override func supportedEvents() -> [String]! {
|
|
42
48
|
return ["onError", "onResponse"]
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
func onError(action: PayMEMiniApp.PayMEAction, error: PayMEMiniApp.PayMEError) {
|
|
46
|
-
sendEvent(withName: "onError", body: ["action": action.
|
|
52
|
+
sendEvent(withName: "onError", body: ["action": action.rawValue, "code": error.code, "description": error.description])
|
|
47
53
|
}
|
|
48
54
|
|
|
49
|
-
func onResponse(action: PayMEMiniApp.PayMEAction, response: [String:
|
|
50
|
-
sendEvent(withName: "onResponse", body: ["action": action.
|
|
55
|
+
func onResponse(action: PayMEMiniApp.PayMEAction, response: [String: Any]) {
|
|
56
|
+
sendEvent(withName: "onResponse", body: ["action": action.rawValue].merging(response) { (_, new) in new })
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
59
|
|
|
Binary file
|
package/lib/commonjs/index.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.PayMEMiniAppEvents = void 0;
|
|
7
|
+
exports.getBalance = getBalance;
|
|
7
8
|
exports.init = init;
|
|
8
9
|
exports.open = open;
|
|
9
10
|
var _reactNative = require("react-native");
|
|
@@ -14,6 +15,9 @@ function init(appId, publicKey, privateKey, env) {
|
|
|
14
15
|
function open(type, openingParam) {
|
|
15
16
|
return RNPayMEMiniApp.open(type, openingParam);
|
|
16
17
|
}
|
|
18
|
+
function getBalance(phone) {
|
|
19
|
+
return RNPayMEMiniApp.getBalance(phone);
|
|
20
|
+
}
|
|
17
21
|
const PayMEMiniAppEvents = new _reactNative.NativeEventEmitter(RNPayMEMiniApp);
|
|
18
22
|
exports.PayMEMiniAppEvents = PayMEMiniAppEvents;
|
|
19
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RNPayMEMiniApp","NativeModules","init","appId","publicKey","privateKey","env","initPayME","open","type","openingParam","PayMEMiniAppEvents","NativeEventEmitter"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"
|
|
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;AAGA,MAAMA,cAAc,GAAGC,0BAAa,CAACD,cAAc;AAE5C,SAASE,IAAI,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAClBC,GAAa,EACb;EACA,OAAON,cAAc,CAACO,SAAS,CAACJ,KAAK,EAAEC,SAAS,EAAEC,UAAU,EAAEC,GAAG,CAAC;AACpE;AAEO,SAASE,IAAI,CAACC,IAAY,EAAEC,YAA+B,EAAE;EAClE,OAAOV,cAAc,CAACQ,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEO,SAASC,UAAU,CAACC,KAAa,EAAE;EACxC,OAAOZ,cAAc,CAACW,UAAU,CAACC,KAAK,CAAC;AACzC;AAEO,MAAMC,kBAAkB,GAAG,IAAIC,+BAAkB,CAACd,cAAc,CAAC;AAAC"}
|
package/lib/module/index.js
CHANGED
|
@@ -6,5 +6,8 @@ export function init(appId, publicKey, privateKey, env) {
|
|
|
6
6
|
export function open(type, openingParam) {
|
|
7
7
|
return RNPayMEMiniApp.open(type, openingParam);
|
|
8
8
|
}
|
|
9
|
+
export function getBalance(phone) {
|
|
10
|
+
return RNPayMEMiniApp.getBalance(phone);
|
|
11
|
+
}
|
|
9
12
|
export const PayMEMiniAppEvents = new NativeEventEmitter(RNPayMEMiniApp);
|
|
10
13
|
//# 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","initPayME","open","type","openingParam","PayMEMiniAppEvents"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,QAAQ,cAAc;AAGhE,MAAMC,cAAc,GAAGD,aAAa,CAACC,cAAc;AAEnD,OAAO,SAASC,IAAI,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAClBC,GAAa,EACb;EACA,OAAOL,cAAc,CAACM,SAAS,CAACJ,KAAK,EAAEC,SAAS,EAAEC,UAAU,EAAEC,GAAG,CAAC;AACpE;AAEA,OAAO,SAASE,IAAI,CAACC,IAAY,EAAEC,YAA+B,EAAE;EAClE,OAAOT,cAAc,CAACO,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEA,OAAO,MAAMC,kBAAkB,GAAG,
|
|
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;AAGhE,MAAMC,cAAc,GAAGD,aAAa,CAACC,cAAc;AAEnD,OAAO,SAASC,IAAI,CAClBC,KAAa,EACbC,SAAiB,EACjBC,UAAkB,EAClBC,GAAa,EACb;EACA,OAAOL,cAAc,CAACM,SAAS,CAACJ,KAAK,EAAEC,SAAS,EAAEC,UAAU,EAAEC,GAAG,CAAC;AACpE;AAEA,OAAO,SAASE,IAAI,CAACC,IAAY,EAAEC,YAA+B,EAAE;EAClE,OAAOT,cAAc,CAACO,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEA,OAAO,SAASC,UAAU,CAACC,KAAa,EAAE;EACxC,OAAOX,cAAc,CAACU,UAAU,CAACC,KAAK,CAAC;AACzC;AAEA,OAAO,MAAMC,kBAAkB,GAAG,IAAId,kBAAkB,CAACE,cAAc,CAAC"}
|
|
@@ -2,5 +2,6 @@ import { NativeEventEmitter } from 'react-native';
|
|
|
2
2
|
import type { PayMEEnv, PayMEOpeningParam } from './index.type';
|
|
3
3
|
export declare function init(appId: string, publicKey: string, privateKey: string, env: PayMEEnv): any;
|
|
4
4
|
export declare function open(type: string, openingParam: PayMEOpeningParam): any;
|
|
5
|
+
export declare function getBalance(phone: string): any;
|
|
5
6
|
export declare const PayMEMiniAppEvents: NativeEventEmitter;
|
|
6
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,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAIhE,wBAAgB,IAAI,CAClB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,QAAQ,OAGd;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,OAEjE;AAED,eAAO,MAAM,kBAAkB,oBAAyC,CAAC"}
|
|
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,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAIhE,wBAAgB,IAAI,CAClB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,QAAQ,OAGd;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,OAEjE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,OAEvC;AAED,eAAO,MAAM,kBAAkB,oBAAyC,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.0.
|
|
19
|
+
s.dependency "PayMEMiniApp", "0.0.6"
|
|
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
|
@@ -16,4 +16,8 @@ export function open(type: string, openingParam: PayMEOpeningParam) {
|
|
|
16
16
|
return RNPayMEMiniApp.open(type, openingParam);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
export function getBalance(phone: string) {
|
|
20
|
+
return RNPayMEMiniApp.getBalance(phone);
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
export const PayMEMiniAppEvents = new NativeEventEmitter(RNPayMEMiniApp);
|