@tapayadot/accept-react-native 1.3.3 → 1.15.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.
Files changed (47) hide show
  1. package/README.md +196 -363
  2. package/android/build.gradle +23 -34
  3. package/android/src/main/java/com/tapaya/acceptsdkreactnative/AcceptSdkReactNativeModule.kt +191 -673
  4. package/android/src/main/java/com/tapaya/acceptsdkreactnative/Errors.kt +81 -0
  5. package/android/src/main/java/com/tapaya/acceptsdkreactnative/Parsing.kt +166 -0
  6. package/android/src/main/java/com/tapaya/acceptsdkreactnative/Serialization.kt +216 -0
  7. package/app.json +2 -2
  8. package/app.plugin.js +1 -1
  9. package/build/Accept.d.ts +255 -0
  10. package/build/Accept.d.ts.map +1 -0
  11. package/build/Accept.js +387 -0
  12. package/build/Accept.js.map +1 -0
  13. package/build/Accept.types.d.ts +352 -0
  14. package/build/Accept.types.d.ts.map +1 -0
  15. package/build/Accept.types.js +9 -0
  16. package/build/Accept.types.js.map +1 -0
  17. package/build/AcceptError.d.ts +53 -0
  18. package/build/AcceptError.d.ts.map +1 -0
  19. package/build/AcceptError.js +107 -0
  20. package/build/AcceptError.js.map +1 -0
  21. package/build/AcceptSdkReactNativeModule.d.ts +67 -26
  22. package/build/AcceptSdkReactNativeModule.d.ts.map +1 -1
  23. package/build/AcceptSdkReactNativeModule.js +53 -3
  24. package/build/AcceptSdkReactNativeModule.js.map +1 -1
  25. package/build/index.d.ts +7 -237
  26. package/build/index.d.ts.map +1 -1
  27. package/build/index.js +7 -254
  28. package/build/index.js.map +1 -1
  29. package/build/utils.d.ts.map +1 -1
  30. package/build/utils.js +2 -2
  31. package/build/utils.js.map +1 -1
  32. package/expo-module.config.json +1 -6
  33. package/package.json +8 -12
  34. package/plugin/withAcceptSdk.js +45 -0
  35. package/build/AcceptSdkReactNative.types.d.ts +0 -259
  36. package/build/AcceptSdkReactNative.types.d.ts.map +0 -1
  37. package/build/AcceptSdkReactNative.types.js +0 -2
  38. package/build/AcceptSdkReactNative.types.js.map +0 -1
  39. package/ios/.xcode.env +0 -11
  40. package/ios/AcceptSdkReactNative.podspec +0 -33
  41. package/ios/AcceptSdkReactNativeAppDelegate.swift +0 -13
  42. package/ios/AcceptSdkReactNativeModule.swift +0 -749
  43. package/ios/Podfile +0 -63
  44. package/ios/Podfile.properties.json +0 -4
  45. package/ios/acceptsdkreactnative.xcodeproj/project.pbxproj +0 -540
  46. package/ios/acceptsdkreactnative.xcodeproj/xcshareddata/xcschemes/acceptsdkreactnative.xcscheme +0 -88
  47. package/plugin/withCustomRepoModule.js +0 -96
@@ -1,88 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Scheme
3
- LastUpgradeVersion = "1130"
4
- version = "1.3">
5
- <BuildAction
6
- parallelizeBuildables = "YES"
7
- buildImplicitDependencies = "YES">
8
- <BuildActionEntries>
9
- <BuildActionEntry
10
- buildForTesting = "YES"
11
- buildForRunning = "YES"
12
- buildForProfiling = "YES"
13
- buildForArchiving = "YES"
14
- buildForAnalyzing = "YES">
15
- <BuildableReference
16
- BuildableIdentifier = "primary"
17
- BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
18
- BuildableName = "acceptsdkreactnative.app"
19
- BlueprintName = "acceptsdkreactnative"
20
- ReferencedContainer = "container:acceptsdkreactnative.xcodeproj">
21
- </BuildableReference>
22
- </BuildActionEntry>
23
- </BuildActionEntries>
24
- </BuildAction>
25
- <TestAction
26
- buildConfiguration = "Debug"
27
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
- shouldUseLaunchSchemeArgsEnv = "YES">
30
- <Testables>
31
- <TestableReference
32
- skipped = "NO">
33
- <BuildableReference
34
- BuildableIdentifier = "primary"
35
- BlueprintIdentifier = "00E356ED1AD99517003FC87E"
36
- BuildableName = "acceptsdkreactnativeTests.xctest"
37
- BlueprintName = "acceptsdkreactnativeTests"
38
- ReferencedContainer = "container:acceptsdkreactnative.xcodeproj">
39
- </BuildableReference>
40
- </TestableReference>
41
- </Testables>
42
- </TestAction>
43
- <LaunchAction
44
- buildConfiguration = "Debug"
45
- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
46
- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47
- launchStyle = "0"
48
- useCustomWorkingDirectory = "NO"
49
- ignoresPersistentStateOnLaunch = "NO"
50
- debugDocumentVersioning = "YES"
51
- debugServiceExtension = "internal"
52
- allowLocationSimulation = "YES">
53
- <BuildableProductRunnable
54
- runnableDebuggingMode = "0">
55
- <BuildableReference
56
- BuildableIdentifier = "primary"
57
- BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
58
- BuildableName = "acceptsdkreactnative.app"
59
- BlueprintName = "acceptsdkreactnative"
60
- ReferencedContainer = "container:acceptsdkreactnative.xcodeproj">
61
- </BuildableReference>
62
- </BuildableProductRunnable>
63
- </LaunchAction>
64
- <ProfileAction
65
- buildConfiguration = "Release"
66
- shouldUseLaunchSchemeArgsEnv = "YES"
67
- savedToolIdentifier = ""
68
- useCustomWorkingDirectory = "NO"
69
- debugDocumentVersioning = "YES">
70
- <BuildableProductRunnable
71
- runnableDebuggingMode = "0">
72
- <BuildableReference
73
- BuildableIdentifier = "primary"
74
- BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
75
- BuildableName = "acceptsdkreactnative.app"
76
- BlueprintName = "acceptsdkreactnative"
77
- ReferencedContainer = "container:acceptsdkreactnative.xcodeproj">
78
- </BuildableReference>
79
- </BuildableProductRunnable>
80
- </ProfileAction>
81
- <AnalyzeAction
82
- buildConfiguration = "Debug">
83
- </AnalyzeAction>
84
- <ArchiveAction
85
- buildConfiguration = "Release"
86
- revealArchiveInOrganizer = "YES">
87
- </ArchiveAction>
88
- </Scheme>
@@ -1,96 +0,0 @@
1
- const {
2
- withPlugins,
3
- withXcodeProject,
4
- withGradleProperties,
5
- } = require("@expo/config-plugins");
6
- const { withBuildProperties } = require("expo-build-properties");
7
-
8
- const ACCEPT_SDK_IOS_REPO = "https://github.com/tapayadot/accept-ios";
9
- const ACCEPT_SDK_IOS_PRODUCTS = ["AcceptSDK"];
10
-
11
- const STRIPE_GRADLE_PROPERTY = "com.tapaya.accept.enableStripe";
12
-
13
- function withAcceptSdkIos(config) {
14
- return withXcodeProject(config, (config) => {
15
- const project = config.modResults;
16
- const objects = project.hash.project.objects;
17
-
18
- // Skip if already added
19
- const existingRefs = objects["XCRemoteSwiftPackageReference"] || {};
20
- const alreadyAdded = Object.values(existingRefs).some(
21
- (ref) => ref.repositoryURL === `"${ACCEPT_SDK_IOS_REPO}"`
22
- );
23
- if (alreadyAdded) return config;
24
-
25
- // Add XCRemoteSwiftPackageReference
26
- const packageRefKey = project.generateUuid();
27
- objects["XCRemoteSwiftPackageReference"] = objects["XCRemoteSwiftPackageReference"] || {};
28
- objects["XCRemoteSwiftPackageReference"][packageRefKey] = {
29
- isa: "XCRemoteSwiftPackageReference",
30
- repositoryURL: `"${ACCEPT_SDK_IOS_REPO}"`,
31
- requirement: {
32
- kind: "exactVersion",
33
- version: "1.2.4",
34
- },
35
- };
36
-
37
- // Register it on the PBXProject
38
- const pbxProject = project.getFirstProject().firstProject;
39
- pbxProject.packageReferences = pbxProject.packageReferences || [];
40
- pbxProject.packageReferences.push({
41
- value: packageRefKey,
42
- comment: `XCRemoteSwiftPackageReference "${ACCEPT_SDK_IOS_REPO.split("/").pop()}"`,
43
- });
44
-
45
- // Add XCSwiftPackageProductDependency for each product and link to main target
46
- objects["XCSwiftPackageProductDependency"] = objects["XCSwiftPackageProductDependency"] || {};
47
- const mainTarget = project.getFirstTarget().firstTarget;
48
- mainTarget.packageProductDependencies = mainTarget.packageProductDependencies || [];
49
-
50
- for (const productName of ACCEPT_SDK_IOS_PRODUCTS) {
51
- const productKey = project.generateUuid();
52
- objects["XCSwiftPackageProductDependency"][productKey] = {
53
- isa: "XCSwiftPackageProductDependency",
54
- package: packageRefKey,
55
- productName,
56
- };
57
- mainTarget.packageProductDependencies.push({
58
- value: productKey,
59
- comment: productName,
60
- });
61
- }
62
-
63
- return config;
64
- });
65
- }
66
-
67
- function withAcceptStripeAndroid(config, enableStripe) {
68
- return withGradleProperties(config, (config) => {
69
- config.modResults = config.modResults.filter(
70
- (item) =>
71
- !(item.type === "property" && item.key === STRIPE_GRADLE_PROPERTY)
72
- );
73
- config.modResults.push({
74
- type: "property",
75
- key: STRIPE_GRADLE_PROPERTY,
76
- value: String(Boolean(enableStripe)),
77
- });
78
- return config;
79
- });
80
- }
81
-
82
- module.exports = function withAcceptSdk(config, props = {}) {
83
- const enableStripe = (props && props.enableStripe) || false;
84
- return withPlugins(config, [
85
- [
86
- withBuildProperties,
87
- {
88
- android: {
89
- minSdkVersion: 30,
90
- },
91
- },
92
- ],
93
- (config) => withAcceptStripeAndroid(config, enableStripe),
94
- withAcceptSdkIos,
95
- ]);
96
- };