payme-mini-app 0.1.3 → 0.1.4

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.
Files changed (30) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +31 -31
  3. package/android/build.gradle +86 -86
  4. package/android/gradle.properties +5 -5
  5. package/android/src/main/AndroidManifest.xml +4 -4
  6. package/android/src/main/java/com/paymeminiapp/JsonConvert.kt +97 -97
  7. package/android/src/main/java/com/paymeminiapp/RNPayMEMiniAppModule.kt +144 -127
  8. package/android/src/main/java/com/paymeminiapp/RNPayMEMiniAppPackage.kt +17 -17
  9. package/ios/RNPayMEMiniApp-Bridging-Header.h +3 -3
  10. package/ios/RNPayMEMiniApp.m +16 -16
  11. package/ios/RNPayMEMiniApp.swift +57 -63
  12. package/ios/RNPayMEMiniApp.xcodeproj/project.pbxproj +281 -281
  13. package/ios/RNPayMEMiniApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -4
  14. package/ios/RNPayMEMiniApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
  15. package/ios/RNPayMEMiniApp.xcodeproj/project.xcworkspace/xcuserdata/montossc.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  16. package/ios/RNPayMEMiniApp.xcodeproj/xcuserdata/montossc.xcuserdatad/xcschemes/xcschememanagement.plist +14 -14
  17. package/lib/commonjs/index.js +2 -2
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/commonjs/index.type.js.map +1 -1
  20. package/lib/module/index.js +2 -2
  21. package/lib/module/index.js.map +1 -1
  22. package/lib/module/index.type.js.map +1 -1
  23. package/lib/typescript/index.d.ts +5 -5
  24. package/lib/typescript/index.d.ts.map +1 -1
  25. package/lib/typescript/index.type.d.ts +19 -18
  26. package/lib/typescript/index.type.d.ts.map +1 -1
  27. package/package.json +160 -160
  28. package/payme-mini-app.podspec +37 -37
  29. package/src/index.tsx +19 -14
  30. package/src/index.type.ts +13 -11
@@ -1 +1 @@
1
- {"version":3,"names":["NativeEventEmitter","NativeModules","RNPayMEMiniApp","init","appId","publicKey","privateKey","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,CAACC,KAAa,EAAEC,SAAiB,EAAEC,UAAkB,EAAE;EACzE,OAAOJ,cAAc,CAACK,SAAS,CAACH,KAAK,EAAEC,SAAS,EAAEC,UAAU,CAAC;AAC/D;AAEA,OAAO,SAASE,IAAI,CAACC,IAAY,EAAEC,YAA+B,EAAE;EAClE,OAAOR,cAAc,CAACM,IAAI,CAACC,IAAI,EAAEC,YAAY,CAAC;AAChD;AAEA,OAAO,MAAMC,kBAAkB,GAAG,IAAIX,kBAAkB,CAACE,cAAc,CAAC"}
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,IAAIZ,kBAAkB,CAACE,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.type.ts"],"mappings":""}
1
+ {"version":3,"names":[],"sourceRoot":"..\\..\\src","sources":["index.type.ts"],"mappings":""}
@@ -1,6 +1,6 @@
1
- import { NativeEventEmitter } from 'react-native';
2
- import type { PayMEOpeningParam } from './index.type';
3
- export declare function init(appId: string, publicKey: string, privateKey: string): any;
4
- export declare function open(type: string, openingParam: PayMEOpeningParam): any;
5
- export declare const PayMEMiniAppEvents: NativeEventEmitter;
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: string, openingParam: PayMEOpeningParam): any;
5
+ export declare const PayMEMiniAppEvents: NativeEventEmitter;
6
6
  //# 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,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAItD,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,OAExE;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,eAAO,MAAM,kBAAkB,oBAAyC,CAAC"}
@@ -1,19 +1,20 @@
1
- type PayMEPaymentParam = {
2
- amount: number;
3
- transactionId: string;
4
- note?: string;
5
- ipnUrl: string;
6
- };
7
- export type PayMEOpeningParam = {
8
- action: 'PAYME';
9
- phone: string;
10
- } | {
11
- action: 'OPEN';
12
- phone: string;
13
- } | {
14
- action: 'PAY';
15
- phone: string;
16
- data: PayMEPaymentParam;
17
- };
18
- export {};
1
+ type PayMEPaymentParam = {
2
+ amount: number;
3
+ transactionId: string;
4
+ note?: string;
5
+ ipnUrl: string;
6
+ };
7
+ export type PayMEOpeningParam = {
8
+ action: 'PAYME';
9
+ phone: string;
10
+ } | {
11
+ action: 'OPEN';
12
+ phone: string;
13
+ } | {
14
+ action: 'PAY';
15
+ phone: string;
16
+ data: PayMEPaymentParam;
17
+ };
18
+ export type PayMEEnv = 'PRODUCTION' | 'SANDBOX';
19
+ export {};
19
20
  //# 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;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"}
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"}
package/package.json CHANGED
@@ -1,160 +1,160 @@
1
- {
2
- "name": "payme-mini-app",
3
- "version": "0.1.3",
4
- "description": "test",
5
- "main": "lib/commonjs/index",
6
- "module": "lib/module/index",
7
- "types": "lib/typescript/index.d.ts",
8
- "react-native": "src/index",
9
- "source": "src/index",
10
- "files": [
11
- "src",
12
- "lib",
13
- "android",
14
- "ios",
15
- "cpp",
16
- "*.podspec",
17
- "!lib/typescript/example",
18
- "!ios/build",
19
- "!android/build",
20
- "!android/gradle",
21
- "!android/gradlew",
22
- "!android/gradlew.bat",
23
- "!android/local.properties",
24
- "!**/__tests__",
25
- "!**/__fixtures__",
26
- "!**/__mocks__",
27
- "!**/.*"
28
- ],
29
- "scripts": {
30
- "test": "jest",
31
- "typecheck": "tsc --noEmit",
32
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
33
- "prepack": "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"
38
- },
39
- "keywords": [
40
- "react-native",
41
- "ios",
42
- "android"
43
- ],
44
- "repository": "https://github.com/nampt2903/payme-mini-app",
45
- "author": "Phan Thanh Nam <nampt@payme.vn> (https://github.com/nampt2903)",
46
- "license": "MIT",
47
- "bugs": {
48
- "url": "https://github.com/nampt2903/payme-mini-app/issues"
49
- },
50
- "homepage": "https://github.com/nampt2903/payme-mini-app#readme",
51
- "publishConfig": {
52
- "registry": "https://registry.npmjs.org/"
53
- },
54
- "devDependencies": {
55
- "@evilmartians/lefthook": "^1.2.2",
56
- "@commitlint/config-conventional": "^17.0.2",
57
- "@react-native-community/eslint-config": "^3.0.2",
58
- "@release-it/conventional-changelog": "^5.0.0",
59
- "@types/jest": "^28.1.2",
60
- "@types/react": "~17.0.21",
61
- "@types/react-native": "0.70.0",
62
- "commitlint": "^17.0.2",
63
- "del-cli": "^5.0.0",
64
- "eslint": "^8.4.1",
65
- "eslint-config-prettier": "^8.5.0",
66
- "eslint-plugin-prettier": "^4.0.0",
67
- "jest": "^28.1.1",
68
- "pod-install": "^0.1.0",
69
- "prettier": "^2.0.5",
70
- "react": "18.1.0",
71
- "react-native": "0.70.6",
72
- "react-native-builder-bob": "^0.20.0",
73
- "release-it": "^15.0.0",
74
- "typescript": "^4.5.2"
75
- },
76
- "resolutions": {
77
- "@types/react": "17.0.21"
78
- },
79
- "peerDependencies": {
80
- "react": "*",
81
- "react-native": "*"
82
- },
83
- "engines": {
84
- "node": ">= 16.0.0"
85
- },
86
- "packageManager": "^yarn@1.22.15",
87
- "jest": {
88
- "preset": "react-native",
89
- "modulePathIgnorePatterns": [
90
- "<rootDir>/example/node_modules",
91
- "<rootDir>/lib/"
92
- ]
93
- },
94
- "commitlint": {
95
- "extends": [
96
- "@commitlint/config-conventional"
97
- ]
98
- },
99
- "release-it": {
100
- "git": {
101
- "commitMessage": "chore: release ${version}",
102
- "tagName": "v${version}"
103
- },
104
- "npm": {
105
- "publish": true
106
- },
107
- "github": {
108
- "release": true
109
- },
110
- "plugins": {
111
- "@release-it/conventional-changelog": {
112
- "preset": "angular"
113
- }
114
- }
115
- },
116
- "eslintConfig": {
117
- "root": true,
118
- "extends": [
119
- "@react-native-community",
120
- "prettier"
121
- ],
122
- "rules": {
123
- "prettier/prettier": [
124
- "error",
125
- {
126
- "quoteProps": "consistent",
127
- "singleQuote": true,
128
- "tabWidth": 2,
129
- "trailingComma": "es5",
130
- "useTabs": false
131
- }
132
- ]
133
- }
134
- },
135
- "eslintIgnore": [
136
- "node_modules/",
137
- "lib/"
138
- ],
139
- "prettier": {
140
- "quoteProps": "consistent",
141
- "singleQuote": true,
142
- "tabWidth": 2,
143
- "trailingComma": "es5",
144
- "useTabs": false
145
- },
146
- "react-native-builder-bob": {
147
- "source": "src",
148
- "output": "lib",
149
- "targets": [
150
- "commonjs",
151
- "module",
152
- [
153
- "typescript",
154
- {
155
- "project": "tsconfig.build.json"
156
- }
157
- ]
158
- ]
159
- }
160
- }
1
+ {
2
+ "name": "payme-mini-app",
3
+ "version": "0.1.4",
4
+ "description": "test",
5
+ "main": "lib/commonjs/index",
6
+ "module": "lib/module/index",
7
+ "types": "lib/typescript/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
+ "files": [
11
+ "src",
12
+ "lib",
13
+ "android",
14
+ "ios",
15
+ "cpp",
16
+ "*.podspec",
17
+ "!lib/typescript/example",
18
+ "!ios/build",
19
+ "!android/build",
20
+ "!android/gradle",
21
+ "!android/gradlew",
22
+ "!android/gradlew.bat",
23
+ "!android/local.properties",
24
+ "!**/__tests__",
25
+ "!**/__fixtures__",
26
+ "!**/__mocks__",
27
+ "!**/.*"
28
+ ],
29
+ "scripts": {
30
+ "test": "jest",
31
+ "typecheck": "tsc --noEmit",
32
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
33
+ "prepack": "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"
38
+ },
39
+ "keywords": [
40
+ "react-native",
41
+ "ios",
42
+ "android"
43
+ ],
44
+ "repository": "https://github.com/nampt2903/payme-mini-app",
45
+ "author": "Phan Thanh Nam <nampt@payme.vn> (https://github.com/nampt2903)",
46
+ "license": "MIT",
47
+ "bugs": {
48
+ "url": "https://github.com/nampt2903/payme-mini-app/issues"
49
+ },
50
+ "homepage": "https://github.com/nampt2903/payme-mini-app#readme",
51
+ "publishConfig": {
52
+ "registry": "https://registry.npmjs.org/"
53
+ },
54
+ "devDependencies": {
55
+ "@evilmartians/lefthook": "^1.2.2",
56
+ "@commitlint/config-conventional": "^17.0.2",
57
+ "@react-native-community/eslint-config": "^3.0.2",
58
+ "@release-it/conventional-changelog": "^5.0.0",
59
+ "@types/jest": "^28.1.2",
60
+ "@types/react": "~17.0.21",
61
+ "@types/react-native": "0.70.0",
62
+ "commitlint": "^17.0.2",
63
+ "del-cli": "^5.0.0",
64
+ "eslint": "^8.4.1",
65
+ "eslint-config-prettier": "^8.5.0",
66
+ "eslint-plugin-prettier": "^4.0.0",
67
+ "jest": "^28.1.1",
68
+ "pod-install": "^0.1.0",
69
+ "prettier": "^2.0.5",
70
+ "react": "18.1.0",
71
+ "react-native": "0.70.6",
72
+ "react-native-builder-bob": "^0.20.0",
73
+ "release-it": "^15.0.0",
74
+ "typescript": "^4.5.2"
75
+ },
76
+ "resolutions": {
77
+ "@types/react": "17.0.21"
78
+ },
79
+ "peerDependencies": {
80
+ "react": "*",
81
+ "react-native": "*"
82
+ },
83
+ "engines": {
84
+ "node": ">= 16.0.0"
85
+ },
86
+ "packageManager": "^yarn@1.22.15",
87
+ "jest": {
88
+ "preset": "react-native",
89
+ "modulePathIgnorePatterns": [
90
+ "<rootDir>/example/node_modules",
91
+ "<rootDir>/lib/"
92
+ ]
93
+ },
94
+ "commitlint": {
95
+ "extends": [
96
+ "@commitlint/config-conventional"
97
+ ]
98
+ },
99
+ "release-it": {
100
+ "git": {
101
+ "commitMessage": "chore: release ${version}",
102
+ "tagName": "v${version}"
103
+ },
104
+ "npm": {
105
+ "publish": true
106
+ },
107
+ "github": {
108
+ "release": true
109
+ },
110
+ "plugins": {
111
+ "@release-it/conventional-changelog": {
112
+ "preset": "angular"
113
+ }
114
+ }
115
+ },
116
+ "eslintConfig": {
117
+ "root": true,
118
+ "extends": [
119
+ "@react-native-community",
120
+ "prettier"
121
+ ],
122
+ "rules": {
123
+ "prettier/prettier": [
124
+ "error",
125
+ {
126
+ "quoteProps": "consistent",
127
+ "singleQuote": true,
128
+ "tabWidth": 2,
129
+ "trailingComma": "es5",
130
+ "useTabs": false
131
+ }
132
+ ]
133
+ }
134
+ },
135
+ "eslintIgnore": [
136
+ "node_modules/",
137
+ "lib/"
138
+ ],
139
+ "prettier": {
140
+ "quoteProps": "consistent",
141
+ "singleQuote": true,
142
+ "tabWidth": 2,
143
+ "trailingComma": "es5",
144
+ "useTabs": false
145
+ },
146
+ "react-native-builder-bob": {
147
+ "source": "src",
148
+ "output": "lib",
149
+ "targets": [
150
+ "commonjs",
151
+ "module",
152
+ [
153
+ "typescript",
154
+ {
155
+ "project": "tsconfig.build.json"
156
+ }
157
+ ]
158
+ ]
159
+ }
160
+ }
@@ -1,37 +1,37 @@
1
- require "json"
2
-
3
- package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
- folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5
-
6
- Pod::Spec.new do |s|
7
- s.name = "payme-mini-app"
8
- s.version = package["version"]
9
- s.summary = package["description"]
10
- s.homepage = package["homepage"]
11
- s.license = package["license"]
12
- s.authors = package["author"]
13
-
14
- s.platforms = { :ios => "13.0" }
15
- s.source = { :git => "http://git.mecorp.vn/paymeproject/payme-miniapp-reactnative.git", :tag => "#{s.version}" }
16
- s.swift_versions = "5.0"
17
- s.source_files = "ios/**/*.{h,m,mm,swift}"
18
-
19
- s.dependency "PayMEMiniApp", "0.0.1"
20
- s.dependency "React-Core"
21
- s.pod_target_xcconfig = { 'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES' }
22
- # Don't install the dependencies when we run `pod install` in the old architecture.
23
- if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
24
- s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
25
- s.pod_target_xcconfig = {
26
- "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
27
- "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
28
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
29
- "BUILD_LIBRARY_FOR_DISTRIBUTION" => "YES",
30
- }
31
- s.dependency "React-Codegen"
32
- s.dependency "RCT-Folly"
33
- s.dependency "RCTRequired"
34
- s.dependency "RCTTypeSafety"
35
- s.dependency "ReactCommon/turbomodule/core"
36
- end
37
- end
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5
+
6
+ Pod::Spec.new do |s|
7
+ s.name = "payme-mini-app"
8
+ s.version = package["version"]
9
+ s.summary = package["description"]
10
+ s.homepage = package["homepage"]
11
+ s.license = package["license"]
12
+ s.authors = package["author"]
13
+
14
+ s.platforms = { :ios => "13.0" }
15
+ s.source = { :git => "http://git.mecorp.vn/paymeproject/payme-miniapp-reactnative.git", :tag => "#{s.version}" }
16
+ s.swift_versions = "5.0"
17
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
18
+
19
+ s.dependency "PayMEMiniApp", "0.0.1"
20
+ s.dependency "React-Core"
21
+ s.pod_target_xcconfig = { 'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES' }
22
+ # Don't install the dependencies when we run `pod install` in the old architecture.
23
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
24
+ s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
25
+ s.pod_target_xcconfig = {
26
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
27
+ "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
28
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
29
+ "BUILD_LIBRARY_FOR_DISTRIBUTION" => "YES",
30
+ }
31
+ s.dependency "React-Codegen"
32
+ s.dependency "RCT-Folly"
33
+ s.dependency "RCTRequired"
34
+ s.dependency "RCTTypeSafety"
35
+ s.dependency "ReactCommon/turbomodule/core"
36
+ end
37
+ end
package/src/index.tsx CHANGED
@@ -1,14 +1,19 @@
1
- import { NativeEventEmitter, NativeModules } from 'react-native';
2
- import type { PayMEOpeningParam } from './index.type';
3
-
4
- const RNPayMEMiniApp = NativeModules.RNPayMEMiniApp;
5
-
6
- export function init(appId: string, publicKey: string, privateKey: string) {
7
- return RNPayMEMiniApp.initPayME(appId, publicKey, privateKey);
8
- }
9
-
10
- export function open(type: string, openingParam: PayMEOpeningParam) {
11
- return RNPayMEMiniApp.open(type, openingParam);
12
- }
13
-
14
- export const PayMEMiniAppEvents = new NativeEventEmitter(RNPayMEMiniApp);
1
+ import { NativeEventEmitter, NativeModules } from 'react-native';
2
+ import type { PayMEEnv, PayMEOpeningParam } from './index.type';
3
+
4
+ const RNPayMEMiniApp = NativeModules.RNPayMEMiniApp;
5
+
6
+ export function init(
7
+ appId: string,
8
+ publicKey: string,
9
+ privateKey: string,
10
+ env: PayMEEnv
11
+ ) {
12
+ return RNPayMEMiniApp.initPayME(appId, publicKey, privateKey, env);
13
+ }
14
+
15
+ export function open(type: string, openingParam: PayMEOpeningParam) {
16
+ return RNPayMEMiniApp.open(type, openingParam);
17
+ }
18
+
19
+ export const PayMEMiniAppEvents = new NativeEventEmitter(RNPayMEMiniApp);
package/src/index.type.ts CHANGED
@@ -1,11 +1,13 @@
1
- type PayMEPaymentParam = {
2
- amount: number;
3
- transactionId: string;
4
- note?: string;
5
- ipnUrl: string;
6
- };
7
-
8
- export type PayMEOpeningParam =
9
- | { action: 'PAYME'; phone: string }
10
- | { action: 'OPEN'; phone: string }
11
- | { action: 'PAY'; phone: string; data: PayMEPaymentParam };
1
+ type PayMEPaymentParam = {
2
+ amount: number;
3
+ transactionId: string;
4
+ note?: string;
5
+ ipnUrl: string;
6
+ };
7
+
8
+ export type PayMEOpeningParam =
9
+ | { action: 'PAYME'; phone: string }
10
+ | { action: 'OPEN'; phone: string }
11
+ | { action: 'PAY'; phone: string; data: PayMEPaymentParam };
12
+
13
+ export type PayMEEnv = 'PRODUCTION' | 'SANDBOX';