judokit-react-native 4.1.3 → 4.2.1

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 (101) hide show
  1. package/JudoKit-ReactNative.podspec +42 -0
  2. package/LICENSE +1 -2
  3. package/README.md +106 -119
  4. package/android/build.gradle +65 -202
  5. package/android/gradle.properties +6 -1
  6. package/android/src/main/AndroidManifest.xml +2 -2
  7. package/android/src/main/AndroidManifestNew.xml +2 -0
  8. package/android/src/main/java/com/judopay/judokit/reactnative/Extensions.kt +382 -0
  9. package/android/src/main/java/com/judopay/judokit/reactnative/Helpers.kt +678 -0
  10. package/android/src/main/java/com/judopay/judokit/reactnative/JudoActivityEventListener.kt +50 -0
  11. package/android/src/main/java/com/judopay/judokit/reactnative/JudoKitReactNativeModule.kt +153 -0
  12. package/android/src/main/java/com/judopay/judokit/reactnative/JudoKitReactNativePackage.kt +16 -0
  13. package/ios/{Classes/Extensions → Extensions}/NSDictionary+JudoConvert.h +1 -1
  14. package/ios/{Classes/Extensions → Extensions}/NSDictionary+JudoConvert.m +2 -2
  15. package/ios/{Classes/Extensions → Extensions}/NSException+JudoValidationExceptions.h +1 -1
  16. package/ios/{Classes/Extensions → Extensions}/NSException+JudoValidationExceptions.m +1 -1
  17. package/ios/{Classes/Extensions → Extensions}/UIColor+RNAdditions.h +1 -1
  18. package/ios/{Classes/Extensions → Extensions}/UIColor+RNAdditions.m +3 -3
  19. package/ios/{Classes/RNJudo.h → JudoKitReactNative.h} +12 -6
  20. package/ios/{Classes/RNJudo.m → JudoKitReactNative.mm} +83 -81
  21. package/ios/{Classes/RNTypes.h → RNTypes.h} +8 -2
  22. package/ios/{Classes/Wrappers → Wrappers}/RNApplePayWrappers.h +1 -1
  23. package/ios/{Classes/Wrappers → Wrappers}/RNApplePayWrappers.m +105 -4
  24. package/ios/{Classes/Wrappers → Wrappers}/RNWrappers.h +14 -14
  25. package/ios/{Classes/Wrappers → Wrappers}/RNWrappers.m +46 -25
  26. package/lib/commonjs/index.js +274 -0
  27. package/lib/commonjs/index.js.map +1 -0
  28. package/lib/commonjs/judo-kit/index.js +212 -0
  29. package/lib/commonjs/judo-kit/index.js.map +1 -0
  30. package/lib/commonjs/types/index.js +273 -0
  31. package/lib/commonjs/types/index.js.map +1 -0
  32. package/lib/commonjs/types/judo-apple-pay-configuration.js +49 -0
  33. package/lib/commonjs/types/judo-apple-pay-configuration.js.map +1 -0
  34. package/lib/commonjs/types/judo-configuration.js +71 -0
  35. package/lib/commonjs/types/judo-configuration.js.map +1 -0
  36. package/lib/commonjs/types/judo-google-pay-configuration.js +28 -0
  37. package/lib/commonjs/types/judo-google-pay-configuration.js.map +1 -0
  38. package/lib/module/index.js +6 -0
  39. package/lib/module/index.js.map +1 -0
  40. package/lib/module/judo-kit/index.js +205 -0
  41. package/lib/module/judo-kit/index.js.map +1 -0
  42. package/lib/module/types/index.js +8 -0
  43. package/lib/module/types/index.js.map +1 -0
  44. package/lib/module/types/judo-apple-pay-configuration.js +43 -0
  45. package/lib/module/types/judo-apple-pay-configuration.js.map +1 -0
  46. package/lib/module/types/judo-configuration.js +65 -0
  47. package/lib/module/types/judo-configuration.js.map +1 -0
  48. package/lib/module/types/judo-google-pay-configuration.js +22 -0
  49. package/lib/module/types/judo-google-pay-configuration.js.map +1 -0
  50. package/lib/typescript/src/index.d.ts +4 -0
  51. package/lib/typescript/src/index.d.ts.map +1 -0
  52. package/lib/typescript/src/judo-kit/index.d.ts +86 -0
  53. package/lib/typescript/src/judo-kit/index.d.ts.map +1 -0
  54. package/lib/typescript/src/types/index.d.ts +4 -0
  55. package/lib/typescript/src/types/index.d.ts.map +1 -0
  56. package/lib/typescript/src/types/judo-apple-pay-configuration.d.ts +75 -0
  57. package/lib/typescript/src/types/judo-apple-pay-configuration.d.ts.map +1 -0
  58. package/lib/typescript/src/types/judo-configuration.d.ts +236 -0
  59. package/lib/typescript/src/types/judo-configuration.d.ts.map +1 -0
  60. package/lib/typescript/src/types/judo-google-pay-configuration.d.ts +42 -0
  61. package/lib/typescript/src/types/judo-google-pay-configuration.d.ts.map +1 -0
  62. package/package.json +158 -79
  63. package/src/index.tsx +51 -0
  64. package/src/judo-kit/index.ts +262 -0
  65. package/src/types/index.ts +54 -0
  66. package/src/types/judo-apple-pay-configuration.ts +85 -0
  67. package/src/types/judo-configuration.ts +263 -0
  68. package/src/types/judo-google-pay-configuration.ts +47 -0
  69. package/JudoPay.tsx +0 -334
  70. package/RNJudopay.podspec +0 -24
  71. package/android/src/main/java/com/reactlibrary/Extensions.kt +0 -372
  72. package/android/src/main/java/com/reactlibrary/Helpers.kt +0 -606
  73. package/android/src/main/java/com/reactlibrary/JudoReactNativeActivityEventListener.kt +0 -48
  74. package/android/src/main/java/com/reactlibrary/JudoReactNativeModule.kt +0 -257
  75. package/android/src/main/java/com/reactlibrary/JudoReactNativePBBAManager.kt +0 -52
  76. package/android/src/main/java/com/reactlibrary/JudoReactNativePackage.kt +0 -14
  77. package/components/JudoPBBAButton.ts +0 -2
  78. package/ios/.xcode.env +0 -11
  79. package/ios/Classes/Views/RNPBBAButtonManager.m +0 -42
  80. package/ios/Classes/Wrappers/RNPBBAWrappers.h +0 -40
  81. package/ios/Classes/Wrappers/RNPBBAWrappers.m +0 -57
  82. package/ios/Podfile +0 -44
  83. package/ios/Podfile.lock +0 -572
  84. package/ios/RNJudo.xcodeproj/project.pbxproj +0 -703
  85. package/ios/RNJudo.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  86. package/ios/RNJudo.xcodeproj/xcshareddata/xcschemes/RNJudo.xcscheme +0 -97
  87. package/ios/RNJudo.xcworkspace/contents.xcworkspacedata +0 -10
  88. package/ios/RNJudoTests/Info.plist +0 -22
  89. package/ios/RNJudoTests/MockConfiguration.json +0 -114
  90. package/ios/RNJudoTests/NSDictionaryConvertTests.m +0 -475
  91. package/ios/RNJudoTests/RNApplePayWrappersTests.m +0 -770
  92. package/ios/RNJudoTests/RNJudoTests.m +0 -37
  93. package/ios/RNJudoTests/RNMocks.h +0 -54
  94. package/ios/RNJudoTests/RNMocks.m +0 -55
  95. package/ios/RNJudoTests/RNPBBAWrappersTests.m +0 -121
  96. package/ios/RNJudoTests/RNThemeTests.m +0 -576
  97. package/ios/RNJudoTests/RNWrappersTests.m +0 -947
  98. package/types/JudoApplePayTypes.tsx +0 -59
  99. package/types/JudoGooglePayTypes.tsx +0 -47
  100. package/types/JudoPBBATypes.tsx +0 -7
  101. package/types/JudoTypes.tsx +0 -251
@@ -1,37 +0,0 @@
1
- //
2
- // RNJudoTests.m
3
- // RNJudoTests
4
- //
5
- // Created by Mihai Petrenco on 5/7/20.
6
- // Copyright © 2020 Alternative Payments Ltd. All rights reserved.
7
- //
8
-
9
- #import <XCTest/XCTest.h>
10
-
11
- @interface RNJudoTests : XCTestCase
12
-
13
- @end
14
-
15
- @implementation RNJudoTests
16
-
17
- - (void)setUp {
18
- // Put setup code here. This method is called before the invocation of each test method in the class.
19
- }
20
-
21
- - (void)tearDown {
22
- // Put teardown code here. This method is called after the invocation of each test method in the class.
23
- }
24
-
25
- - (void)testExample {
26
- // This is an example of a functional test case.
27
- // Use XCTAssert and related functions to verify your tests produce the correct results.
28
- }
29
-
30
- - (void)testPerformanceExample {
31
- // This is an example of a performance test case.
32
- [self measureBlock:^{
33
- // Put the code you want to measure the time of here.
34
- }];
35
- }
36
-
37
- @end
@@ -1,54 +0,0 @@
1
- //
2
- // RNMocks.h
3
- // RNJudo
4
- //
5
- // Copyright (c) 2020 Alternative Payments Ltd
6
- //
7
- // Permission is hereby granted, free of charge, to any person obtaining a copy
8
- // of this software and associated documentation files (the "Software"), to deal
9
- // in the Software without restriction, including without limitation the rights
10
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- // copies of the Software, and to permit persons to whom the Software is
12
- // furnished to do so, subject to the following conditions:
13
- //
14
- // The above copyright notice and this permission notice shall be included in all
15
- // copies or substantial portions of the Software.
16
- //
17
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- // SOFTWARE.
24
-
25
- #import <Foundation/Foundation.h>
26
-
27
- @interface RNMocks : NSObject
28
-
29
- /**
30
- * A reference to the mocked payment properties defined in the MockConfiguration.json file
31
- */
32
- + (NSMutableDictionary *)properties;
33
-
34
- /**
35
- * A reference to the mocked authorization parameters defined in the MockConfiguration.json file
36
- */
37
- + (NSMutableDictionary *)authorization;
38
-
39
- /**
40
- * A reference to the mocked payment configuration defined in the MockConfiguration.json file
41
- */
42
- + (NSMutableDictionary *)configuration;
43
-
44
- /**
45
- * A reference to the mocked Apple Pay configuration defined in the MockConfiguration.json file
46
- */
47
- + (NSMutableDictionary *)applePayConfiguration;
48
-
49
- /**
50
- * A reference to the mocked PBBA configuration defined in the MockConfiguration.json file
51
- */
52
- + (NSMutableDictionary *)pbbaConfiguration;
53
-
54
- @end
@@ -1,55 +0,0 @@
1
- //
2
- // RNMocks.m
3
- // RNJudo
4
- //
5
- // Copyright (c) 2020 Alternative Payments Ltd
6
- //
7
- // Permission is hereby granted, free of charge, to any person obtaining a copy
8
- // of this software and associated documentation files (the "Software"), to deal
9
- // in the Software without restriction, including without limitation the rights
10
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- // copies of the Software, and to permit persons to whom the Software is
12
- // furnished to do so, subject to the following conditions:
13
- //
14
- // The above copyright notice and this permission notice shall be included in all
15
- // copies or substantial portions of the Software.
16
- //
17
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- // SOFTWARE.
24
-
25
- #import "RNMocks.h"
26
-
27
- @implementation RNMocks
28
-
29
- + (NSMutableDictionary *)properties {
30
- NSBundle *testBundle = [NSBundle bundleForClass:RNMocks.class];
31
- NSString *filePath = [testBundle pathForResource:@"MockConfiguration" ofType:@"json"];
32
- NSData *data = [NSData dataWithContentsOfFile:filePath];
33
- NSMutableDictionary *json = [NSJSONSerialization JSONObjectWithData:data
34
- options:kNilOptions
35
- error:nil];
36
- return [json mutableCopy];
37
- }
38
-
39
- + (NSMutableDictionary *)configuration {
40
- return [RNMocks.properties[@"configuration"] mutableCopy];
41
- }
42
-
43
- + (NSMutableDictionary *)authorization {
44
- return [RNMocks.properties[@"authorization"] mutableCopy];
45
- }
46
-
47
- + (NSMutableDictionary *)applePayConfiguration {
48
- return [RNMocks.configuration[@"applePayConfiguration"] mutableCopy];
49
- }
50
-
51
- + (NSMutableDictionary *)pbbaConfiguration {
52
- return [RNMocks.configuration[@"pbbaConfiguration"] mutableCopy];
53
- }
54
-
55
- @end
@@ -1,121 +0,0 @@
1
- //
2
- // RNPBBAWrappersTest.m
3
- // RNJudo
4
- //
5
- // Copyright (c) 2020 Alternative Payments Ltd
6
- //
7
- // Permission is hereby granted, free of charge, to any person obtaining a copy
8
- // of this software and associated documentation files (the "Software"), to deal
9
- // in the Software without restriction, including without limitation the rights
10
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- // copies of the Software, and to permit persons to whom the Software is
12
- // furnished to do so, subject to the following conditions:
13
- //
14
- // The above copyright notice and this permission notice shall be included in all
15
- // copies or substantial portions of the Software.
16
- //
17
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- // FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
20
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- // SOFTWARE.
24
-
25
- #import <XCTest/XCTest.h>
26
- #import "RNPBBAWrappers.h"
27
- #import "RNMocks.h"
28
-
29
- @interface RNPBBAWrappersTest : XCTestCase
30
-
31
- @end
32
-
33
- @implementation RNPBBAWrappersTest
34
-
35
- /*
36
- * GIVEN: a configuration NSDictionary is passed to the PBBA wrapper
37
- *
38
- * WHEN: the NSDictionary is valid
39
- *
40
- * THEN: a configured JPPBBAConfiguration instance should be returned
41
- */
42
- - (void)test_OnValidDictionary_ReturnPBBAConfiguration {
43
- NSDictionary *mockConfig = RNMocks.configuration;
44
- XCTAssertNotNil([RNPBBAWrappers pbbaConfigurationFromConfiguration:mockConfig]);
45
- }
46
-
47
- /*
48
- * GIVEN: a configuration NSDictionary is passed to the PBBA wrapper
49
- *
50
- * WHEN: the [mobileNumber] property is not an NSString
51
- *
52
- * THEN: a 'invalid mobile number type' exception should be thrown
53
- */
54
- - (void)test_OnInvalidMobileNumber_ThrowError {
55
- NSDictionary *config = [self configurationByChangingValue:@123 forKey:@"mobileNumber"];
56
- XCTAssertThrows([RNPBBAWrappers pbbaConfigurationFromConfiguration:config]);
57
- }
58
-
59
- /*
60
- * GIVEN: a configuration NSDictionary is passed to the PBBA wrapper
61
- *
62
- * WHEN: the [emailAddress] property is not an NSString
63
- *
64
- * THEN: a 'invalid email address type' exception should be thrown
65
- */
66
- - (void)test_OnInvalidEmailAddress_ThrowError {
67
- NSDictionary *config = [self configurationByChangingValue:@123 forKey:@"emailAddress"];
68
- XCTAssertThrows([RNPBBAWrappers pbbaConfigurationFromConfiguration:config]);
69
- }
70
-
71
- /*
72
- * GIVEN: a configuration NSDictionary is passed to the PBBA wrapper
73
- *
74
- * WHEN: the [appearsOnStatement] property is not an NSString
75
- *
76
- * THEN: a 'invalid appears on statement type' exception should be thrown
77
- */
78
- - (void)test_OnInvalidAppearsOnStatement_ThrowError {
79
- NSDictionary *config = [self configurationByChangingValue:@123 forKey:@"appearsOnStatement"];
80
- XCTAssertThrows([RNPBBAWrappers pbbaConfigurationFromConfiguration:config]);
81
- }
82
-
83
- /*
84
- * GIVEN: a configuration NSDictionary is passed to the PBBA wrapper
85
- *
86
- * WHEN: the [deeplinkScheme] property is not an NSString
87
- *
88
- * THEN: a 'invalid deeplink scheme type' exception should be thrown
89
- */
90
- - (void)test_OnInvalidDeeplinkScheme_ThrowError {
91
- NSDictionary *config = [self configurationByChangingValue:@123 forKey:@"deeplinkScheme"];
92
- XCTAssertThrows([RNPBBAWrappers pbbaConfigurationFromConfiguration:config]);
93
- }
94
-
95
- /*
96
- * GIVEN: a configuration NSDictionary is passed to the PBBA wrapper
97
- *
98
- * WHEN: the [deeplinkURL] property is not an NSString
99
- *
100
- * THEN: a 'invalid deeplink URL type' exception should be thrown
101
- */
102
- - (void)test_OnInvalidDeeplinkURL_ThrowError {
103
- NSDictionary *config = [self configurationByChangingValue:@123 forKey:@"deeplinkURL"];
104
- XCTAssertThrows([RNPBBAWrappers pbbaConfigurationFromConfiguration:config]);
105
- }
106
-
107
- #pragma mark - Helpers
108
-
109
- - (NSMutableDictionary *)configurationByChangingValue:(id)value
110
- forKey:(NSString *)key {
111
-
112
- NSMutableDictionary *mockConfig = RNMocks.configuration;
113
- NSMutableDictionary *mockPBBAConfig = RNMocks.pbbaConfiguration;
114
-
115
- mockPBBAConfig[key] = value;
116
- mockConfig[@"pbbaConfiguration"] = mockPBBAConfig;
117
-
118
- return mockConfig;
119
- }
120
-
121
- @end