react-native-smallcase-gateway 1.6.1 → 1.6.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.6.3](https://github.com/smallcase/react-native-smallcase-gateway/compare/v1.6.2...v1.6.3) (2022-11-22)
6
+
7
+ ### [1.6.2](https://github.com/smallcase/react-native-smallcase-gateway/compare/v1.6.1...v1.6.2) (2022-11-11)
8
+
9
+
10
+ ### Features
11
+
12
+ * added support for MF Holdings import fix ([0bf5388](https://github.com/smallcase/react-native-smallcase-gateway/commit/0bf5388e1ca6ee5534681dfa35bd3f69c3aefd7a))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * Data in mf response is null ([bfca609](https://github.com/smallcase/react-native-smallcase-gateway/commit/bfca609a3075a9e45dc63c4fa9e4561ea3b6cd37))
18
+
5
19
  ### [1.6.1](https://github.com/smallcase/react-native-smallcase-gateway/compare/v1.5.4...v1.6.1) (2022-10-19)
6
20
 
7
21
 
@@ -81,7 +81,7 @@ repositories {
81
81
  dependencies {
82
82
  //noinspection GradleDynamicVersion
83
83
  implementation 'com.facebook.react:react-native:+' // From node_modules
84
- implementation 'com.smallcase.gateway:sdk:3.6.4'
84
+ implementation 'com.smallcase.gateway:sdk:3.6.5'
85
85
  implementation "androidx.core:core-ktx:1.3.1"
86
86
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
87
87
  }
@@ -94,6 +94,50 @@ RCT_REMAP_METHOD(init,
94
94
  }];
95
95
  }
96
96
 
97
+ //MARK: Trigger Transaction
98
+ RCT_REMAP_METHOD(triggerMfTransaction,
99
+ transactionId:(NSString *)transactionId
100
+ triggerTransactionWithResolver:(RCTPromiseResolveBlock)resolve
101
+ rejecter:(RCTPromiseRejectBlock)reject) {
102
+ dispatch_async(dispatch_get_main_queue(), ^(void) {
103
+ [SCGateway.shared
104
+ triggerMfTransactionWithPresentingController:
105
+ [[[UIApplication sharedApplication] keyWindow] rootViewController]
106
+ transactionId: transactionId
107
+ completion: ^(id response, NSError * error) {
108
+ if (error != nil) {
109
+ NSMutableDictionary *responseDict = [[NSMutableDictionary alloc] init];
110
+ [responseDict setValue:[NSNumber numberWithInteger:error.code] forKey:@"errorCode"];
111
+ [responseDict setValue:error.domain forKey:@"errorMessage"];
112
+ [responseDict setValue:[error.userInfo objectForKey: @"data"] forKey:@"data"];
113
+
114
+ NSError *err = [[NSError alloc] initWithDomain:error.domain code:error.code userInfo:responseDict];
115
+
116
+ reject(@"triggerTransaction", @"Error during transaction", err);
117
+ return;
118
+ }
119
+
120
+ //MARK: intent - mf transaction
121
+ if ([response isKindOfClass: [ObjCTransactionIntentMfHoldingsImport class]]) {
122
+ NSMutableDictionary *responseDict = [[NSMutableDictionary alloc] init];
123
+ ObjCTransactionIntentMfHoldingsImport *trxResponse = response;
124
+ [responseDict setObject:@"TRANSACTION" forKey:@"transaction"];
125
+
126
+ NSData *decodedStringData = [[NSData alloc] initWithBase64EncodedString:trxResponse.data options: 0];
127
+ NSString *decodedResponse = [[NSString alloc] initWithData:decodedStringData encoding:1];
128
+
129
+ [responseDict setObject:trxResponse.data forKey:@"data"];
130
+ resolve(responseDict);
131
+ return;
132
+ }
133
+
134
+ // no matching intent type
135
+ NSError *err = [[NSError alloc] initWithDomain:@"com.smallcase.gateway" code:0 userInfo:@{@"Error reason": @"no matching response type"}];
136
+ reject(@"triggerMfTransaction", @"no matching response type", err);
137
+ }];
138
+ });
139
+ }
140
+
97
141
  //MARK: Trigger Transaction
98
142
  RCT_REMAP_METHOD(triggerTransaction,
99
143
  transactionId:(NSString *)transactionId
@@ -47,12 +47,20 @@
47
47
  name = Products;
48
48
  sourceTree = "<group>";
49
49
  };
50
+ 158F56C62901D6B600238D90 /* Frameworks */ = {
51
+ isa = PBXGroup;
52
+ children = (
53
+ );
54
+ name = Frameworks;
55
+ sourceTree = "<group>";
56
+ };
50
57
  58B511D21A9E6C8500147676 = {
51
58
  isa = PBXGroup;
52
59
  children = (
53
60
  134814211AA4EA7D00B7C361 /* Products */,
54
61
  18B09301250F83460012829C /* SmallcaseGateway.h */,
55
62
  18B09300250F83460012829C /* SmallcaseGateway.m */,
63
+ 158F56C62901D6B600238D90 /* Frameworks */,
56
64
  );
57
65
  sourceTree = "<group>";
58
66
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-smallcase-gateway",
3
3
  "title": "React Native Smallcase Gateway",
4
- "version": "1.6.1",
4
+ "version": "1.6.3",
5
5
  "description": "smallcase gateway bindings for react native",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -18,11 +18,11 @@ Pod::Spec.new do |s|
18
18
  s.platforms = { :ios => "11.0" }
19
19
  # s.source = { :git => "https://github.com/mobile/react-native-smallcase-gateway.git", :tag => "#{s.version}" }
20
20
  s.source = { :git => "https://github.com/smallcase/react-native-smallcase-gateway.git", :tag => "#{s.version}" }
21
-
21
+ s.vendored_frameworks = 'SCGateway.xcframework'
22
22
  s.source_files = "ios/**/*.{h,c,m,swift}"
23
23
  s.requires_arc = true
24
24
 
25
25
  s.dependency "React-Core"
26
- s.dependency 'SCGateway', '3.6.1'
26
+ s.dependency 'SCGateway', '3.7.3'
27
27
  end
28
28
 
@@ -267,6 +267,7 @@ const SmallcaseGateway = {
267
267
  triggerLeadGenWithLoginCta,
268
268
  archiveSmallcase,
269
269
  triggerTransaction,
270
+ triggerMfTransaction,
270
271
  setConfigEnvironment,
271
272
  launchSmallplug,
272
273
  launchSmallplugWithBranding,