payme-mini-app 0.1.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/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Phan Thanh Nam
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # payme-mini-app
2
+
3
+
4
+
5
+ ## Installation
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)
@@ -0,0 +1,86 @@
1
+ buildscript {
2
+ // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
+ def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["RNPayMEMiniApp_kotlinVersion"]
4
+
5
+ repositories {
6
+ google()
7
+ mavenCentral()
8
+ }
9
+
10
+ dependencies {
11
+ classpath "com.android.tools.build:gradle:7.2.1"
12
+ // noinspection DifferentKotlinGradleVersion
13
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
+ }
15
+ }
16
+
17
+ def isNewArchitectureEnabled() {
18
+ return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
19
+ }
20
+
21
+ apply plugin: "com.android.library"
22
+ apply plugin: "kotlin-android"
23
+
24
+ if (isNewArchitectureEnabled()) {
25
+ apply plugin: "com.facebook.react"
26
+ }
27
+
28
+ def getExtOrDefault(name) {
29
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["RNPayMEMiniApp_" + name]
30
+ }
31
+
32
+ def getExtOrIntegerDefault(name) {
33
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["RNPayMEMiniApp_" + name]).toInteger()
34
+ }
35
+
36
+ android {
37
+ compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
38
+
39
+ defaultConfig {
40
+ minSdkVersion getExtOrIntegerDefault("minSdkVersion")
41
+ targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
42
+ buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
43
+ }
44
+ buildTypes {
45
+ release {
46
+ minifyEnabled false
47
+ }
48
+ }
49
+
50
+ lintOptions {
51
+ disable "GradleCompatible"
52
+ }
53
+
54
+ compileOptions {
55
+ sourceCompatibility JavaVersion.VERSION_1_8
56
+ targetCompatibility JavaVersion.VERSION_1_8
57
+ }
58
+
59
+ }
60
+
61
+ repositories {
62
+ mavenCentral()
63
+ google()
64
+ maven {
65
+ url 'https://jitpack.io'
66
+ }
67
+ }
68
+
69
+ def kotlin_version = getExtOrDefault("kotlinVersion")
70
+
71
+ dependencies {
72
+ // For < 0.71, this will be from the local maven repo
73
+ // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
74
+ //noinspection GradleDynamicVersion
75
+ implementation "com.facebook.react:react-native"
76
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
77
+ implementation 'com.github.PayME-Miniapp:native-android:0.0.7'
78
+ }
79
+
80
+ if (isNewArchitectureEnabled()) {
81
+ react {
82
+ jsRootDir = file("../src/")
83
+ libraryName = "RNPayMEMiniApp"
84
+ codegenJavaPackageName = "com.paymeminiapp"
85
+ }
86
+ }
@@ -0,0 +1,5 @@
1
+ RNPayMEMiniApp_kotlinVersion=1.7.0
2
+ RNPayMEMiniApp_minSdkVersion=21
3
+ RNPayMEMiniApp_targetSdkVersion=31
4
+ RNPayMEMiniApp_compileSdkVersion=31
5
+ RNPayMEMiniApp_ndkversion=21.4.7075529
@@ -0,0 +1,4 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.paymeminiapp">
3
+
4
+ </manifest>
@@ -0,0 +1,26 @@
1
+ package com.paymeminiapp
2
+
3
+ import android.content.Context
4
+ import com.facebook.react.bridge.ReactApplicationContext
5
+ import com.facebook.react.bridge.ReactContextBaseJavaModule
6
+ import com.facebook.react.bridge.ReactMethod
7
+ import com.facebook.react.bridge.Promise
8
+ import com.payme.sdk.PayMEMiniApp
9
+
10
+ class RNPayMEMiniAppModule(reactContext: ReactApplicationContext) :
11
+ ReactContextBaseJavaModule(reactContext) {
12
+ private val payMEMiniApp: PayMEMiniApp by lazy { PayMEMiniApp(reactApplicationContext) }
13
+
14
+ override fun getName(): String {
15
+ return NAME
16
+ }
17
+
18
+ @ReactMethod
19
+ fun open(type: String) {
20
+ payMEMiniApp.openMiniApp()
21
+ }
22
+
23
+ companion object {
24
+ const val NAME = "RNPayMEMiniApp"
25
+ }
26
+ }
@@ -0,0 +1,17 @@
1
+ package com.paymeminiapp
2
+
3
+ import com.facebook.react.ReactPackage
4
+ import com.facebook.react.bridge.NativeModule
5
+ import com.facebook.react.bridge.ReactApplicationContext
6
+ import com.facebook.react.uimanager.ViewManager
7
+
8
+
9
+ class RNPayMEMiniAppPackage : ReactPackage {
10
+ override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
11
+ return listOf(RNPayMEMiniAppModule(reactContext))
12
+ }
13
+
14
+ override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
15
+ return emptyList()
16
+ }
17
+ }
@@ -0,0 +1,2 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import <React/RCTViewManager.h>
@@ -0,0 +1,12 @@
1
+ #import <React/RCTBridgeModule.h>
2
+
3
+ @interface RCT_EXTERN_MODULE(RNPayMEMiniApp, NSObject)
4
+
5
+ RCT_EXTERN_METHOD(open:(NSString*)type)
6
+
7
+ + (BOOL)requiresMainQueueSetup
8
+ {
9
+ return YES;
10
+ }
11
+
12
+ @end
@@ -0,0 +1,17 @@
1
+ import PayMEMiniApp
2
+
3
+ @objc(RNPayMEMiniApp)
4
+ class RNPayMEMiniApp: NSObject {
5
+ let payme = PayME()
6
+
7
+ @objc func open(_ type: String = "modal") {
8
+ let RNVC = UIApplication.shared.delegate?.window??.rootViewController
9
+ if (type == "screen") {
10
+ guard let navigationController = RNVC as? UINavigationController else { return }
11
+ navigationController.pushViewController(payme, animated: true)
12
+ payme.open()
13
+ } else {
14
+ payme.open(from: RNVC)
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,281 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 46;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ F4FF95D7245B92E800C19C63 /* RNPayMEMiniApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* RNPayMEMiniApp.swift */; };
11
+ /* End PBXBuildFile section */
12
+
13
+ /* Begin PBXCopyFilesBuildPhase section */
14
+ 58B511D91A9E6C8500147676 /* CopyFiles */ = {
15
+ isa = PBXCopyFilesBuildPhase;
16
+ buildActionMask = 2147483647;
17
+ dstPath = "include/$(PRODUCT_NAME)";
18
+ dstSubfolderSpec = 16;
19
+ files = (
20
+ );
21
+ runOnlyForDeploymentPostprocessing = 0;
22
+ };
23
+ /* End PBXCopyFilesBuildPhase section */
24
+
25
+ /* Begin PBXFileReference section */
26
+ 134814201AA4EA6300B7C361 /* libRNPayMEMiniApp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNPayMEMiniApp.a; sourceTree = BUILT_PRODUCTS_DIR; };
27
+ B3E7B5891CC2AC0600A0062D /* RNPayMEMiniApp.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPayMEMiniApp.m; sourceTree = "<group>"; };
28
+ F4FF95D5245B92E700C19C63 /* RNPayMEMiniApp-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RNPayMEMiniApp-Bridging-Header.h"; sourceTree = "<group>"; };
29
+ F4FF95D6245B92E800C19C63 /* RNPayMEMiniApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNPayMEMiniApp.swift; sourceTree = "<group>"; };
30
+ /* End PBXFileReference section */
31
+
32
+ /* Begin PBXFrameworksBuildPhase section */
33
+ 58B511D81A9E6C8500147676 /* Frameworks */ = {
34
+ isa = PBXFrameworksBuildPhase;
35
+ buildActionMask = 2147483647;
36
+ files = (
37
+ );
38
+ runOnlyForDeploymentPostprocessing = 0;
39
+ };
40
+ /* End PBXFrameworksBuildPhase section */
41
+
42
+ /* Begin PBXGroup section */
43
+ 134814211AA4EA7D00B7C361 /* Products */ = {
44
+ isa = PBXGroup;
45
+ children = (
46
+ 134814201AA4EA6300B7C361 /* libRNPayMEMiniApp.a */,
47
+ );
48
+ name = Products;
49
+ sourceTree = "<group>";
50
+ };
51
+ 58B511D21A9E6C8500147676 = {
52
+ isa = PBXGroup;
53
+ children = (
54
+ F4FF95D6245B92E800C19C63 /* RNPayMEMiniApp.swift */,
55
+ B3E7B5891CC2AC0600A0062D /* RNPayMEMiniApp.m */,
56
+ F4FF95D5245B92E700C19C63 /* RNPayMEMiniApp-Bridging-Header.h */,
57
+ 134814211AA4EA7D00B7C361 /* Products */,
58
+ );
59
+ sourceTree = "<group>";
60
+ };
61
+ /* End PBXGroup section */
62
+
63
+ /* Begin PBXNativeTarget section */
64
+ 58B511DA1A9E6C8500147676 /* RNPayMEMiniApp */ = {
65
+ isa = PBXNativeTarget;
66
+ buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNPayMEMiniApp" */;
67
+ buildPhases = (
68
+ 58B511D71A9E6C8500147676 /* Sources */,
69
+ 58B511D81A9E6C8500147676 /* Frameworks */,
70
+ 58B511D91A9E6C8500147676 /* CopyFiles */,
71
+ );
72
+ buildRules = (
73
+ );
74
+ dependencies = (
75
+ );
76
+ name = RNPayMEMiniApp;
77
+ productName = RCTDataManager;
78
+ productReference = 134814201AA4EA6300B7C361 /* libRNPayMEMiniApp.a */;
79
+ productType = "com.apple.product-type.library.static";
80
+ };
81
+ /* End PBXNativeTarget section */
82
+
83
+ /* Begin PBXProject section */
84
+ 58B511D31A9E6C8500147676 /* Project object */ = {
85
+ isa = PBXProject;
86
+ attributes = {
87
+ LastUpgradeCheck = 0920;
88
+ ORGANIZATIONNAME = Facebook;
89
+ TargetAttributes = {
90
+ 58B511DA1A9E6C8500147676 = {
91
+ CreatedOnToolsVersion = 6.1.1;
92
+ };
93
+ };
94
+ };
95
+ buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNPayMEMiniApp" */;
96
+ compatibilityVersion = "Xcode 3.2";
97
+ developmentRegion = English;
98
+ hasScannedForEncodings = 0;
99
+ knownRegions = (
100
+ English,
101
+ en,
102
+ );
103
+ mainGroup = 58B511D21A9E6C8500147676;
104
+ productRefGroup = 58B511D21A9E6C8500147676;
105
+ projectDirPath = "";
106
+ projectRoot = "";
107
+ targets = (
108
+ 58B511DA1A9E6C8500147676 /* RNPayMEMiniApp */,
109
+ );
110
+ };
111
+ /* End PBXProject section */
112
+
113
+ /* Begin PBXSourcesBuildPhase section */
114
+ 58B511D71A9E6C8500147676 /* Sources */ = {
115
+ isa = PBXSourcesBuildPhase;
116
+ buildActionMask = 2147483647;
117
+ files = (
118
+ F4FF95D7245B92E800C19C63 /* RNPayMEMiniApp.swift in Sources */,
119
+ );
120
+ runOnlyForDeploymentPostprocessing = 0;
121
+ };
122
+ /* End PBXSourcesBuildPhase section */
123
+
124
+ /* Begin XCBuildConfiguration section */
125
+ 58B511ED1A9E6C8500147676 /* Debug */ = {
126
+ isa = XCBuildConfiguration;
127
+ buildSettings = {
128
+ ALWAYS_SEARCH_USER_PATHS = NO;
129
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
130
+ CLANG_CXX_LIBRARY = "libc++";
131
+ CLANG_ENABLE_MODULES = YES;
132
+ CLANG_ENABLE_OBJC_ARC = YES;
133
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
134
+ CLANG_WARN_BOOL_CONVERSION = YES;
135
+ CLANG_WARN_COMMA = YES;
136
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
137
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
138
+ CLANG_WARN_EMPTY_BODY = YES;
139
+ CLANG_WARN_ENUM_CONVERSION = YES;
140
+ CLANG_WARN_INFINITE_RECURSION = YES;
141
+ CLANG_WARN_INT_CONVERSION = YES;
142
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
143
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
144
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
145
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
146
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
147
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
148
+ CLANG_WARN_UNREACHABLE_CODE = YES;
149
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
150
+ COPY_PHASE_STRIP = NO;
151
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
152
+ ENABLE_TESTABILITY = YES;
153
+ "EXCLUDED_ARCHS[sdk=*]" = arm64;
154
+ GCC_C_LANGUAGE_STANDARD = gnu99;
155
+ GCC_DYNAMIC_NO_PIC = NO;
156
+ GCC_NO_COMMON_BLOCKS = YES;
157
+ GCC_OPTIMIZATION_LEVEL = 0;
158
+ GCC_PREPROCESSOR_DEFINITIONS = (
159
+ "DEBUG=1",
160
+ "$(inherited)",
161
+ );
162
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
163
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
164
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
165
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
166
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
167
+ GCC_WARN_UNUSED_FUNCTION = YES;
168
+ GCC_WARN_UNUSED_VARIABLE = YES;
169
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
170
+ MTL_ENABLE_DEBUG_INFO = YES;
171
+ ONLY_ACTIVE_ARCH = YES;
172
+ SDKROOT = iphoneos;
173
+ };
174
+ name = Debug;
175
+ };
176
+ 58B511EE1A9E6C8500147676 /* Release */ = {
177
+ isa = XCBuildConfiguration;
178
+ buildSettings = {
179
+ ALWAYS_SEARCH_USER_PATHS = NO;
180
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
181
+ CLANG_CXX_LIBRARY = "libc++";
182
+ CLANG_ENABLE_MODULES = YES;
183
+ CLANG_ENABLE_OBJC_ARC = YES;
184
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
185
+ CLANG_WARN_BOOL_CONVERSION = YES;
186
+ CLANG_WARN_COMMA = YES;
187
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
188
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
189
+ CLANG_WARN_EMPTY_BODY = YES;
190
+ CLANG_WARN_ENUM_CONVERSION = YES;
191
+ CLANG_WARN_INFINITE_RECURSION = YES;
192
+ CLANG_WARN_INT_CONVERSION = YES;
193
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
194
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
195
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
196
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
197
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
198
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
199
+ CLANG_WARN_UNREACHABLE_CODE = YES;
200
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
201
+ COPY_PHASE_STRIP = YES;
202
+ ENABLE_NS_ASSERTIONS = NO;
203
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
204
+ "EXCLUDED_ARCHS[sdk=*]" = arm64;
205
+ GCC_C_LANGUAGE_STANDARD = gnu99;
206
+ GCC_NO_COMMON_BLOCKS = YES;
207
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
208
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
209
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
210
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
211
+ GCC_WARN_UNUSED_FUNCTION = YES;
212
+ GCC_WARN_UNUSED_VARIABLE = YES;
213
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
214
+ MTL_ENABLE_DEBUG_INFO = NO;
215
+ SDKROOT = iphoneos;
216
+ VALIDATE_PRODUCT = YES;
217
+ };
218
+ name = Release;
219
+ };
220
+ 58B511F01A9E6C8500147676 /* Debug */ = {
221
+ isa = XCBuildConfiguration;
222
+ buildSettings = {
223
+ HEADER_SEARCH_PATHS = (
224
+ "$(inherited)",
225
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
226
+ "$(SRCROOT)/../../../React/**",
227
+ "$(SRCROOT)/../../react-native/React/**",
228
+ );
229
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
230
+ OTHER_LDFLAGS = "-ObjC";
231
+ PRODUCT_NAME = RNPayMEMiniApp;
232
+ SKIP_INSTALL = YES;
233
+ SWIFT_OBJC_BRIDGING_HEADER = "RNPayMEMiniApp-Bridging-Header.h";
234
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
235
+ SWIFT_VERSION = 5.0;
236
+ };
237
+ name = Debug;
238
+ };
239
+ 58B511F11A9E6C8500147676 /* Release */ = {
240
+ isa = XCBuildConfiguration;
241
+ buildSettings = {
242
+ HEADER_SEARCH_PATHS = (
243
+ "$(inherited)",
244
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
245
+ "$(SRCROOT)/../../../React/**",
246
+ "$(SRCROOT)/../../react-native/React/**",
247
+ );
248
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
249
+ OTHER_LDFLAGS = "-ObjC";
250
+ PRODUCT_NAME = RNPayMEMiniApp;
251
+ SKIP_INSTALL = YES;
252
+ SWIFT_OBJC_BRIDGING_HEADER = "RNPayMEMiniApp-Bridging-Header.h";
253
+ SWIFT_VERSION = 5.0;
254
+ };
255
+ name = Release;
256
+ };
257
+ /* End XCBuildConfiguration section */
258
+
259
+ /* Begin XCConfigurationList section */
260
+ 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNPayMEMiniApp" */ = {
261
+ isa = XCConfigurationList;
262
+ buildConfigurations = (
263
+ 58B511ED1A9E6C8500147676 /* Debug */,
264
+ 58B511EE1A9E6C8500147676 /* Release */,
265
+ );
266
+ defaultConfigurationIsVisible = 0;
267
+ defaultConfigurationName = Release;
268
+ };
269
+ 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNPayMEMiniApp" */ = {
270
+ isa = XCConfigurationList;
271
+ buildConfigurations = (
272
+ 58B511F01A9E6C8500147676 /* Debug */,
273
+ 58B511F11A9E6C8500147676 /* Release */,
274
+ );
275
+ defaultConfigurationIsVisible = 0;
276
+ defaultConfigurationName = Release;
277
+ };
278
+ /* End XCConfigurationList section */
279
+ };
280
+ rootObject = 58B511D31A9E6C8500147676 /* Project object */;
281
+ }
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ </Workspace>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>IDEDidComputeMac32BitWarning</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>RNPayMEMiniApp.xcscheme_^#shared#^_</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ </dict>
13
+ </dict>
14
+ </plist>
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.open = open;
7
+ var _reactNative = require("react-native");
8
+ const RNPayMEMiniApp = _reactNative.NativeModules.RNPayMEMiniApp;
9
+ function open(type) {
10
+ return RNPayMEMiniApp.open(type);
11
+ }
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["RNPayMEMiniApp","NativeModules","open","type"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;AAAA;AAEA,MAAMA,cAAc,GAAGC,0BAAa,CAACD,cAAc;AAE5C,SAASE,IAAI,CAACC,IAAY,EAAE;EACjC,OAAOH,cAAc,CAACE,IAAI,CAACC,IAAI,CAAC;AAClC"}
@@ -0,0 +1,6 @@
1
+ import { NativeModules } from 'react-native';
2
+ const RNPayMEMiniApp = NativeModules.RNPayMEMiniApp;
3
+ export function open(type) {
4
+ return RNPayMEMiniApp.open(type);
5
+ }
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModules","RNPayMEMiniApp","open","type"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAE5C,MAAMC,cAAc,GAAGD,aAAa,CAACC,cAAc;AAEnD,OAAO,SAASC,IAAI,CAACC,IAAY,EAAE;EACjC,OAAOF,cAAc,CAACC,IAAI,CAACC,IAAI,CAAC;AAClC"}
@@ -0,0 +1,2 @@
1
+ export declare function open(type: string): any;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAIA,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,OAEhC"}
package/package.json ADDED
@@ -0,0 +1,160 @@
1
+ {
2
+ "name": "payme-mini-app",
3
+ "version": "0.1.0",
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
+ }
@@ -0,0 +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", "1.0.12"
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 ADDED
@@ -0,0 +1,7 @@
1
+ import { NativeModules } from 'react-native';
2
+
3
+ const RNPayMEMiniApp = NativeModules.RNPayMEMiniApp
4
+
5
+ export function open(type: string) {
6
+ return RNPayMEMiniApp.open(type);
7
+ }