@tapayadot/accept-react-native 1.0.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 +201 -0
- package/README.md +262 -0
- package/android/build.gradle +49 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/tapaya/acceptsdkreactnative/AcceptSdkReactNativeModule.kt +418 -0
- package/app.json +5 -0
- package/app.plugin.js +1 -0
- package/build/AcceptSdkReactNative.types.d.ts +117 -0
- package/build/AcceptSdkReactNative.types.d.ts.map +1 -0
- package/build/AcceptSdkReactNative.types.js +2 -0
- package/build/AcceptSdkReactNative.types.js.map +1 -0
- package/build/AcceptSdkReactNativeModule.d.ts +24 -0
- package/build/AcceptSdkReactNativeModule.d.ts.map +1 -0
- package/build/AcceptSdkReactNativeModule.js +4 -0
- package/build/AcceptSdkReactNativeModule.js.map +1 -0
- package/build/index.d.ts +144 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +180 -0
- package/build/index.js.map +1 -0
- package/expo-module.config.json +11 -0
- package/ios/.xcode.env +11 -0
- package/ios/AcceptSdkReactNative.podspec +33 -0
- package/ios/AcceptSdkReactNativeAppDelegate.swift +13 -0
- package/ios/AcceptSdkReactNativeModule.swift +412 -0
- package/ios/Podfile +63 -0
- package/ios/Podfile.properties.json +4 -0
- package/ios/acceptsdkreactnative.xcodeproj/project.pbxproj +540 -0
- package/ios/acceptsdkreactnative.xcodeproj/xcshareddata/xcschemes/acceptsdkreactnative.xcscheme +88 -0
- package/package.json +85 -0
- package/plugin/withCustomRepoModule.js +78 -0
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tapayadot/accept-react-native",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Accept SDK for React Native/Expo",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react-native",
|
|
7
|
+
"expo",
|
|
8
|
+
"accept-react-native",
|
|
9
|
+
"AcceptSdkReactNative",
|
|
10
|
+
"expo-module",
|
|
11
|
+
"native-module",
|
|
12
|
+
"payments",
|
|
13
|
+
"tapaya",
|
|
14
|
+
"terminal",
|
|
15
|
+
"softpos"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://github.com/tapayadot/accept-react-native#readme",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/tapayadot/accept-react-native.git"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/tapayadot/accept-react-native/issues"
|
|
24
|
+
},
|
|
25
|
+
"license": "Apache-2.0",
|
|
26
|
+
"author": {
|
|
27
|
+
"name": "Tapaya s.r.o.",
|
|
28
|
+
"email": "info@tapaya.com",
|
|
29
|
+
"url": "https://tapaya.com"
|
|
30
|
+
},
|
|
31
|
+
"main": "build/index.js",
|
|
32
|
+
"types": "build/index.d.ts",
|
|
33
|
+
"react-native": "build/index.js",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./build/index.d.ts",
|
|
37
|
+
"import": "./build/index.js",
|
|
38
|
+
"require": "./build/index.js",
|
|
39
|
+
"default": "./build/index.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"build",
|
|
44
|
+
"ios",
|
|
45
|
+
"android",
|
|
46
|
+
"plugin",
|
|
47
|
+
"app.json",
|
|
48
|
+
"app.plugin.js",
|
|
49
|
+
"expo-module.config.json"
|
|
50
|
+
],
|
|
51
|
+
"sideEffects": false,
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "expo-module build",
|
|
54
|
+
"clean": "expo-module clean",
|
|
55
|
+
"lint": "expo-module lint",
|
|
56
|
+
"test": "expo-module test",
|
|
57
|
+
"prepare": "expo-module prepare",
|
|
58
|
+
"prepublishOnly": "expo-module prepublishOnly",
|
|
59
|
+
"open:ios": "xed example/ios",
|
|
60
|
+
"open:android": "open -a \"Android Studio\" example/android",
|
|
61
|
+
"android": "expo run:android",
|
|
62
|
+
"ios": "expo run:ios"
|
|
63
|
+
},
|
|
64
|
+
"expo": {
|
|
65
|
+
"plugins": [
|
|
66
|
+
"./app.plugin.js"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"expo": "*",
|
|
71
|
+
"react": "*",
|
|
72
|
+
"react-native": "*"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@expo/npm-proofread": "1.0.1",
|
|
76
|
+
"@react-native-community/cli": "20.1.3",
|
|
77
|
+
"@types/react": "19.2.14",
|
|
78
|
+
"expo-build-properties": "55.0.13",
|
|
79
|
+
"expo-module-scripts": "55.0.2",
|
|
80
|
+
"typescript": "5.9.3"
|
|
81
|
+
},
|
|
82
|
+
"workspaces": [
|
|
83
|
+
"example"
|
|
84
|
+
]
|
|
85
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const { withPlugins, withXcodeProject } = require("@expo/config-plugins");
|
|
2
|
+
const { withBuildProperties } = require("expo-build-properties");
|
|
3
|
+
|
|
4
|
+
const ACCEPT_SDK_IOS_REPO = "https://github.com/tapayadot/accept-ios";
|
|
5
|
+
const ACCEPT_SDK_IOS_PRODUCTS = ["AcceptSDK"];
|
|
6
|
+
|
|
7
|
+
function withAcceptSdkIos(config) {
|
|
8
|
+
return withXcodeProject(config, (config) => {
|
|
9
|
+
const project = config.modResults;
|
|
10
|
+
const objects = project.hash.project.objects;
|
|
11
|
+
|
|
12
|
+
// Skip if already added
|
|
13
|
+
const existingRefs = objects["XCRemoteSwiftPackageReference"] || {};
|
|
14
|
+
const alreadyAdded = Object.values(existingRefs).some(
|
|
15
|
+
(ref) => ref.repositoryURL === `"${ACCEPT_SDK_IOS_REPO}"`
|
|
16
|
+
);
|
|
17
|
+
if (alreadyAdded) return config;
|
|
18
|
+
|
|
19
|
+
// Add XCRemoteSwiftPackageReference
|
|
20
|
+
const packageRefKey = project.generateUuid();
|
|
21
|
+
objects["XCRemoteSwiftPackageReference"] = objects["XCRemoteSwiftPackageReference"] || {};
|
|
22
|
+
objects["XCRemoteSwiftPackageReference"][packageRefKey] = {
|
|
23
|
+
isa: "XCRemoteSwiftPackageReference",
|
|
24
|
+
repositoryURL: `"${ACCEPT_SDK_IOS_REPO}"`,
|
|
25
|
+
requirement: {
|
|
26
|
+
kind: "branch",
|
|
27
|
+
branch: "master",
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Register it on the PBXProject
|
|
32
|
+
const pbxProject = project.getFirstProject().firstProject;
|
|
33
|
+
pbxProject.packageReferences = pbxProject.packageReferences || [];
|
|
34
|
+
pbxProject.packageReferences.push({
|
|
35
|
+
value: packageRefKey,
|
|
36
|
+
comment: `XCRemoteSwiftPackageReference "${ACCEPT_SDK_IOS_REPO.split("/").pop()}"`,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// Add XCSwiftPackageProductDependency for each product and link to main target
|
|
40
|
+
objects["XCSwiftPackageProductDependency"] = objects["XCSwiftPackageProductDependency"] || {};
|
|
41
|
+
const mainTarget = project.getFirstTarget().firstTarget;
|
|
42
|
+
mainTarget.packageProductDependencies = mainTarget.packageProductDependencies || [];
|
|
43
|
+
|
|
44
|
+
for (const productName of ACCEPT_SDK_IOS_PRODUCTS) {
|
|
45
|
+
const productKey = project.generateUuid();
|
|
46
|
+
objects["XCSwiftPackageProductDependency"][productKey] = {
|
|
47
|
+
isa: "XCSwiftPackageProductDependency",
|
|
48
|
+
package: packageRefKey,
|
|
49
|
+
productName,
|
|
50
|
+
};
|
|
51
|
+
mainTarget.packageProductDependencies.push({
|
|
52
|
+
value: productKey,
|
|
53
|
+
comment: productName,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return config;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = function withMyModule(config) {
|
|
62
|
+
return withPlugins(config, [
|
|
63
|
+
[
|
|
64
|
+
withBuildProperties,
|
|
65
|
+
{
|
|
66
|
+
android: {
|
|
67
|
+
minSdkVersion: 30,
|
|
68
|
+
extraMavenRepos: [
|
|
69
|
+
{
|
|
70
|
+
url: "https://maven.pkg.github.com/tapayadot/accept-sdk-android",
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
withAcceptSdkIos,
|
|
77
|
+
]);
|
|
78
|
+
};
|