react-native-smallcase-gateway 2.1.1 → 2.2.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/CHANGELOG.md +34 -0
- package/android/build.gradle +17 -1
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +4 -0
- package/android/gradlew +234 -0
- package/android/gradlew.bat +89 -0
- package/android/src/main/java/com/reactnativesmallcasegateway/SmallcaseGatewayModule.kt +106 -1
- package/ios/SmallcaseGateway.m +202 -39
- package/lib/commonjs/ScLoan.js +75 -0
- package/lib/commonjs/ScLoan.js.map +1 -0
- package/lib/commonjs/SmallcaseGateway.js +19 -18
- package/lib/commonjs/SmallcaseGateway.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/ScLoan.js +68 -0
- package/lib/module/ScLoan.js.map +1 -0
- package/lib/module/SmallcaseGateway.js +23 -22
- package/lib/module/SmallcaseGateway.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/package.json +2 -1
- package/react-native-smallcase-gateway.podspec +2 -2
- package/src/ScLoan.js +72 -0
- package/src/SmallcaseGateway.js +73 -57
- package/src/index.js +2 -0
package/ios/SmallcaseGateway.m
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
#import <SCGateway/SCGateway.h>
|
|
4
4
|
#import <SCGateway/SCGateway-Swift.h>
|
|
5
5
|
|
|
6
|
+
#import <Loans/Loans.h>
|
|
7
|
+
|
|
6
8
|
@interface RCT_EXTERN_MODULE(SmallcaseGateway, NSObject)
|
|
7
9
|
|
|
8
10
|
//MARK: SDK version helpers
|
|
@@ -15,12 +17,12 @@ RCT_REMAP_METHOD(getSdkVersion,
|
|
|
15
17
|
reactNativeSdkVersion: (NSString *)reactNativeSdkVersion
|
|
16
18
|
initWithResolver:(RCTPromiseResolveBlock)resolve
|
|
17
19
|
rejecter:(RCTPromiseRejectBlock)reject) {
|
|
18
|
-
|
|
20
|
+
|
|
19
21
|
NSString *nativeSdkString = [NSString stringWithFormat: @"ios:%@", [SCGateway.shared getSdkVersion]];
|
|
20
22
|
NSString *reactNativeSdkString = [NSString stringWithFormat: @",react-native:%@", reactNativeSdkVersion];
|
|
21
|
-
|
|
23
|
+
|
|
22
24
|
NSString *result = [nativeSdkString stringByAppendingString: reactNativeSdkString];
|
|
23
|
-
|
|
25
|
+
|
|
24
26
|
resolve(result);
|
|
25
27
|
}
|
|
26
28
|
|
|
@@ -63,7 +65,7 @@ RCT_REMAP_METHOD(setConfigEnvironment,
|
|
|
63
65
|
|
|
64
66
|
reject(@"setConfigEnvironment", @"Env setup failed", err);
|
|
65
67
|
}
|
|
66
|
-
|
|
68
|
+
|
|
67
69
|
}];
|
|
68
70
|
}
|
|
69
71
|
|
|
@@ -185,7 +187,7 @@ RCT_REMAP_METHOD(triggerTransaction,
|
|
|
185
187
|
if (trxResponse.response != nil) {
|
|
186
188
|
[responseDict setValue:trxResponse.response forKey:@"data"];
|
|
187
189
|
}
|
|
188
|
-
|
|
190
|
+
|
|
189
191
|
resolve(responseDict);
|
|
190
192
|
return;
|
|
191
193
|
}
|
|
@@ -215,7 +217,7 @@ RCT_REMAP_METHOD(triggerTransaction,
|
|
|
215
217
|
[dict setValue: trxResponse.authToken forKey:@"smallcaseAuthToken"];
|
|
216
218
|
[dict setValue: trxResponse.transactionId forKey:@"transactionId"];
|
|
217
219
|
[dict setValue: trxResponse.signup forKey:@"signup"];
|
|
218
|
-
|
|
220
|
+
|
|
219
221
|
[dict setValue:[NSNumber numberWithDouble:trxResponse.fund] forKey:@"fund"];
|
|
220
222
|
|
|
221
223
|
[responseDict setValue:dict forKey:@"data"];
|
|
@@ -256,7 +258,7 @@ RCT_REMAP_METHOD(triggerTransaction,
|
|
|
256
258
|
[dict setValue: trxResponse.authToken forKey:@"smallcaseAuthToken"];
|
|
257
259
|
[dict setValue: trxResponse.transactionId forKey:@"transactionId"];
|
|
258
260
|
[dict setValue: trxResponse.signup forKey:@"signup"];
|
|
259
|
-
|
|
261
|
+
|
|
260
262
|
[dict setValue: [NSNumber numberWithBool:trxResponse.status] forKey:@"status"];
|
|
261
263
|
|
|
262
264
|
[responseDict setValue:dict forKey:@"data"];
|
|
@@ -276,13 +278,13 @@ RCT_REMAP_METHOD(showOrders,
|
|
|
276
278
|
showOrdersWithResolver: (RCTPromiseResolveBlock)resolve
|
|
277
279
|
rejecter:(RCTPromiseRejectBlock)reject) {
|
|
278
280
|
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
|
279
|
-
|
|
281
|
+
|
|
280
282
|
NSMutableDictionary *responseDict = [[NSMutableDictionary alloc] init];
|
|
281
|
-
|
|
283
|
+
|
|
282
284
|
[SCGateway.shared
|
|
283
285
|
showOrdersWithPresentingController:[[[UIApplication sharedApplication] keyWindow] rootViewController]
|
|
284
286
|
completion:^(BOOL success, NSError * error) {
|
|
285
|
-
|
|
287
|
+
|
|
286
288
|
if(success){
|
|
287
289
|
resolve(@(YES));
|
|
288
290
|
} else {
|
|
@@ -302,13 +304,13 @@ RCT_REMAP_METHOD(launchSmallplug,
|
|
|
302
304
|
launchSmallplugWithResolver:(RCTPromiseResolveBlock)resolve
|
|
303
305
|
rejecter:(RCTPromiseRejectBlock)reject) {
|
|
304
306
|
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
|
305
|
-
|
|
307
|
+
|
|
306
308
|
SmallplugData *smallplugData = [[SmallplugData alloc] init:targetEndpoint :params];
|
|
307
|
-
|
|
309
|
+
|
|
308
310
|
[SCGateway.shared launchSmallPlugWithPresentingController:[[[UIApplication sharedApplication] keyWindow] rootViewController] smallplugData:smallplugData completion:^(id smallplugResponse, NSError * error) {
|
|
309
|
-
|
|
311
|
+
|
|
310
312
|
NSMutableDictionary *responseDict = [[NSMutableDictionary alloc] init];
|
|
311
|
-
|
|
313
|
+
|
|
312
314
|
if (error != nil) {
|
|
313
315
|
NSLog(@"%@", error.domain);
|
|
314
316
|
double delayInSeconds = 0.5;
|
|
@@ -318,29 +320,29 @@ RCT_REMAP_METHOD(launchSmallplug,
|
|
|
318
320
|
[responseDict setValue:[NSNumber numberWithBool:false] forKey:@"success"];
|
|
319
321
|
[responseDict setValue:[NSNumber numberWithInteger:error.code] forKey:@"errorCode"];
|
|
320
322
|
[responseDict setValue:error.domain forKey:@"error"];
|
|
321
|
-
|
|
323
|
+
|
|
322
324
|
resolve(responseDict);
|
|
323
325
|
return;
|
|
324
326
|
});
|
|
325
327
|
} else {
|
|
326
|
-
|
|
328
|
+
|
|
327
329
|
if ([smallplugResponse isKindOfClass: [NSString class]]) {
|
|
328
330
|
NSLog(@"%@", smallplugResponse);
|
|
329
|
-
|
|
331
|
+
|
|
330
332
|
[responseDict setValue:[NSNumber numberWithBool: true] forKey:@"success"];
|
|
331
333
|
[responseDict setValue:smallplugResponse forKey:@"smallcaseAuthToken"];
|
|
332
|
-
|
|
334
|
+
|
|
333
335
|
double delayInSeconds = 0.5;
|
|
334
336
|
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
|
|
335
337
|
dispatch_after(popTime, dispatch_get_main_queue(), ^(void) {
|
|
336
|
-
|
|
338
|
+
|
|
337
339
|
resolve(responseDict);
|
|
338
340
|
return;
|
|
339
|
-
|
|
341
|
+
|
|
340
342
|
});
|
|
341
343
|
}
|
|
342
344
|
}
|
|
343
|
-
|
|
345
|
+
|
|
344
346
|
}];
|
|
345
347
|
});
|
|
346
348
|
}
|
|
@@ -357,14 +359,14 @@ RCT_REMAP_METHOD(launchSmallplugWithBranding,
|
|
|
357
359
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
358
360
|
{
|
|
359
361
|
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
|
360
|
-
|
|
362
|
+
|
|
361
363
|
SmallplugData *smallplugData = [[SmallplugData alloc] init:targetEndpoint :params];
|
|
362
364
|
SmallplugUiConfig *smallplugUiConfig = [[SmallplugUiConfig alloc] initWithSmallplugHeaderColor:headerColor headerColorOpacity:headerOpacity backIconColor:backIconColor backIconColorOpacity:backIconOpacity];
|
|
363
|
-
|
|
365
|
+
|
|
364
366
|
[SCGateway.shared launchSmallPlugWithPresentingController:[[[UIApplication sharedApplication] keyWindow] rootViewController] smallplugData:smallplugData smallplugUiConfig:smallplugUiConfig completion:^(id smallplugResponse, NSError * error) {
|
|
365
|
-
|
|
367
|
+
|
|
366
368
|
NSMutableDictionary *responseDict = [[NSMutableDictionary alloc] init];
|
|
367
|
-
|
|
369
|
+
|
|
368
370
|
if (error != nil) {
|
|
369
371
|
NSLog(@"%@", error.domain);
|
|
370
372
|
double delayInSeconds = 0.5;
|
|
@@ -374,29 +376,29 @@ RCT_REMAP_METHOD(launchSmallplugWithBranding,
|
|
|
374
376
|
[responseDict setValue:[NSNumber numberWithBool:false] forKey:@"success"];
|
|
375
377
|
[responseDict setValue:[NSNumber numberWithInteger:error.code] forKey:@"errorCode"];
|
|
376
378
|
[responseDict setValue:error.domain forKey:@"error"];
|
|
377
|
-
|
|
379
|
+
|
|
378
380
|
resolve(responseDict);
|
|
379
381
|
return;
|
|
380
382
|
});
|
|
381
383
|
} else {
|
|
382
|
-
|
|
384
|
+
|
|
383
385
|
if ([smallplugResponse isKindOfClass: [NSString class]]) {
|
|
384
386
|
NSLog(@"%@", smallplugResponse);
|
|
385
|
-
|
|
387
|
+
|
|
386
388
|
[responseDict setValue:[NSNumber numberWithBool: true] forKey:@"success"];
|
|
387
389
|
[responseDict setValue:smallplugResponse forKey:@"smallcaseAuthToken"];
|
|
388
|
-
|
|
390
|
+
|
|
389
391
|
double delayInSeconds = 0.5;
|
|
390
392
|
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
|
|
391
393
|
dispatch_after(popTime, dispatch_get_main_queue(), ^(void) {
|
|
392
|
-
|
|
394
|
+
|
|
393
395
|
resolve(responseDict);
|
|
394
396
|
return;
|
|
395
|
-
|
|
397
|
+
|
|
396
398
|
});
|
|
397
399
|
}
|
|
398
400
|
}
|
|
399
|
-
|
|
401
|
+
|
|
400
402
|
}];
|
|
401
403
|
});
|
|
402
404
|
}
|
|
@@ -411,18 +413,18 @@ RCT_REMAP_METHOD(archiveSmallcase,
|
|
|
411
413
|
NSMutableDictionary *responseDict = [[NSMutableDictionary alloc] init];
|
|
412
414
|
[responseDict setValue:[NSNumber numberWithInteger:error.code] forKey:@"errorCode"];
|
|
413
415
|
[responseDict setValue:error.domain forKey:@"errorMessage"];
|
|
414
|
-
|
|
416
|
+
|
|
415
417
|
NSError *err = [[NSError alloc] initWithDomain:error.domain code:error.code userInfo:responseDict];
|
|
416
|
-
|
|
418
|
+
|
|
417
419
|
reject(@"archiveSmallcase", @"Error during transaction", err);
|
|
418
420
|
return;
|
|
419
421
|
}
|
|
420
|
-
|
|
422
|
+
|
|
421
423
|
NSString *archiveResponseString = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
|
|
422
|
-
|
|
424
|
+
|
|
423
425
|
NSMutableDictionary *responseDict = [[NSMutableDictionary alloc] init];
|
|
424
426
|
[responseDict setValue:[NSNumber numberWithBool:true] forKey:@"success"];
|
|
425
|
-
|
|
427
|
+
|
|
426
428
|
[responseDict setObject:archiveResponseString forKey:@"data"];
|
|
427
429
|
resolve(responseDict);
|
|
428
430
|
return;
|
|
@@ -435,13 +437,13 @@ RCT_REMAP_METHOD(triggerLeadGenWithStatus,
|
|
|
435
437
|
leadGenGenWithResolver: (RCTPromiseResolveBlock)resolve
|
|
436
438
|
rejecter:(RCTPromiseRejectBlock)reject) {
|
|
437
439
|
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
|
438
|
-
|
|
440
|
+
|
|
439
441
|
[SCGateway.shared triggerLeadGenWithPresentingController:[[[UIApplication sharedApplication] keyWindow] rootViewController] params:userParams
|
|
440
442
|
completion:^(NSString * leadGenResponse) {
|
|
441
443
|
resolve(leadGenResponse);
|
|
442
444
|
}
|
|
443
445
|
];
|
|
444
|
-
|
|
446
|
+
|
|
445
447
|
});
|
|
446
448
|
}
|
|
447
449
|
|
|
@@ -483,4 +485,165 @@ RCT_REMAP_METHOD(logoutUser,
|
|
|
483
485
|
});
|
|
484
486
|
}
|
|
485
487
|
|
|
488
|
+
//MARK: Loans
|
|
489
|
+
|
|
490
|
+
RCT_REMAP_METHOD(setupLoans,
|
|
491
|
+
loanConfig: (NSDictionary *)loanConfig
|
|
492
|
+
setupLoansWithResolver:(RCTPromiseResolveBlock)resolve
|
|
493
|
+
rejecter:(RCTPromiseRejectBlock)reject
|
|
494
|
+
) {
|
|
495
|
+
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
|
496
|
+
|
|
497
|
+
if(loanConfig != nil && loanConfig[@"gatewayName"] != nil) {
|
|
498
|
+
|
|
499
|
+
NSString *gatewayName = loanConfig[@"gatewayName"];
|
|
500
|
+
NSLog(@" ----------- Gateway Name: %@", gatewayName);
|
|
501
|
+
|
|
502
|
+
NSString *envName = [NSString stringWithFormat:@"%@", loanConfig[@"environment"]];
|
|
503
|
+
NSLog(@" ----------- Env Name: %@", envName);
|
|
504
|
+
|
|
505
|
+
NSNumber *lasEnv = @0;
|
|
506
|
+
|
|
507
|
+
if([envName isEqualToString:@"production"]) {
|
|
508
|
+
lasEnv = @0;
|
|
509
|
+
}
|
|
510
|
+
else if([envName isEqualToString:@"development"]) {
|
|
511
|
+
lasEnv = @1;
|
|
512
|
+
} else {
|
|
513
|
+
lasEnv = @2;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
SCLoanConfig *gatewayLoanConfig = [[SCLoanConfig alloc] initWithGatewayName:gatewayName environment:lasEnv];
|
|
517
|
+
|
|
518
|
+
[SCLoans.instance setupWithConfig:gatewayLoanConfig completion:^(SCLoanSuccess * success, SCLoanError * error) {
|
|
519
|
+
|
|
520
|
+
if(error != nil) {
|
|
521
|
+
if(error != nil) {
|
|
522
|
+
NSMutableDictionary *responseDict = [[NSMutableDictionary alloc] init];
|
|
523
|
+
[responseDict setValue:false forKey:@"isSuccess"];
|
|
524
|
+
[responseDict setValue:[NSNumber numberWithInteger:error.code] forKey:@"errorCode"];
|
|
525
|
+
[responseDict setValue:error.domain forKey:@"errorMessage"];
|
|
526
|
+
|
|
527
|
+
NSError *err = [[NSError alloc] initWithDomain:error.domain code:error.code userInfo:responseDict];
|
|
528
|
+
|
|
529
|
+
reject(@"apply", @"Error while applying for Loan", err);
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
resolve(@(YES));
|
|
535
|
+
}];
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
RCT_REMAP_METHOD(apply,
|
|
542
|
+
loanInfo: (NSDictionary *)loanInfo
|
|
543
|
+
applyWithResolver:(RCTPromiseResolveBlock)resolve
|
|
544
|
+
rejecter:(RCTPromiseRejectBlock)reject
|
|
545
|
+
) {
|
|
546
|
+
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
|
547
|
+
|
|
548
|
+
if(loanInfo != nil && loanInfo[@"interactionToken"] != nil) {
|
|
549
|
+
|
|
550
|
+
NSString *interactionToken = loanInfo[@"interactionToken"];
|
|
551
|
+
NSLog(@" ----------- Interaction Token: %@", interactionToken);
|
|
552
|
+
|
|
553
|
+
SCLoanInfo *gatewayLoanInfo = [[SCLoanInfo alloc] initWithInteractionToken:interactionToken];
|
|
554
|
+
|
|
555
|
+
[SCLoans.instance applyWithPresentingController:[[[UIApplication sharedApplication] keyWindow] rootViewController] loanInfo:gatewayLoanInfo completion:^(SCLoanSuccess * success, SCLoanError * error) {
|
|
556
|
+
|
|
557
|
+
if(error != nil) {
|
|
558
|
+
NSMutableDictionary *responseDict = [[NSMutableDictionary alloc] init];
|
|
559
|
+
[responseDict setValue:false forKey:@"isSuccess"];
|
|
560
|
+
[responseDict setValue:[NSNumber numberWithInteger:error.code] forKey:@"errorCode"];
|
|
561
|
+
[responseDict setValue:error.domain forKey:@"errorMessage"];
|
|
562
|
+
[responseDict setValue:error.userInfo forKey:@"data"];
|
|
563
|
+
|
|
564
|
+
NSError *err = [[NSError alloc] initWithDomain:error.domain code:error.code userInfo:responseDict];
|
|
565
|
+
|
|
566
|
+
reject(@"apply", @"Error while applying for Loan", err);
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
resolve(success.data);
|
|
571
|
+
}];
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
RCT_REMAP_METHOD(pay,
|
|
578
|
+
loanInfo: (NSDictionary *)loanInfo
|
|
579
|
+
payWithResolver:(RCTPromiseResolveBlock)resolve
|
|
580
|
+
rejecter:(RCTPromiseRejectBlock)reject
|
|
581
|
+
) {
|
|
582
|
+
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
|
583
|
+
|
|
584
|
+
if(loanInfo != nil && loanInfo[@"interactionToken"] != nil) {
|
|
585
|
+
|
|
586
|
+
NSString *interactionToken = loanInfo[@"interactionToken"];
|
|
587
|
+
NSLog(@" ----------- Interaction Token: %@", interactionToken);
|
|
588
|
+
|
|
589
|
+
SCLoanInfo *gatewayLoanInfo = [[SCLoanInfo alloc] initWithInteractionToken:interactionToken];
|
|
590
|
+
|
|
591
|
+
[SCLoans.instance payWithPresentingController:[[[UIApplication sharedApplication] keyWindow] rootViewController] loanInfo:gatewayLoanInfo completion:^(SCLoanSuccess * success, SCLoanError * error) {
|
|
592
|
+
|
|
593
|
+
if(error != nil) {
|
|
594
|
+
NSMutableDictionary *responseDict = [[NSMutableDictionary alloc] init];
|
|
595
|
+
[responseDict setValue:false forKey:@"isSuccess"];
|
|
596
|
+
[responseDict setValue:[NSNumber numberWithInteger:error.code] forKey:@"errorCode"];
|
|
597
|
+
[responseDict setValue:error.domain forKey:@"errorMessage"];
|
|
598
|
+
[responseDict setValue:error.userInfo forKey:@"data"];
|
|
599
|
+
|
|
600
|
+
NSError *err = [[NSError alloc] initWithDomain:error.domain code:error.code userInfo:responseDict];
|
|
601
|
+
|
|
602
|
+
reject(@"apply", @"Error while applying for Loan", err);
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
resolve(success.data);
|
|
607
|
+
}];
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
RCT_REMAP_METHOD(withdraw,
|
|
614
|
+
loanInfo: (NSDictionary *)loanInfo
|
|
615
|
+
withdrawWithResolver:(RCTPromiseResolveBlock)resolve
|
|
616
|
+
rejecter:(RCTPromiseRejectBlock)reject
|
|
617
|
+
) {
|
|
618
|
+
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
|
619
|
+
|
|
620
|
+
if(loanInfo != nil && loanInfo[@"interactionToken"] != nil) {
|
|
621
|
+
|
|
622
|
+
NSString *interactionToken = loanInfo[@"interactionToken"];
|
|
623
|
+
NSLog(@" ----------- Interaction Token: %@", interactionToken);
|
|
624
|
+
|
|
625
|
+
SCLoanInfo *gatewayLoanInfo = [[SCLoanInfo alloc] initWithInteractionToken:interactionToken];
|
|
626
|
+
|
|
627
|
+
[SCLoans.instance withdrawWithPresentingController:[[[UIApplication sharedApplication] keyWindow] rootViewController] loanInfo:gatewayLoanInfo completion:^(SCLoanSuccess * success, SCLoanError * error) {
|
|
628
|
+
|
|
629
|
+
if(error != nil) {
|
|
630
|
+
NSMutableDictionary *responseDict = [[NSMutableDictionary alloc] init];
|
|
631
|
+
[responseDict setValue:false forKey:@"isSuccess"];
|
|
632
|
+
[responseDict setValue:[NSNumber numberWithInteger:error.code] forKey:@"errorCode"];
|
|
633
|
+
[responseDict setValue:error.domain forKey:@"errorMessage"];
|
|
634
|
+
[responseDict setValue:error.userInfo forKey:@"data"];
|
|
635
|
+
|
|
636
|
+
NSError *err = [[NSError alloc] initWithDomain:error.domain code:error.code userInfo:responseDict];
|
|
637
|
+
|
|
638
|
+
reject(@"apply", @"Error while applying for Loan", err);
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
resolve(success.data);
|
|
643
|
+
}];
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
|
|
486
649
|
@end
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _util = require("./util");
|
|
9
|
+
var _constants = require("./constants");
|
|
10
|
+
const {
|
|
11
|
+
SmallcaseGateway: SmallcaseGatewayNative
|
|
12
|
+
} = _reactNative.NativeModules;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {Object} ScLoanConfig
|
|
16
|
+
* @property {String} gatewayName
|
|
17
|
+
* @property {'production' | 'staging' | 'development'} environment - environment
|
|
18
|
+
*
|
|
19
|
+
* @typedef {Object} LoanInfo
|
|
20
|
+
* @property {String} interactionToken
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Setup ScLoans
|
|
25
|
+
*
|
|
26
|
+
* @param {ScLoanConfig} config
|
|
27
|
+
* @returns {Promise<String>}
|
|
28
|
+
*/
|
|
29
|
+
const setup = async config => {
|
|
30
|
+
const safeConfig = (0, _util.safeObject)(config);
|
|
31
|
+
if (safeConfig.environment === undefined || safeConfig.environment === null) safeConfig.environment = _constants.ENV.PROD;
|
|
32
|
+
return SmallcaseGatewayNative.setupLoans(safeConfig);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Triggers the LOS Journey
|
|
37
|
+
*
|
|
38
|
+
* @param {LoanInfo} loanInfo
|
|
39
|
+
* @returns {Promise<String>}
|
|
40
|
+
*/
|
|
41
|
+
const apply = async loanInfo => {
|
|
42
|
+
const safeLoanInfo = (0, _util.safeObject)(loanInfo);
|
|
43
|
+
return SmallcaseGatewayNative.apply(safeLoanInfo);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Triggers the Repayment Journey
|
|
48
|
+
*
|
|
49
|
+
* @param {LoanInfo} loanInfo
|
|
50
|
+
* @returns {Promise<String>}
|
|
51
|
+
*/
|
|
52
|
+
const pay = async loanInfo => {
|
|
53
|
+
const safeLoanInfo = (0, _util.safeObject)(loanInfo);
|
|
54
|
+
return SmallcaseGatewayNative.pay(safeLoanInfo);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Triggers the Withdraw Journey
|
|
59
|
+
*
|
|
60
|
+
* @param {LoanInfo} loanInfo
|
|
61
|
+
* @returns {Promise<String>}
|
|
62
|
+
*/
|
|
63
|
+
const withdraw = async loanInfo => {
|
|
64
|
+
const safeLoanInfo = (0, _util.safeObject)(loanInfo);
|
|
65
|
+
return SmallcaseGatewayNative.withdraw(safeLoanInfo);
|
|
66
|
+
};
|
|
67
|
+
const ScLoan = {
|
|
68
|
+
setup,
|
|
69
|
+
apply,
|
|
70
|
+
pay,
|
|
71
|
+
withdraw
|
|
72
|
+
};
|
|
73
|
+
var _default = ScLoan;
|
|
74
|
+
exports.default = _default;
|
|
75
|
+
//# sourceMappingURL=ScLoan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_util","_constants","SmallcaseGateway","SmallcaseGatewayNative","NativeModules","setup","config","safeConfig","safeObject","environment","undefined","ENV","PROD","setupLoans","apply","loanInfo","safeLoanInfo","pay","withdraw","ScLoan","_default","exports","default"],"sources":["ScLoan.js"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport { safeObject } from './util';\nimport { ENV } from './constants';\n\nconst { SmallcaseGateway: SmallcaseGatewayNative } = NativeModules;\n\n/**\n * @typedef {Object} ScLoanConfig\n * @property {String} gatewayName\n * @property {'production' | 'staging' | 'development'} environment - environment\n *\n * @typedef {Object} LoanInfo\n * @property {String} interactionToken\n */\n\n/**\n * Setup ScLoans\n *\n * @param {ScLoanConfig} config\n * @returns {Promise<String>}\n */\nconst setup = async (config) => {\n const safeConfig = safeObject(config);\n if(safeConfig.environment === undefined || safeConfig.environment === null) safeConfig.environment = ENV.PROD\n\n return SmallcaseGatewayNative.setupLoans(safeConfig);\n };\n\n/**\n * Triggers the LOS Journey\n *\n * @param {LoanInfo} loanInfo\n * @returns {Promise<String>}\n */\nconst apply = async (loanInfo) => {\n const safeLoanInfo = safeObject(loanInfo);\n\n return SmallcaseGatewayNative.apply(safeLoanInfo);\n };\n\n/**\n * Triggers the Repayment Journey\n *\n * @param {LoanInfo} loanInfo\n * @returns {Promise<String>}\n */\nconst pay = async (loanInfo) => {\n const safeLoanInfo = safeObject(loanInfo);\n\n return SmallcaseGatewayNative.pay(safeLoanInfo);\n };\n\n/**\n * Triggers the Withdraw Journey\n *\n * @param {LoanInfo} loanInfo\n * @returns {Promise<String>}\n */\nconst withdraw = async (loanInfo) => {\n const safeLoanInfo = safeObject(loanInfo);\n\n return SmallcaseGatewayNative.withdraw(safeLoanInfo);\n };\n\nconst ScLoan = {\n setup,\n apply,\n pay,\n withdraw\n}\n\nexport default ScLoan;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA,MAAM;EAAEG,gBAAgB,EAAEC;AAAuB,CAAC,GAAGC,0BAAa;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,KAAK,GAAG,MAAOC,MAAM,IAAK;EAC5B,MAAMC,UAAU,GAAG,IAAAC,gBAAU,EAACF,MAAM,CAAC;EACrC,IAAGC,UAAU,CAACE,WAAW,KAAKC,SAAS,IAAIH,UAAU,CAACE,WAAW,KAAK,IAAI,EAAEF,UAAU,CAACE,WAAW,GAAGE,cAAG,CAACC,IAAI;EAE7G,OAAOT,sBAAsB,CAACU,UAAU,CAACN,UAAU,CAAC;AACtD,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,MAAMO,KAAK,GAAG,MAAOC,QAAQ,IAAK;EAC9B,MAAMC,YAAY,GAAG,IAAAR,gBAAU,EAACO,QAAQ,CAAC;EAEzC,OAAOZ,sBAAsB,CAACW,KAAK,CAACE,YAAY,CAAC;AACnD,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,GAAG,GAAG,MAAOF,QAAQ,IAAK;EAC5B,MAAMC,YAAY,GAAG,IAAAR,gBAAU,EAACO,QAAQ,CAAC;EAEzC,OAAOZ,sBAAsB,CAACc,GAAG,CAACD,YAAY,CAAC;AACjD,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,QAAQ,GAAG,MAAOH,QAAQ,IAAK;EACjC,MAAMC,YAAY,GAAG,IAAAR,gBAAU,EAACO,QAAQ,CAAC;EAEzC,OAAOZ,sBAAsB,CAACe,QAAQ,CAACF,YAAY,CAAC;AACtD,CAAC;AAEH,MAAMG,MAAM,GAAG;EACXd,KAAK;EACLS,KAAK;EACLG,GAAG;EACHC;AACJ,CAAC;AAAA,IAAAE,QAAA,GAEcD,MAAM;AAAAE,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -32,12 +32,13 @@ const {
|
|
|
32
32
|
* @property {String} email - email of user
|
|
33
33
|
* @property {String} contact - contact of user
|
|
34
34
|
* @property {String} pinCode - pin-code of user
|
|
35
|
-
*
|
|
35
|
+
*
|
|
36
36
|
* @typedef {Object} SmallplugUiConfig
|
|
37
37
|
* @property {String} headerColor - color of the header background
|
|
38
38
|
* @property {Number} headerOpacity - opacity of the header background
|
|
39
39
|
* @property {String} backIconColor - color of the back icon
|
|
40
40
|
* @property {Number} backIconOpacity - opacity of the back icon
|
|
41
|
+
*
|
|
41
42
|
*/
|
|
42
43
|
|
|
43
44
|
let defaultBrokerList = [];
|
|
@@ -59,8 +60,8 @@ const setConfigEnvironment = async envConfig => {
|
|
|
59
60
|
const safeIsLeprechaun = Boolean(isLeprechaun);
|
|
60
61
|
const safeIsAmoEnabled = Boolean(isAmoEnabled);
|
|
61
62
|
const safeBrokerList = Array.isArray(brokerList) ? brokerList : [];
|
|
62
|
-
const safeGatewayName = typeof gatewayName ===
|
|
63
|
-
const safeEnvName = typeof environmentName ===
|
|
63
|
+
const safeGatewayName = typeof gatewayName === 'string' ? gatewayName : '';
|
|
64
|
+
const safeEnvName = typeof environmentName === 'string' ? environmentName : _constants.ENV.PROD;
|
|
64
65
|
defaultBrokerList = safeBrokerList;
|
|
65
66
|
await SmallcaseGatewayNative.setConfigEnvironment(safeEnvName, safeGatewayName, safeIsLeprechaun, safeIsAmoEnabled, safeBrokerList);
|
|
66
67
|
};
|
|
@@ -86,7 +87,7 @@ const init = async sdkToken => {
|
|
|
86
87
|
*/
|
|
87
88
|
const triggerTransaction = async (transactionId, utmParams, brokerList) => {
|
|
88
89
|
const safeUtm = (0, _util.safeObject)(utmParams);
|
|
89
|
-
const safeId = typeof transactionId ===
|
|
90
|
+
const safeId = typeof transactionId === 'string' ? transactionId : '';
|
|
90
91
|
const safeBrokerList = Array.isArray(brokerList) && brokerList.length ? brokerList : defaultBrokerList;
|
|
91
92
|
return SmallcaseGatewayNative.triggerTransaction(safeId, safeUtm, safeBrokerList);
|
|
92
93
|
};
|
|
@@ -98,25 +99,25 @@ const triggerTransaction = async (transactionId, utmParams, brokerList) => {
|
|
|
98
99
|
* @returns {Promise<transactionRes>}
|
|
99
100
|
*/
|
|
100
101
|
const triggerMfTransaction = async transactionId => {
|
|
101
|
-
const safeTransactionId = typeof transactionId ===
|
|
102
|
+
const safeTransactionId = typeof transactionId === 'string' ? transactionId : '';
|
|
102
103
|
return SmallcaseGatewayNative.triggerMfTransaction(safeTransactionId);
|
|
103
104
|
};
|
|
104
105
|
|
|
105
106
|
/**
|
|
106
107
|
* launches smallcases module
|
|
107
|
-
*
|
|
108
|
+
*
|
|
108
109
|
* @param {string} targetEndpoint
|
|
109
110
|
* @param {string} params
|
|
110
111
|
*/
|
|
111
112
|
const launchSmallplug = async (targetEndpoint, params) => {
|
|
112
|
-
const safeEndpoint = typeof targetEndpoint ===
|
|
113
|
-
const safeParams = typeof params ===
|
|
113
|
+
const safeEndpoint = typeof targetEndpoint === 'string' ? targetEndpoint : '';
|
|
114
|
+
const safeParams = typeof params === 'string' ? params : '';
|
|
114
115
|
return SmallcaseGatewayNative.launchSmallplug(safeEndpoint, safeParams);
|
|
115
116
|
};
|
|
116
|
-
const safeGatewayName = typeof gatewayName ===
|
|
117
|
+
const safeGatewayName = typeof gatewayName === 'string' ? gatewayName : '';
|
|
117
118
|
/**
|
|
118
119
|
* launches smallcases module
|
|
119
|
-
*
|
|
120
|
+
*
|
|
120
121
|
* @param {string} targetEndpoint
|
|
121
122
|
* @param {string} params
|
|
122
123
|
* @param {string} headerColor
|
|
@@ -125,12 +126,12 @@ const safeGatewayName = typeof gatewayName === "string" ? gatewayName : "";
|
|
|
125
126
|
* @param {number} backIconOpacity
|
|
126
127
|
*/
|
|
127
128
|
const launchSmallplugWithBranding = async (targetEndpoint, params, headerColor, headerOpacity, backIconColor, backIconOpacity) => {
|
|
128
|
-
const safeEndpoint = typeof targetEndpoint ===
|
|
129
|
-
const safeParams = typeof params ===
|
|
130
|
-
const safeHeaderColor = typeof headerColor ===
|
|
131
|
-
const safeHeaderOpacity = typeof headerOpacity ===
|
|
132
|
-
const safeBackIconColor = typeof backIconColor ===
|
|
133
|
-
const safeBackIconOpacity = typeof backIconOpacity ===
|
|
129
|
+
const safeEndpoint = typeof targetEndpoint === 'string' ? targetEndpoint : '';
|
|
130
|
+
const safeParams = typeof params === 'string' ? params : '';
|
|
131
|
+
const safeHeaderColor = typeof headerColor === 'string' ? headerColor : (0, _util.platformSpecificColorHex)('2F363F');
|
|
132
|
+
const safeHeaderOpacity = typeof headerOpacity === 'number' ? headerOpacity : 1;
|
|
133
|
+
const safeBackIconColor = typeof backIconColor === 'string' ? backIconColor : (0, _util.platformSpecificColorHex)('FFFFFF');
|
|
134
|
+
const safeBackIconOpacity = typeof backIconOpacity === 'number' ? backIconOpacity : 1;
|
|
134
135
|
return _reactNative.Platform.OS === 'android' ? SmallcaseGatewayNative.launchSmallplugWithBranding(safeEndpoint, safeParams, {
|
|
135
136
|
headerColor: safeHeaderColor,
|
|
136
137
|
headerOpacity: safeHeaderOpacity,
|
|
@@ -153,7 +154,7 @@ const logoutUser = async () => {
|
|
|
153
154
|
/**
|
|
154
155
|
* This will display a list of all the orders that a user recently placed.
|
|
155
156
|
* This includes pending, successful, and failed orders.
|
|
156
|
-
* @returns
|
|
157
|
+
* @returns
|
|
157
158
|
*/
|
|
158
159
|
const showOrders = async () => {
|
|
159
160
|
return SmallcaseGatewayNative.showOrders();
|
|
@@ -203,7 +204,7 @@ const triggerLeadGenWithLoginCta = async (userDetails, utmParams, showLoginCta)
|
|
|
203
204
|
* @param {String} iscid
|
|
204
205
|
*/
|
|
205
206
|
const archiveSmallcase = async iscid => {
|
|
206
|
-
const safeIscid = typeof iscid ===
|
|
207
|
+
const safeIscid = typeof iscid === 'string' ? iscid : '';
|
|
207
208
|
return SmallcaseGatewayNative.archiveSmallcase(safeIscid);
|
|
208
209
|
};
|
|
209
210
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_constants","_util","_package","SmallcaseGateway","SmallcaseGatewayNative","NativeModules","defaultBrokerList","setConfigEnvironment","envConfig","safeConfig","safeObject","setHybridSdkVersion","version","brokerList","gatewayName","isLeprechaun","isAmoEnabled","environmentName","safeIsLeprechaun","Boolean","safeIsAmoEnabled","safeBrokerList","Array","isArray","safeGatewayName","safeEnvName","ENV","PROD","init","sdkToken","safeToken","triggerTransaction","transactionId","utmParams","safeUtm","safeId","length","triggerMfTransaction","safeTransactionId","launchSmallplug","targetEndpoint","params","safeEndpoint","safeParams","launchSmallplugWithBranding","headerColor","headerOpacity","backIconColor","backIconOpacity","safeHeaderColor","platformSpecificColorHex","safeHeaderOpacity","safeBackIconColor","safeBackIconOpacity","Platform","OS","logoutUser","showOrders","triggerLeadGen","userDetails","triggerLeadGenWithStatus","triggerLeadGenWithLoginCta","showLoginCta","safeShowLoginCta","archiveSmallcase","iscid","safeIscid","getSdkVersion","_default","exports","default"],"sources":["SmallcaseGateway.js"],"sourcesContent":["import { NativeModules, Platform } from \"react-native\";\nimport { ENV } from \"./constants\";\nimport { safeObject, platformSpecificColorHex } from \"./util\";\nimport { version } from \"../package.json\";\nconst { SmallcaseGateway: SmallcaseGatewayNative } = NativeModules;\n\n/**\n *\n * @typedef {Object} envConfig\n * @property {string} gatewayName - unique name on consumer\n * @property {boolean} isLeprechaun - leprechaun mode toggle\n * @property {boolean} isAmoEnabled - support AMO (subject to broker support)\n * @property {Array<string>} brokerList - list of broker names\n * @property {'production' | 'staging' | 'development'} environmentName - environment name\n *\n * @typedef {Object} transactionRes\n * @property {string} data - response data\n * @property {boolean} success - success flag\n * @property {Number} [errorCode] - error code\n * @property {string} transaction - transaction name\n *\n * @typedef {Object} userDetails\n * @property {String} name - name of user\n * @property {String} email - email of user\n * @property {String} contact - contact of user\n * @property {String} pinCode - pin-code of user\n * \n * @typedef {Object} SmallplugUiConfig\n * @property {String} headerColor - color of the header background\n * @property {Number} headerOpacity - opacity of the header background\n * @property {String} backIconColor - color of the back icon\n * @property {Number} backIconOpacity - opacity of the back icon\n */\n\nlet defaultBrokerList = [];\n\n/**\n * configure the sdk with\n * @param {envConfig} envConfig\n */\nconst setConfigEnvironment = async (envConfig) => {\n const safeConfig = safeObject(envConfig);\n\n await SmallcaseGatewayNative.setHybridSdkVersion(version);\n\n const {\n brokerList,\n gatewayName,\n isLeprechaun,\n isAmoEnabled,\n environmentName,\n } = safeConfig;\n\n const safeIsLeprechaun = Boolean(isLeprechaun);\n const safeIsAmoEnabled = Boolean(isAmoEnabled);\n const safeBrokerList = Array.isArray(brokerList) ? brokerList : [];\n const safeGatewayName = typeof gatewayName === \"string\" ? gatewayName : \"\";\n const safeEnvName =\n typeof environmentName === \"string\" ? environmentName : ENV.PROD;\n\n defaultBrokerList = safeBrokerList;\n\n await SmallcaseGatewayNative.setConfigEnvironment(\n safeEnvName,\n safeGatewayName,\n safeIsLeprechaun,\n safeIsAmoEnabled,\n safeBrokerList\n );\n};\n\n/**\n * initialize sdk with a session\n *\n * note: this must be called after `setConfigEnvironment()`\n * @param {string} sdkToken\n */\nconst init = async (sdkToken) => {\n const safeToken = typeof sdkToken === \"string\" ? sdkToken : \"\";\n return SmallcaseGatewayNative.init(safeToken);\n};\n\n/**\n * triggers a transaction with a transaction id\n *\n * @param {string} transactionId\n * @param {Object} [utmParams]\n * @param {Array<string>} [brokerList]\n * @returns {Promise<transactionRes>}\n */\nconst triggerTransaction = async (transactionId, utmParams, brokerList) => {\n const safeUtm = safeObject(utmParams);\n const safeId = typeof transactionId === \"string\" ? transactionId : \"\";\n\n const safeBrokerList =\n Array.isArray(brokerList) && brokerList.length\n ? brokerList\n : defaultBrokerList;\n\n return SmallcaseGatewayNative.triggerTransaction(\n safeId,\n safeUtm,\n safeBrokerList\n );\n};\n\n/**\n * triggers a transaction with a transaction id\n *\n * @param {string} transactionId\n * @returns {Promise<transactionRes>}\n */\nconst triggerMfTransaction = async (transactionId) => {\n const safeTransactionId = typeof transactionId === \"string\" ? transactionId : \"\";\n\n return SmallcaseGatewayNative.triggerMfTransaction(\n safeTransactionId\n );\n}\n\n/**\n * launches smallcases module\n * \n * @param {string} targetEndpoint\n * @param {string} params\n */\n const launchSmallplug = async (targetEndpoint, params) => {\n const safeEndpoint = typeof targetEndpoint === \"string\" ? targetEndpoint : \"\"\n const safeParams = typeof params === \"string\" ? params : \"\"\n\n return SmallcaseGatewayNative.launchSmallplug(\n safeEndpoint,\n safeParams\n );\n\n}\n\nconst safeGatewayName = typeof gatewayName === \"string\" ? gatewayName : \"\";\n/**\n * launches smallcases module\n * \n * @param {string} targetEndpoint\n * @param {string} params\n * @param {string} headerColor\n * @param {number} headerOpacity\n * @param {string} backIconColor\n * @param {number} backIconOpacity\n */\nconst launchSmallplugWithBranding = async (targetEndpoint, params, headerColor, headerOpacity, backIconColor, backIconOpacity) => {\n const safeEndpoint = typeof targetEndpoint === \"string\" ? targetEndpoint : \"\"\n const safeParams = typeof params === \"string\" ? params : \"\"\n const safeHeaderColor = typeof headerColor === \"string\" ? headerColor : platformSpecificColorHex(\"2F363F\") \n const safeHeaderOpacity = typeof headerOpacity === \"number\" ? headerOpacity : 1\n const safeBackIconColor = typeof backIconColor === \"string\" ? backIconColor : platformSpecificColorHex(\"FFFFFF\")\n const safeBackIconOpacity = typeof backIconOpacity === \"number\" ? backIconOpacity : 1\n\n return Platform.OS === 'android' ?\n SmallcaseGatewayNative.launchSmallplugWithBranding(\n safeEndpoint, safeParams,\n {\n headerColor: safeHeaderColor,\n headerOpacity: safeHeaderOpacity,\n backIconColor: safeBackIconColor,\n backIconOpacity: safeBackIconOpacity\n })\n : SmallcaseGatewayNative.launchSmallplugWithBranding(\n safeEndpoint,\n safeParams,\n safeHeaderColor,\n safeHeaderOpacity,\n safeBackIconColor,\n safeBackIconOpacity\n );\n\n}\n\n/**\n * Logs the user out and removes the web session.\n *\n * This promise will be rejected if logout was unsuccessful\n *\n * @returns {Promise}\n */\nconst logoutUser = async () => {\n return SmallcaseGatewayNative.logoutUser();\n};\n\n/**\n * This will display a list of all the orders that a user recently placed.\n * This includes pending, successful, and failed orders.\n * @returns \n */\nconst showOrders = async () => {\n return SmallcaseGatewayNative.showOrders();\n};\n\n/**\n * triggers the lead gen flow\n *\n * @param {userDetails} [userDetails]\n * @param {Object} [utmParams]\n */\nconst triggerLeadGen = (userDetails, utmParams) => {\n const safeParams = safeObject(userDetails);\n const safeUtm = safeObject(utmParams);\n\n return SmallcaseGatewayNative.triggerLeadGen(safeParams, safeUtm);\n};\n\n/**\n * triggers the lead gen flow\n *\n * @param {userDetails} [userDetails]\n * * @returns {Promise}\n */\nconst triggerLeadGenWithStatus = async (userDetails) => {\n const safeParams = safeObject(userDetails);\n\n return SmallcaseGatewayNative.triggerLeadGenWithStatus(safeParams);\n}\n\n/**\n * triggers the lead gen flow with an option of \"login here\" cta\n *\n * @param {userDetails} [userDetails]\n * @param {Object} [utmParams]\n * @param {boolean} [showLoginCta]\n * @returns {Promise}\n */\nconst triggerLeadGenWithLoginCta = async (userDetails, utmParams, showLoginCta) => {\n const safeParams = safeObject(userDetails);\n const safeUtm = safeObject(utmParams);\n const safeShowLoginCta = Boolean(showLoginCta);\n\n return SmallcaseGatewayNative.triggerLeadGenWithLoginCta(\n safeParams,\n safeUtm,\n safeShowLoginCta\n );\n}\n\n/**\n * Marks a smallcase as archived\n *\n * @param {String} iscid\n */\nconst archiveSmallcase = async (iscid) => {\n const safeIscid = typeof iscid === \"string\" ? iscid : \"\";\n\n return SmallcaseGatewayNative.archiveSmallcase(safeIscid);\n};\n\n/**\n * Returns the native android/ios and react-native sdk version\n * (internal-tracking)\n * @returns {Promise}\n */\nconst getSdkVersion = async () => {\n return SmallcaseGatewayNative.getSdkVersion(version);\n}\n\nconst SmallcaseGateway = {\n init,\n logoutUser,\n triggerLeadGen,\n triggerLeadGenWithStatus,\n triggerLeadGenWithLoginCta,\n archiveSmallcase,\n triggerTransaction,\n triggerMfTransaction,\n setConfigEnvironment,\n launchSmallplug,\n launchSmallplugWithBranding,\n getSdkVersion,\n showOrders\n};\n\nexport default SmallcaseGateway;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,MAAM;EAAEI,gBAAgB,EAAEC;AAAuB,CAAC,GAAGC,0BAAa;;AAElE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AAU;EACVE,cAAc;EACdE,wBAAwB;EACxBC,0BAA0B;EAC1BG,gBAAgB;EAChBjC,kBAAkB;EAClBM,oBAAoB;EACpB9B,oBAAoB;EACpBgC,eAAe;EACfK,2BAA2B;EAC3BuB,aAAa;EACbV;AACF,CAAC;AAAC,IAAAW,QAAA,GAEajE,gBAAgB;AAAAkE,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_constants","_util","_package","SmallcaseGateway","SmallcaseGatewayNative","NativeModules","defaultBrokerList","setConfigEnvironment","envConfig","safeConfig","safeObject","setHybridSdkVersion","version","brokerList","gatewayName","isLeprechaun","isAmoEnabled","environmentName","safeIsLeprechaun","Boolean","safeIsAmoEnabled","safeBrokerList","Array","isArray","safeGatewayName","safeEnvName","ENV","PROD","init","sdkToken","safeToken","triggerTransaction","transactionId","utmParams","safeUtm","safeId","length","triggerMfTransaction","safeTransactionId","launchSmallplug","targetEndpoint","params","safeEndpoint","safeParams","launchSmallplugWithBranding","headerColor","headerOpacity","backIconColor","backIconOpacity","safeHeaderColor","platformSpecificColorHex","safeHeaderOpacity","safeBackIconColor","safeBackIconOpacity","Platform","OS","logoutUser","showOrders","triggerLeadGen","userDetails","triggerLeadGenWithStatus","triggerLeadGenWithLoginCta","showLoginCta","safeShowLoginCta","archiveSmallcase","iscid","safeIscid","getSdkVersion","_default","exports","default"],"sources":["SmallcaseGateway.js"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nimport { ENV } from './constants';\nimport { safeObject, platformSpecificColorHex } from './util';\nimport { version } from '../package.json';\nconst { SmallcaseGateway: SmallcaseGatewayNative } = NativeModules;\n\n/**\n *\n * @typedef {Object} envConfig\n * @property {string} gatewayName - unique name on consumer\n * @property {boolean} isLeprechaun - leprechaun mode toggle\n * @property {boolean} isAmoEnabled - support AMO (subject to broker support)\n * @property {Array<string>} brokerList - list of broker names\n * @property {'production' | 'staging' | 'development'} environmentName - environment name\n *\n * @typedef {Object} transactionRes\n * @property {string} data - response data\n * @property {boolean} success - success flag\n * @property {Number} [errorCode] - error code\n * @property {string} transaction - transaction name\n *\n * @typedef {Object} userDetails\n * @property {String} name - name of user\n * @property {String} email - email of user\n * @property {String} contact - contact of user\n * @property {String} pinCode - pin-code of user\n *\n * @typedef {Object} SmallplugUiConfig\n * @property {String} headerColor - color of the header background\n * @property {Number} headerOpacity - opacity of the header background\n * @property {String} backIconColor - color of the back icon\n * @property {Number} backIconOpacity - opacity of the back icon\n *\n */\n\nlet defaultBrokerList = [];\n\n/**\n * configure the sdk with\n * @param {envConfig} envConfig\n */\nconst setConfigEnvironment = async (envConfig) => {\n const safeConfig = safeObject(envConfig);\n\n await SmallcaseGatewayNative.setHybridSdkVersion(version);\n\n const {\n brokerList,\n gatewayName,\n isLeprechaun,\n isAmoEnabled,\n environmentName,\n } = safeConfig;\n\n const safeIsLeprechaun = Boolean(isLeprechaun);\n const safeIsAmoEnabled = Boolean(isAmoEnabled);\n const safeBrokerList = Array.isArray(brokerList) ? brokerList : [];\n const safeGatewayName = typeof gatewayName === 'string' ? gatewayName : '';\n const safeEnvName =\n typeof environmentName === 'string' ? environmentName : ENV.PROD;\n\n defaultBrokerList = safeBrokerList;\n\n await SmallcaseGatewayNative.setConfigEnvironment(\n safeEnvName,\n safeGatewayName,\n safeIsLeprechaun,\n safeIsAmoEnabled,\n safeBrokerList\n );\n};\n\n/**\n * initialize sdk with a session\n *\n * note: this must be called after `setConfigEnvironment()`\n * @param {string} sdkToken\n */\nconst init = async (sdkToken) => {\n const safeToken = typeof sdkToken === \"string\" ? sdkToken : \"\";\n return SmallcaseGatewayNative.init(safeToken);\n};\n\n/**\n * triggers a transaction with a transaction id\n *\n * @param {string} transactionId\n * @param {Object} [utmParams]\n * @param {Array<string>} [brokerList]\n * @returns {Promise<transactionRes>}\n */\nconst triggerTransaction = async (transactionId, utmParams, brokerList) => {\n const safeUtm = safeObject(utmParams);\n const safeId = typeof transactionId === 'string' ? transactionId : '';\n\n const safeBrokerList =\n Array.isArray(brokerList) && brokerList.length\n ? brokerList\n : defaultBrokerList;\n\n return SmallcaseGatewayNative.triggerTransaction(\n safeId,\n safeUtm,\n safeBrokerList\n );\n};\n\n/**\n * triggers a transaction with a transaction id\n *\n * @param {string} transactionId\n * @returns {Promise<transactionRes>}\n */\nconst triggerMfTransaction = async (transactionId) => {\n const safeTransactionId =\n typeof transactionId === 'string' ? transactionId : '';\n\n return SmallcaseGatewayNative.triggerMfTransaction(safeTransactionId);\n};\n\n/**\n * launches smallcases module\n *\n * @param {string} targetEndpoint\n * @param {string} params\n */\nconst launchSmallplug = async (targetEndpoint, params) => {\n const safeEndpoint = typeof targetEndpoint === 'string' ? targetEndpoint : '';\n const safeParams = typeof params === 'string' ? params : '';\n\n return SmallcaseGatewayNative.launchSmallplug(safeEndpoint, safeParams);\n};\n\nconst safeGatewayName = typeof gatewayName === 'string' ? gatewayName : '';\n/**\n * launches smallcases module\n *\n * @param {string} targetEndpoint\n * @param {string} params\n * @param {string} headerColor\n * @param {number} headerOpacity\n * @param {string} backIconColor\n * @param {number} backIconOpacity\n */\nconst launchSmallplugWithBranding = async (\n targetEndpoint,\n params,\n headerColor,\n headerOpacity,\n backIconColor,\n backIconOpacity\n) => {\n const safeEndpoint = typeof targetEndpoint === 'string' ? targetEndpoint : '';\n const safeParams = typeof params === 'string' ? params : '';\n const safeHeaderColor =\n typeof headerColor === 'string'\n ? headerColor\n : platformSpecificColorHex('2F363F');\n const safeHeaderOpacity =\n typeof headerOpacity === 'number' ? headerOpacity : 1;\n const safeBackIconColor =\n typeof backIconColor === 'string'\n ? backIconColor\n : platformSpecificColorHex('FFFFFF');\n const safeBackIconOpacity =\n typeof backIconOpacity === 'number' ? backIconOpacity : 1;\n\n return Platform.OS === 'android'\n ? SmallcaseGatewayNative.launchSmallplugWithBranding(\n safeEndpoint,\n safeParams,\n {\n headerColor: safeHeaderColor,\n headerOpacity: safeHeaderOpacity,\n backIconColor: safeBackIconColor,\n backIconOpacity: safeBackIconOpacity,\n }\n )\n : SmallcaseGatewayNative.launchSmallplugWithBranding(\n safeEndpoint,\n safeParams,\n safeHeaderColor,\n safeHeaderOpacity,\n safeBackIconColor,\n safeBackIconOpacity\n );\n};\n\n/**\n * Logs the user out and removes the web session.\n *\n * This promise will be rejected if logout was unsuccessful\n *\n * @returns {Promise}\n */\nconst logoutUser = async () => {\n return SmallcaseGatewayNative.logoutUser();\n};\n\n/**\n * This will display a list of all the orders that a user recently placed.\n * This includes pending, successful, and failed orders.\n * @returns\n */\nconst showOrders = async () => {\n return SmallcaseGatewayNative.showOrders();\n};\n\n/**\n * triggers the lead gen flow\n *\n * @param {userDetails} [userDetails]\n * @param {Object} [utmParams]\n */\nconst triggerLeadGen = (userDetails, utmParams) => {\n const safeParams = safeObject(userDetails);\n const safeUtm = safeObject(utmParams);\n\n return SmallcaseGatewayNative.triggerLeadGen(safeParams, safeUtm);\n};\n\n/**\n * triggers the lead gen flow\n *\n * @param {userDetails} [userDetails]\n * * @returns {Promise}\n */\nconst triggerLeadGenWithStatus = async (userDetails) => {\n const safeParams = safeObject(userDetails);\n\n return SmallcaseGatewayNative.triggerLeadGenWithStatus(safeParams);\n};\n\n/**\n * triggers the lead gen flow with an option of \"login here\" cta\n *\n * @param {userDetails} [userDetails]\n * @param {Object} [utmParams]\n * @param {boolean} [showLoginCta]\n * @returns {Promise}\n */\nconst triggerLeadGenWithLoginCta = async (\n userDetails,\n utmParams,\n showLoginCta\n) => {\n const safeParams = safeObject(userDetails);\n const safeUtm = safeObject(utmParams);\n const safeShowLoginCta = Boolean(showLoginCta);\n\n return SmallcaseGatewayNative.triggerLeadGenWithLoginCta(\n safeParams,\n safeUtm,\n safeShowLoginCta\n );\n};\n\n/**\n * Marks a smallcase as archived\n *\n * @param {String} iscid\n */\nconst archiveSmallcase = async (iscid) => {\n const safeIscid = typeof iscid === 'string' ? iscid : '';\n\n return SmallcaseGatewayNative.archiveSmallcase(safeIscid);\n};\n\n/**\n * Returns the native android/ios and react-native sdk version\n * (internal-tracking)\n * @returns {Promise}\n */\nconst getSdkVersion = async () => {\n return SmallcaseGatewayNative.getSdkVersion(version);\n};\n\nconst SmallcaseGateway = {\n init,\n logoutUser,\n triggerLeadGen,\n triggerLeadGenWithStatus,\n triggerLeadGenWithLoginCta,\n archiveSmallcase,\n triggerTransaction,\n triggerMfTransaction,\n setConfigEnvironment,\n launchSmallplug,\n launchSmallplugWithBranding,\n getSdkVersion,\n showOrders\n};\n\nexport default SmallcaseGateway;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,MAAM;EAAEI,gBAAgB,EAAEC;AAAuB,CAAC,GAAGC,0BAAa;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAIC,iBAAiB,GAAG,EAAE;;AAE1B;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,GAAG,MAAOC,SAAS,IAAK;EAChD,MAAMC,UAAU,GAAG,IAAAC,gBAAU,EAACF,SAAS,CAAC;EAExC,MAAMJ,sBAAsB,CAACO,mBAAmB,CAACC,gBAAO,CAAC;EAEzD,MAAM;IACJC,UAAU;IACVC,WAAW;IACXC,YAAY;IACZC,YAAY;IACZC;EACF,CAAC,GAAGR,UAAU;EAEd,MAAMS,gBAAgB,GAAGC,OAAO,CAACJ,YAAY,CAAC;EAC9C,MAAMK,gBAAgB,GAAGD,OAAO,CAACH,YAAY,CAAC;EAC9C,MAAMK,cAAc,GAAGC,KAAK,CAACC,OAAO,CAACV,UAAU,CAAC,GAAGA,UAAU,GAAG,EAAE;EAClE,MAAMW,eAAe,GAAG,OAAOV,WAAW,KAAK,QAAQ,GAAGA,WAAW,GAAG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