fidel-react-native 1.6.4 → 2.1.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 +1 -51
- package/README.md +4 -378
- package/android/build.gradle +12 -8
- package/android/jacoco.gradle +2 -2
- package/android/src/main/java/com/fidelreactlibrary/FidelModule.java +61 -44
- package/android/src/main/java/com/fidelreactlibrary/FidelPackage.java +64 -49
- package/android/src/main/java/com/fidelreactlibrary/adapters/CardVerificationConfigurationProperties.java +22 -0
- package/android/src/main/java/com/fidelreactlibrary/adapters/FidelCardSchemesAdapter.java +46 -29
- package/android/src/main/java/com/fidelreactlibrary/adapters/FidelCardVerificationChoiceAdapter.java +57 -0
- package/android/src/main/java/com/fidelreactlibrary/adapters/FidelCountryAdapter.java +47 -19
- package/android/src/main/java/com/fidelreactlibrary/adapters/FidelProgramTypeAdapter.java +46 -0
- package/android/src/main/java/com/fidelreactlibrary/adapters/FidelSetupAdapter.java +108 -6
- package/android/src/main/java/com/fidelreactlibrary/adapters/FidelSetupProperties.java +67 -0
- package/android/src/main/java/com/fidelreactlibrary/adapters/FidelVerificationConfigurationAdapter.java +35 -0
- package/android/src/main/java/com/fidelreactlibrary/adapters/ImageFromReadableMapAdapter.java +5 -1
- package/android/src/main/java/com/fidelreactlibrary/adapters/ResultsAdapter.java +288 -0
- package/android/src/main/java/com/fidelreactlibrary/adapters/abstraction/CardSchemesAdapter.java +6 -2
- package/android/src/main/java/com/fidelreactlibrary/adapters/abstraction/CardVerificationChoiceAdapter.java +11 -0
- package/android/src/main/java/com/fidelreactlibrary/adapters/abstraction/CountryAdapter.java +14 -3
- package/android/src/main/java/com/fidelreactlibrary/adapters/abstraction/DataAdapter.java +5 -0
- package/android/src/main/java/com/fidelreactlibrary/adapters/abstraction/ProgramTypeAdapter.java +11 -0
- package/android/src/main/java/com/fidelreactlibrary/adapters/abstraction/VerificationConfigurationAdapter.java +9 -0
- package/android/src/main/java/com/fidelreactlibrary/events/BridgeLibraryEvent.java +17 -0
- package/android/src/main/java/com/fidelreactlibrary/events/BridgeLibraryEventEmitter.java +24 -0
- package/android/src/main/java/com/fidelreactlibrary/events/CardVerificationChoiceObserver.java +29 -0
- package/android/src/main/java/com/fidelreactlibrary/events/CardVerificationStartedObserver.java +31 -0
- package/android/src/main/java/com/fidelreactlibrary/events/ResultsObserver.java +72 -0
- package/android/src/test/java/com/fidelreactlibrary/FidelModuleTests.java +50 -31
- package/android/src/test/java/com/fidelreactlibrary/FidelPackageTests.java +0 -1
- package/android/src/test/java/com/fidelreactlibrary/{FidelCardSchemesAdapterTests.java → adapters/FidelCardSchemesAdapterTests.java} +51 -47
- package/android/src/test/java/com/fidelreactlibrary/adapters/FidelCardVerificationChoiceAdapterTest.java +70 -0
- package/android/src/test/java/com/fidelreactlibrary/adapters/FidelCountryAdapterTests.java +157 -0
- package/android/src/test/java/com/fidelreactlibrary/adapters/FidelProgramTypeAdapterTests.java +54 -0
- package/android/src/test/java/com/fidelreactlibrary/adapters/FidelSetupAdapterTests.java +900 -0
- package/android/src/test/java/com/fidelreactlibrary/adapters/FidelVerificationConfigurationAdapterTest.java +51 -0
- package/android/src/test/java/com/fidelreactlibrary/adapters/ResultsAdapterTests.java +74 -0
- package/android/src/test/java/com/fidelreactlibrary/{ErrorEventEmitterTests.java → events/BridgeLibraryEventEmitterTests.java} +18 -7
- package/android/src/test/java/com/fidelreactlibrary/events/BridgeLibraryEventTests.java +17 -0
- package/android/src/test/java/com/fidelreactlibrary/events/CardVerificationStartedObserverTests.java +49 -0
- package/android/src/test/java/com/fidelreactlibrary/events/ResultsObserverTests.java +38 -0
- package/android/src/test/java/com/fidelreactlibrary/fakes/CardSchemeAdapterStub.java +17 -6
- package/android/src/test/java/com/fidelreactlibrary/fakes/ConstantsProviderStub.java +2 -2
- package/android/src/test/java/com/fidelreactlibrary/fakes/CountryAdapterStub.java +25 -10
- package/android/src/test/java/com/fidelreactlibrary/fakes/{DataConverterStub.java → DataAdapterStub.java} +3 -3
- package/android/src/test/java/com/fidelreactlibrary/fakes/ProgramTypeAdapterStub.java +31 -0
- package/android/src/test/java/com/fidelreactlibrary/fakes/ReactContextMock.java +1 -1
- package/android/src/test/java/com/fidelreactlibrary/fakes/ReadableArrayStub.java +82 -0
- package/android/src/test/java/com/fidelreactlibrary/fakes/ReadableMapStub.java +175 -40
- package/android/src/test/java/com/fidelreactlibrary/fakes/VerificationConfigurationAdapterStub.java +13 -0
- package/fidel-react-native.podspec +1 -1
- package/index.js +78 -19
- package/ios/Adapters/CardSchemesAdapter.swift +13 -0
- package/ios/Adapters/ConsentDetailsAdapter.swift +19 -0
- package/ios/Adapters/EnrollmentResultAdapter.swift +28 -0
- package/ios/Adapters/ErrorResultAdapter.swift +71 -0
- package/ios/{FLRNImageAdapter.h → Adapters/FLRNImageFromRNAdapter.h} +2 -3
- package/ios/Adapters/FidelSetupAdapter.swift +89 -0
- package/ios/Adapters/FidelVerificationConfigurationAdapter.swift +19 -0
- package/ios/Adapters/VerificationResultAdapter.swift +17 -0
- package/ios/CardVerificationConfigurationProperties.swift +14 -0
- package/ios/Constants/CardSchemeConstants.swift +38 -0
- package/ios/Constants/CardVerificationChoiceConstants.swift +24 -0
- package/ios/Constants/CountryConstants.swift +47 -0
- package/ios/Constants/EnrollmentErrorTypeConstants.swift +25 -0
- package/ios/Constants/ErrorTypeConstants.swift +37 -0
- package/ios/Constants/ExportedConstantsProvider.swift +42 -0
- package/ios/Constants/ProgramTypeConstants.swift +30 -0
- package/ios/Constants/ResultTypeConstants.swift +35 -0
- package/ios/Constants/VerificationErrorTypeConstants.swift +29 -0
- package/ios/Events/BridgeLibraryEvent.swift +14 -0
- package/ios/Events/CardVerificationChoiceSelectedObserver.swift +23 -0
- package/ios/Events/CardVerificationStartedObserver.swift +21 -0
- package/ios/Events/EventObserver.swift +13 -0
- package/ios/Events/JSResultProperties.swift +15 -0
- package/ios/Events/JSResultTypes.swift +14 -0
- package/ios/Events/ResultsObserver.swift +37 -0
- package/ios/FidelSetupProperties.swift +33 -0
- package/ios/NativeFidelBridge.m +13 -0
- package/ios/NativeFidelBridge.swift +100 -0
- package/package.json +1 -4
- package/android/src/main/java/com/fidelreactlibrary/adapters/FidelOptionsAdapter.java +0 -121
- package/android/src/main/java/com/fidelreactlibrary/adapters/WritableMapDataConverter.java +0 -94
- package/android/src/main/java/com/fidelreactlibrary/adapters/abstraction/DataConverter.java +0 -5
- package/android/src/main/java/com/fidelreactlibrary/events/CallbackActivityEventListener.java +0 -64
- package/android/src/main/java/com/fidelreactlibrary/events/CallbackInput.java +0 -7
- package/android/src/main/java/com/fidelreactlibrary/events/ErrorEventEmitter.java +0 -22
- package/android/src/test/java/com/fidelreactlibrary/CallbackActivityEventListenerTests.java +0 -133
- package/android/src/test/java/com/fidelreactlibrary/FidelCountryAdapterTests.java +0 -74
- package/android/src/test/java/com/fidelreactlibrary/FidelOptionsAdapterTests.java +0 -414
- package/android/src/test/java/com/fidelreactlibrary/FidelSetupAdapterTests.java +0 -65
- package/android/src/test/java/com/fidelreactlibrary/WritableMapDataConverterTests.java +0 -186
- package/android/src/test/java/com/fidelreactlibrary/fakes/CallbackInputSpy.java +0 -12
- package/android/src/test/java/com/fidelreactlibrary/fakes/CallbackSpy.java +0 -18
- package/android/src/test/java/com/fidelreactlibrary/fakes/IntentMock.java +0 -20
- package/ios/FLRNCardSchemesAdapter.h +0 -16
- package/ios/FLRNCardSchemesFromJSAdapter.h +0 -14
- package/ios/FLRNCardSchemesFromJSAdapter.m +0 -39
- package/ios/FLRNConstantsProvider.h +0 -15
- package/ios/FLRNImageFromRNAdapter.h +0 -14
- package/ios/FLRNObjectToDictionaryAdapter.h +0 -15
- package/ios/FLRNOptionsAdapter.h +0 -24
- package/ios/FLRNOptionsAdapter.m +0 -133
- package/ios/FLRNRuntimeObjectToDictionaryAdapter.h +0 -14
- package/ios/FLRNRuntimeObjectToDictionaryAdapter.m +0 -36
- package/ios/FLRNSDKOptions.h +0 -24
- package/ios/FLRNSDKSetupOptions.h +0 -14
- package/ios/FLRNSetupAdapter.h +0 -17
- package/ios/FLRNSetupAdapter.m +0 -50
- package/ios/Fidel.h +0 -20
- package/ios/Fidel.m +0 -79
- package/ios/RCTConvert+CardScheme.h +0 -33
- package/ios/RCTConvert+Options.h +0 -52
- package/ios/RCTConvert+Options.m +0 -21
- /package/ios/{FLRNImageFromRNAdapter.m → Adapters/FLRNImageFromRNAdapter.m} +0 -0
|
@@ -1,74 +1,89 @@
|
|
|
1
1
|
|
|
2
2
|
package com.fidelreactlibrary;
|
|
3
3
|
|
|
4
|
+
import androidx.annotation.NonNull;
|
|
5
|
+
import androidx.annotation.OptIn;
|
|
6
|
+
|
|
4
7
|
import java.util.ArrayList;
|
|
5
|
-
import java.util.Arrays;
|
|
6
8
|
import java.util.Collections;
|
|
7
9
|
import java.util.List;
|
|
8
10
|
|
|
9
11
|
import com.facebook.react.ReactPackage;
|
|
10
12
|
import com.facebook.react.bridge.NativeModule;
|
|
11
13
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
12
|
-
import com.facebook.react.bridge.
|
|
14
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
13
15
|
import com.facebook.react.bridge.WritableNativeMap;
|
|
14
16
|
import com.facebook.react.uimanager.ViewManager;
|
|
15
|
-
import com.
|
|
17
|
+
import com.fidelapi.utils.FidelExperimental;
|
|
16
18
|
import com.fidelreactlibrary.adapters.FidelCardSchemesAdapter;
|
|
17
|
-
import com.fidelreactlibrary.adapters.
|
|
19
|
+
import com.fidelreactlibrary.adapters.FidelCardVerificationChoiceAdapter;
|
|
18
20
|
import com.fidelreactlibrary.adapters.FidelCountryAdapter;
|
|
19
|
-
import com.fidelreactlibrary.adapters.
|
|
21
|
+
import com.fidelreactlibrary.adapters.FidelProgramTypeAdapter;
|
|
20
22
|
import com.fidelreactlibrary.adapters.FidelSetupAdapter;
|
|
23
|
+
import com.fidelreactlibrary.adapters.FidelVerificationConfigurationAdapter;
|
|
21
24
|
import com.fidelreactlibrary.adapters.ImageFromReadableMapAdapter;
|
|
22
|
-
import com.fidelreactlibrary.adapters.
|
|
25
|
+
import com.fidelreactlibrary.adapters.ResultsAdapter;
|
|
26
|
+
import com.fidelreactlibrary.adapters.abstraction.CardSchemesAdapter;
|
|
23
27
|
import com.fidelreactlibrary.adapters.abstraction.ConstantsProvider;
|
|
24
|
-
import com.fidelreactlibrary.adapters.abstraction.
|
|
25
|
-
import com.fidelreactlibrary.
|
|
26
|
-
import com.fidelreactlibrary.events.
|
|
28
|
+
import com.fidelreactlibrary.adapters.abstraction.CountryAdapter;
|
|
29
|
+
import com.fidelreactlibrary.adapters.abstraction.DataProcessor;
|
|
30
|
+
import com.fidelreactlibrary.events.BridgeLibraryEvent;
|
|
31
|
+
import com.fidelreactlibrary.events.CardVerificationChoiceObserver;
|
|
32
|
+
import com.fidelreactlibrary.events.CardVerificationStartedObserver;
|
|
33
|
+
import com.fidelreactlibrary.events.ResultsObserver;
|
|
34
|
+
import com.fidelreactlibrary.events.BridgeLibraryEventEmitter;
|
|
27
35
|
|
|
36
|
+
@OptIn(markerClass = FidelExperimental.class)
|
|
28
37
|
public class FidelPackage implements ReactPackage {
|
|
38
|
+
|
|
29
39
|
@Override
|
|
30
|
-
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
|
31
|
-
ImageFromReadableMapAdapter imageAdapter =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
new
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
new
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
activityEventListener));
|
|
63
|
-
}
|
|
40
|
+
public @NonNull List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
|
|
41
|
+
ImageFromReadableMapAdapter imageAdapter = new ImageFromReadableMapAdapter(reactContext);
|
|
42
|
+
CountryAdapter countryAdapter = new FidelCountryAdapter();
|
|
43
|
+
CardSchemesAdapter cardSchemeAdapter = new FidelCardSchemesAdapter();
|
|
44
|
+
FidelSetupAdapter setupAdapter = new FidelSetupAdapter(
|
|
45
|
+
imageAdapter,
|
|
46
|
+
countryAdapter,
|
|
47
|
+
cardSchemeAdapter,
|
|
48
|
+
new FidelProgramTypeAdapter());
|
|
49
|
+
imageAdapter.bitmapOutput = setupAdapter;
|
|
50
|
+
|
|
51
|
+
List<ConstantsProvider> constantsProviderList = new ArrayList<>();
|
|
52
|
+
|
|
53
|
+
ResultsAdapter resultsAdapter = new ResultsAdapter(WritableNativeMap::new, countryAdapter, cardSchemeAdapter);
|
|
54
|
+
DataProcessor<ReadableMap> resultHandler = new BridgeLibraryEventEmitter(reactContext,
|
|
55
|
+
BridgeLibraryEvent.RESULT_AVAILABLE);
|
|
56
|
+
ResultsObserver resultsObserver = new ResultsObserver(resultsAdapter, resultHandler, WritableNativeMap::new);
|
|
57
|
+
|
|
58
|
+
DataProcessor<ReadableMap> cardVerificationStartedHandler = new BridgeLibraryEventEmitter(reactContext,
|
|
59
|
+
BridgeLibraryEvent.CARD_VERIFICATION_STARTED);
|
|
60
|
+
DataProcessor<ReadableMap> cardVerificationChoiceHandler = new BridgeLibraryEventEmitter(reactContext,
|
|
61
|
+
BridgeLibraryEvent.CARD_VERIFICATION_CHOICE);
|
|
62
|
+
CardVerificationStartedObserver cardVerificationStartedObserver = new CardVerificationStartedObserver(
|
|
63
|
+
cardVerificationStartedHandler, WritableNativeMap::new);
|
|
64
|
+
FidelCardVerificationChoiceAdapter cardVerificationChoiceAdapter = new FidelCardVerificationChoiceAdapter(WritableNativeMap::new);
|
|
65
|
+
CardVerificationChoiceObserver cardVerificationChoiceObserver = new CardVerificationChoiceObserver(
|
|
66
|
+
cardVerificationChoiceHandler, cardVerificationChoiceAdapter);
|
|
67
|
+
|
|
68
|
+
constantsProviderList.add(setupAdapter);
|
|
69
|
+
constantsProviderList.add(resultsAdapter);
|
|
70
|
+
constantsProviderList.add(resultsObserver);
|
|
71
|
+
constantsProviderList.add(cardVerificationChoiceAdapter);
|
|
64
72
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
73
|
+
FidelModule fidelModule = new FidelModule(
|
|
74
|
+
reactContext,
|
|
75
|
+
setupAdapter,
|
|
76
|
+
resultsObserver,
|
|
77
|
+
cardVerificationStartedObserver,
|
|
78
|
+
cardVerificationChoiceObserver,
|
|
79
|
+
constantsProviderList,
|
|
80
|
+
new FidelVerificationConfigurationAdapter());
|
|
81
|
+
return Collections.singletonList(fidelModule);
|
|
68
82
|
}
|
|
69
83
|
|
|
84
|
+
@NonNull
|
|
70
85
|
@Override
|
|
71
|
-
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
|
72
|
-
|
|
86
|
+
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
|
|
87
|
+
return Collections.emptyList();
|
|
73
88
|
}
|
|
74
|
-
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package com.fidelreactlibrary.adapters;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
|
|
5
|
+
public enum CardVerificationConfigurationProperties {
|
|
6
|
+
ID("id"),
|
|
7
|
+
CONSENT_ID("consentId"),
|
|
8
|
+
LAST_4_DIGITS("last4Digits");
|
|
9
|
+
|
|
10
|
+
private final @NonNull String jsName;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param jsName The name of the key that will be available in JavaScript
|
|
14
|
+
*/
|
|
15
|
+
CardVerificationConfigurationProperties(final @NonNull String jsName) {
|
|
16
|
+
this.jsName = jsName;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public String jsName() {
|
|
20
|
+
return jsName;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
package com.fidelreactlibrary.adapters;
|
|
2
2
|
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
|
|
3
6
|
import com.facebook.react.bridge.ReadableArray;
|
|
4
|
-
import com.
|
|
7
|
+
import com.facebook.react.bridge.ReadableType;
|
|
8
|
+
import com.fidelapi.entities.CardScheme;
|
|
5
9
|
import com.fidelreactlibrary.adapters.abstraction.CardSchemesAdapter;
|
|
6
10
|
|
|
7
|
-
import java.util.
|
|
11
|
+
import java.util.EnumSet;
|
|
8
12
|
import java.util.HashMap;
|
|
9
|
-
import java.util.HashSet;
|
|
10
13
|
import java.util.Map;
|
|
11
14
|
import java.util.Set;
|
|
12
15
|
|
|
@@ -23,41 +26,55 @@ public final class FidelCardSchemesAdapter implements CardSchemesAdapter {
|
|
|
23
26
|
@Override
|
|
24
27
|
public @Nonnull Map<String, Object> getConstants() {
|
|
25
28
|
final Map<String, Object> constants = new HashMap<>();
|
|
26
|
-
Map<String,
|
|
27
|
-
for (
|
|
28
|
-
String cardSchemeKey =
|
|
29
|
-
|
|
30
|
-
case VISA: cardSchemeKey = VISA_CARD_SCHEME_VALUE; break;
|
|
31
|
-
case MASTERCARD: cardSchemeKey = MASTERCARD_SCHEME_VALUE; break;
|
|
32
|
-
case AMERICAN_EXPRESS: cardSchemeKey = AMERICAN_EXPRESS_CARD_SCHEME_VALUE; break;
|
|
33
|
-
}
|
|
34
|
-
cardSchemesConstants.put(cardSchemeKey, cardScheme.ordinal());
|
|
29
|
+
Map<String, String> cardSchemesConstants = new HashMap<>();
|
|
30
|
+
for (CardScheme cardScheme : CardScheme.values()) {
|
|
31
|
+
String cardSchemeKey = jsValue(cardScheme);
|
|
32
|
+
cardSchemesConstants.put(cardSchemeKey, cardSchemeKey);
|
|
35
33
|
}
|
|
36
34
|
constants.put(EXPORTED_CARD_SCHEME_KEY, cardSchemesConstants);
|
|
37
35
|
return constants;
|
|
38
36
|
}
|
|
39
37
|
|
|
38
|
+
@NonNull
|
|
40
39
|
@Override
|
|
41
|
-
public
|
|
40
|
+
public String jsValue(@NonNull CardScheme cardScheme) {
|
|
41
|
+
switch (cardScheme) {
|
|
42
|
+
case VISA:
|
|
43
|
+
return VISA_CARD_SCHEME_VALUE;
|
|
44
|
+
case MASTERCARD:
|
|
45
|
+
return MASTERCARD_SCHEME_VALUE;
|
|
46
|
+
case AMERICAN_EXPRESS:
|
|
47
|
+
return AMERICAN_EXPRESS_CARD_SCHEME_VALUE;
|
|
48
|
+
}
|
|
49
|
+
return "notFound";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@Nullable
|
|
53
|
+
private CardScheme cardSchemeWithJsValue(String jsValue) {
|
|
54
|
+
switch (jsValue) {
|
|
55
|
+
case VISA_CARD_SCHEME_VALUE:
|
|
56
|
+
return CardScheme.VISA;
|
|
57
|
+
case MASTERCARD_SCHEME_VALUE:
|
|
58
|
+
return CardScheme.MASTERCARD;
|
|
59
|
+
case AMERICAN_EXPRESS_CARD_SCHEME_VALUE:
|
|
60
|
+
return CardScheme.AMERICAN_EXPRESS;
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@Override
|
|
66
|
+
public @NonNull Set<CardScheme> cardSchemesWithReadableArray(@Nullable ReadableArray arrayToAdapt) {
|
|
67
|
+
Set<CardScheme> cardSchemeSet = EnumSet.noneOf(CardScheme.class);
|
|
42
68
|
if (arrayToAdapt == null) {
|
|
43
|
-
return
|
|
69
|
+
return cardSchemeSet;
|
|
44
70
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (objectToAdapt.getClass() == Integer.class) {
|
|
49
|
-
integerArrayToAdapt.add((Integer)objectToAdapt);
|
|
71
|
+
for (int i = 0; i < arrayToAdapt.size(); i++) {
|
|
72
|
+
if (arrayToAdapt.getType(i) != ReadableType.String) {
|
|
73
|
+
continue;
|
|
50
74
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
Set<Integer> receivedObjectsSet = new HashSet<>(integerArrayToAdapt);
|
|
57
|
-
Set<Fidel.CardScheme> cardSchemeSet = new HashSet<>();
|
|
58
|
-
for (Fidel.CardScheme scheme : Fidel.CardScheme.values()) {
|
|
59
|
-
if (receivedObjectsSet.contains(scheme.ordinal())) {
|
|
60
|
-
cardSchemeSet.add(scheme);
|
|
75
|
+
CardScheme cardScheme = cardSchemeWithJsValue(arrayToAdapt.getString(i));
|
|
76
|
+
if (cardScheme != null) {
|
|
77
|
+
cardSchemeSet.add(cardScheme);
|
|
61
78
|
}
|
|
62
79
|
}
|
|
63
80
|
return cardSchemeSet;
|
package/android/src/main/java/com/fidelreactlibrary/adapters/FidelCardVerificationChoiceAdapter.java
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
package com.fidelreactlibrary.adapters;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.OptIn;
|
|
5
|
+
|
|
6
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
7
|
+
import com.facebook.react.bridge.WritableMap;
|
|
8
|
+
import com.fidelapi.entities.CardVerificationChoice;
|
|
9
|
+
import com.fidelapi.utils.FidelExperimental;
|
|
10
|
+
import com.fidelreactlibrary.adapters.abstraction.CardVerificationChoiceAdapter;
|
|
11
|
+
import com.fidelreactlibrary.adapters.abstraction.ConstantsProvider;
|
|
12
|
+
import com.fidelreactlibrary.adapters.abstraction.ObjectFactory;
|
|
13
|
+
|
|
14
|
+
import java.util.HashMap;
|
|
15
|
+
import java.util.Map;
|
|
16
|
+
|
|
17
|
+
@OptIn(markerClass = FidelExperimental.class)
|
|
18
|
+
public class FidelCardVerificationChoiceAdapter implements CardVerificationChoiceAdapter, ConstantsProvider {
|
|
19
|
+
protected static final String CARD_VERIFICATION_ON_THE_SPOT = "onTheSpot";
|
|
20
|
+
protected static final String CARD_VERIFICATION_DELEGATED_TO_THIRD_PARTY = "delegatedToThirdParty";
|
|
21
|
+
public static final String CARD_VERIFICATION_CHOICE = "CardVerificationChoice";
|
|
22
|
+
private final ObjectFactory<WritableMap> writableMapFactory;
|
|
23
|
+
|
|
24
|
+
public FidelCardVerificationChoiceAdapter(ObjectFactory<WritableMap> writableMapFactory) {
|
|
25
|
+
this.writableMapFactory = writableMapFactory;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@Override
|
|
29
|
+
public ReadableMap adapt(@NonNull CardVerificationChoice cardVerificationChoice) {
|
|
30
|
+
WritableMap map = writableMapFactory.create();
|
|
31
|
+
map.putString(CARD_VERIFICATION_CHOICE, jsValue(cardVerificationChoice));
|
|
32
|
+
return map;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@NonNull
|
|
36
|
+
@Override
|
|
37
|
+
public Map<String, Object> getConstants() {
|
|
38
|
+
final Map<String, Object> constants = new HashMap<>();
|
|
39
|
+
final Map<String, String> verificationChoicesMap = new HashMap<>();
|
|
40
|
+
for (CardVerificationChoice choice : CardVerificationChoice.values()) {
|
|
41
|
+
String verificationChoiceKeyAndValue = jsValue(choice);
|
|
42
|
+
verificationChoicesMap.put(verificationChoiceKeyAndValue, verificationChoiceKeyAndValue);
|
|
43
|
+
}
|
|
44
|
+
constants.put(CARD_VERIFICATION_CHOICE, verificationChoicesMap);
|
|
45
|
+
return constants;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private String jsValue(@NonNull CardVerificationChoice cardVerificationChoice) {
|
|
49
|
+
switch (cardVerificationChoice) {
|
|
50
|
+
case DELEGATED_TO_THIRD_PARTY:
|
|
51
|
+
return CARD_VERIFICATION_DELEGATED_TO_THIRD_PARTY;
|
|
52
|
+
case ON_THE_SPOT:
|
|
53
|
+
return CARD_VERIFICATION_ON_THE_SPOT;
|
|
54
|
+
}
|
|
55
|
+
return "notFound";
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
package com.fidelreactlibrary.adapters;
|
|
2
2
|
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
|
|
3
6
|
import com.facebook.react.bridge.ReadableArray;
|
|
4
|
-
import com.
|
|
7
|
+
import com.facebook.react.bridge.ReadableType;
|
|
8
|
+
import com.fidelapi.entities.Country;
|
|
5
9
|
import com.fidelreactlibrary.adapters.abstraction.CountryAdapter;
|
|
6
10
|
|
|
11
|
+
import java.util.EnumSet;
|
|
7
12
|
import java.util.HashMap;
|
|
8
13
|
import java.util.Map;
|
|
9
|
-
|
|
10
|
-
import javax.annotation.Nonnull;
|
|
14
|
+
import java.util.Set;
|
|
11
15
|
|
|
12
16
|
public final class FidelCountryAdapter implements CountryAdapter {
|
|
13
17
|
|
|
@@ -20,10 +24,12 @@ public final class FidelCountryAdapter implements CountryAdapter {
|
|
|
20
24
|
private static final String SWEDEN_COUNTRY_KEY = "sweden";
|
|
21
25
|
private static final String IRELAND_COUNTRY_KEY = "ireland";
|
|
22
26
|
private static final String CANADA_COUNTRY_KEY = "canada";
|
|
27
|
+
private static final String NORWAY_COUNTRY_KEY = "norway";
|
|
23
28
|
|
|
24
29
|
private static final String NOT_FOUND_COUNTRY_KEY = "notFound";
|
|
25
30
|
|
|
26
|
-
|
|
31
|
+
@NonNull
|
|
32
|
+
private String keyFor(@NonNull Country country) {
|
|
27
33
|
switch (country) {
|
|
28
34
|
case UNITED_KINGDOM: return UNITED_KINGDOM_COUNTRY_KEY;
|
|
29
35
|
case UNITED_STATES: return UNITED_STATES_COUNTRY_KEY;
|
|
@@ -32,36 +38,58 @@ public final class FidelCountryAdapter implements CountryAdapter {
|
|
|
32
38
|
case SWEDEN: return SWEDEN_COUNTRY_KEY;
|
|
33
39
|
case IRELAND: return IRELAND_COUNTRY_KEY;
|
|
34
40
|
case CANADA: return CANADA_COUNTRY_KEY;
|
|
41
|
+
case NORWAY: return NORWAY_COUNTRY_KEY;
|
|
35
42
|
}
|
|
36
43
|
return NOT_FOUND_COUNTRY_KEY;
|
|
37
44
|
}
|
|
38
45
|
|
|
46
|
+
public @Nullable Country countryWithJSValue(String jsValue) {
|
|
47
|
+
switch (jsValue) {
|
|
48
|
+
case UNITED_KINGDOM_COUNTRY_KEY: return Country.UNITED_KINGDOM;
|
|
49
|
+
case UNITED_STATES_COUNTRY_KEY: return Country.UNITED_STATES;
|
|
50
|
+
case UNITED_ARAB_EMIRATES_KEY: return Country.UNITED_ARAB_EMIRATES;
|
|
51
|
+
case JAPAN_COUNTRY_KEY: return Country.JAPAN;
|
|
52
|
+
case SWEDEN_COUNTRY_KEY: return Country.SWEDEN;
|
|
53
|
+
case IRELAND_COUNTRY_KEY: return Country.IRELAND;
|
|
54
|
+
case CANADA_COUNTRY_KEY: return Country.CANADA;
|
|
55
|
+
case NORWAY_COUNTRY_KEY: return Country.NORWAY;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@NonNull
|
|
39
61
|
@Override
|
|
40
|
-
public @
|
|
62
|
+
public String jsCountryValue(@NonNull Country country) {
|
|
63
|
+
return keyFor(country);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@Override
|
|
67
|
+
public @NonNull Map<String, Object> getConstants() {
|
|
41
68
|
final Map<String, Object> constants = new HashMap<>();
|
|
42
|
-
final Map<String,
|
|
43
|
-
for (
|
|
44
|
-
|
|
69
|
+
final Map<String, String> countriesMap = new HashMap<>();
|
|
70
|
+
for (Country country :
|
|
71
|
+
Country.values()) {
|
|
45
72
|
String countryKey = keyFor(country);
|
|
46
|
-
countriesMap.put(countryKey,
|
|
73
|
+
countriesMap.put(countryKey, countryKey);
|
|
47
74
|
}
|
|
48
75
|
constants.put(EXPORTED_COUNTRY_KEY, countriesMap);
|
|
49
76
|
return constants;
|
|
50
77
|
}
|
|
51
78
|
|
|
52
79
|
@Override
|
|
53
|
-
public
|
|
54
|
-
|
|
55
|
-
|
|
80
|
+
public @NonNull Set<Country> parseAllowedCountries(@Nullable ReadableArray inputArray) {
|
|
81
|
+
Set<Country> countries = EnumSet.noneOf(Country.class);
|
|
82
|
+
if (inputArray == null) {
|
|
83
|
+
return countries;
|
|
56
84
|
}
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@Override
|
|
61
|
-
public Fidel.Country[] parseAllowedCountries(ReadableArray inputArray) {
|
|
62
|
-
Fidel.Country[] countries = new Fidel.Country[inputArray.size()];
|
|
63
85
|
for (int i = 0; i < inputArray.size(); i++) {
|
|
64
|
-
|
|
86
|
+
if (inputArray.getType(i) != ReadableType.String) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
Country country = countryWithJSValue(inputArray.getString(i));
|
|
90
|
+
if (country != null) {
|
|
91
|
+
countries.add(country);
|
|
92
|
+
}
|
|
65
93
|
}
|
|
66
94
|
return countries;
|
|
67
95
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
package com.fidelreactlibrary.adapters;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
|
|
6
|
+
import com.fidelapi.entities.ProgramType;
|
|
7
|
+
import com.fidelreactlibrary.adapters.abstraction.ProgramTypeAdapter;
|
|
8
|
+
|
|
9
|
+
import java.util.HashMap;
|
|
10
|
+
import java.util.Map;
|
|
11
|
+
|
|
12
|
+
public class FidelProgramTypeAdapter implements ProgramTypeAdapter {
|
|
13
|
+
|
|
14
|
+
public @NonNull String keyFor(@NonNull ProgramType programType) {
|
|
15
|
+
switch (programType) {
|
|
16
|
+
case TRANSACTION_SELECT: return "transactionSelect";
|
|
17
|
+
case TRANSACTION_STREAM: return "transactionStream";
|
|
18
|
+
default: return "notFound";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@NonNull
|
|
23
|
+
@Override
|
|
24
|
+
public ProgramType parseProgramType(@Nullable String programType) {
|
|
25
|
+
ProgramType programTypeToReturn;
|
|
26
|
+
try {
|
|
27
|
+
programTypeToReturn = ProgramType.valueOf(programType);
|
|
28
|
+
} catch (Exception e) {
|
|
29
|
+
programTypeToReturn = ProgramType.TRANSACTION_SELECT;
|
|
30
|
+
}
|
|
31
|
+
return programTypeToReturn;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@NonNull
|
|
35
|
+
@Override
|
|
36
|
+
public Map<String, Object> getConstants() {
|
|
37
|
+
final Map<String, Object> constants = new HashMap<>();
|
|
38
|
+
final Map<String, String> programTypesMap = new HashMap<>();
|
|
39
|
+
for (ProgramType programType : ProgramType.values()) {
|
|
40
|
+
String programTypeKey = keyFor(programType);
|
|
41
|
+
programTypesMap.put(programTypeKey, programType.name());
|
|
42
|
+
}
|
|
43
|
+
constants.put("ProgramType", programTypesMap);
|
|
44
|
+
return constants;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -1,16 +1,118 @@
|
|
|
1
1
|
package com.fidelreactlibrary.adapters;
|
|
2
2
|
|
|
3
|
+
import android.graphics.Bitmap;
|
|
4
|
+
|
|
5
|
+
import androidx.annotation.NonNull;
|
|
6
|
+
|
|
3
7
|
import com.facebook.react.bridge.ReadableMap;
|
|
4
|
-
import com.
|
|
8
|
+
import com.fidelapi.Fidel;
|
|
9
|
+
import com.fidelapi.entities.Country;
|
|
10
|
+
import com.fidelreactlibrary.adapters.abstraction.CardSchemesAdapter;
|
|
11
|
+
import com.fidelreactlibrary.adapters.abstraction.ConstantsProvider;
|
|
12
|
+
import com.fidelreactlibrary.adapters.abstraction.CountryAdapter;
|
|
13
|
+
import com.fidelreactlibrary.adapters.abstraction.DataOutput;
|
|
5
14
|
import com.fidelreactlibrary.adapters.abstraction.DataProcessor;
|
|
15
|
+
import com.fidelreactlibrary.adapters.abstraction.ProgramTypeAdapter;
|
|
16
|
+
|
|
17
|
+
import org.json.JSONObject;
|
|
18
|
+
|
|
19
|
+
import java.util.Map;
|
|
6
20
|
|
|
7
|
-
public final class FidelSetupAdapter implements DataProcessor<ReadableMap
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
public final class FidelSetupAdapter implements DataProcessor<ReadableMap>, DataOutput<Bitmap>, ConstantsProvider {
|
|
22
|
+
|
|
23
|
+
private final DataProcessor<ReadableMap> imageAdapter;
|
|
24
|
+
private final CountryAdapter countryAdapter;
|
|
25
|
+
private final CardSchemesAdapter cardSchemesAdapter;
|
|
26
|
+
private final ProgramTypeAdapter programTypeAdapter;
|
|
27
|
+
|
|
28
|
+
public FidelSetupAdapter(DataProcessor<ReadableMap> imageAdapter, CountryAdapter countryAdapter,
|
|
29
|
+
CardSchemesAdapter cardSchemesAdapter, ProgramTypeAdapter programTypeAdapter) {
|
|
30
|
+
this.imageAdapter = imageAdapter;
|
|
31
|
+
this.countryAdapter = countryAdapter;
|
|
32
|
+
this.cardSchemesAdapter = cardSchemesAdapter;
|
|
33
|
+
this.programTypeAdapter = programTypeAdapter;
|
|
34
|
+
}
|
|
10
35
|
|
|
11
36
|
@Override
|
|
12
37
|
public void process(ReadableMap data) {
|
|
13
|
-
|
|
14
|
-
|
|
38
|
+
if (data.hasKey(FidelSetupProperties.SDK_KEY.jsName())) {
|
|
39
|
+
Fidel.sdkKey = data.getString(FidelSetupProperties.SDK_KEY.jsName());
|
|
40
|
+
}
|
|
41
|
+
if (data.hasKey(FidelSetupProperties.PROGRAM_ID.jsName())) {
|
|
42
|
+
Fidel.programId = data.getString(FidelSetupProperties.PROGRAM_ID.jsName());
|
|
43
|
+
}
|
|
44
|
+
if (data.hasKey(FidelSetupProperties.PROGRAM_TYPE.jsName())) {
|
|
45
|
+
String programTypeValue = data.getString(FidelSetupProperties.PROGRAM_TYPE.jsName());
|
|
46
|
+
Fidel.programType = programTypeAdapter.parseProgramType(programTypeValue);
|
|
47
|
+
}
|
|
48
|
+
ReadableMap optionsMap = data.getMap(FidelSetupProperties.OPTIONS.jsName());
|
|
49
|
+
if (optionsMap != null) {
|
|
50
|
+
if (optionsMap.hasKey(FidelSetupProperties.Options.BANNER_IMAGE.jsName())) {
|
|
51
|
+
imageAdapter.process(optionsMap.getMap(FidelSetupProperties.Options.BANNER_IMAGE.jsName()));
|
|
52
|
+
}
|
|
53
|
+
if (optionsMap.hasKey(FidelSetupProperties.Options.ALLOWED_COUNTRIES.jsName())) {
|
|
54
|
+
Fidel.allowedCountries = countryAdapter
|
|
55
|
+
.parseAllowedCountries(optionsMap.getArray(FidelSetupProperties.Options.ALLOWED_COUNTRIES.jsName()));
|
|
56
|
+
}
|
|
57
|
+
if (optionsMap.hasKey(FidelSetupProperties.Options.DEFAULT_SELECTED_COUNTRY.jsName())) {
|
|
58
|
+
Country defaultSelectedCountry = countryAdapter.countryWithJSValue(
|
|
59
|
+
optionsMap.getString(FidelSetupProperties.Options.DEFAULT_SELECTED_COUNTRY.jsName()));
|
|
60
|
+
if (defaultSelectedCountry != null) {
|
|
61
|
+
Fidel.defaultSelectedCountry = defaultSelectedCountry;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (optionsMap.hasKey(FidelSetupProperties.Options.SUPPORTED_CARD_SCHEMES.jsName())) {
|
|
65
|
+
Fidel.supportedCardSchemes = cardSchemesAdapter.cardSchemesWithReadableArray(
|
|
66
|
+
optionsMap.getArray(FidelSetupProperties.Options.SUPPORTED_CARD_SCHEMES.jsName()));
|
|
67
|
+
}
|
|
68
|
+
if (optionsMap.hasKey(FidelSetupProperties.Options.THIRD_PARTY_VERIFICATION_CHOICE.jsName())) {
|
|
69
|
+
Fidel.thirdPartyVerificationChoice = optionsMap
|
|
70
|
+
.getBoolean(FidelSetupProperties.Options.THIRD_PARTY_VERIFICATION_CHOICE.jsName());
|
|
71
|
+
}
|
|
72
|
+
if (optionsMap.hasKey(FidelSetupProperties.Options.META_DATA.jsName())) {
|
|
73
|
+
ReadableMap metaDataMap = optionsMap.getMap(FidelSetupProperties.Options.META_DATA.jsName());
|
|
74
|
+
if (metaDataMap != null) {
|
|
75
|
+
Fidel.metaData = new JSONObject(metaDataMap.toHashMap());
|
|
76
|
+
} else {
|
|
77
|
+
Fidel.metaData = null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
ReadableMap consentTextMap = data.getMap(FidelSetupProperties.CONSENT_TEXT.jsName());
|
|
83
|
+
if (consentTextMap != null) {
|
|
84
|
+
if (consentTextMap.hasKey(FidelSetupProperties.ConsentText.COMPANY_NAME.jsName())) {
|
|
85
|
+
Fidel.companyName = consentTextMap.getString(FidelSetupProperties.ConsentText.COMPANY_NAME.jsName());
|
|
86
|
+
}
|
|
87
|
+
if (consentTextMap.hasKey(FidelSetupProperties.ConsentText.TERMS_AND_CONDITIONS_URL.jsName())) {
|
|
88
|
+
Fidel.termsAndConditionsUrl = consentTextMap
|
|
89
|
+
.getString(FidelSetupProperties.ConsentText.TERMS_AND_CONDITIONS_URL.jsName());
|
|
90
|
+
}
|
|
91
|
+
if (consentTextMap.hasKey(FidelSetupProperties.ConsentText.PRIVACY_POLICY_URL.jsName())) {
|
|
92
|
+
Fidel.privacyPolicyUrl = consentTextMap
|
|
93
|
+
.getString(FidelSetupProperties.ConsentText.PRIVACY_POLICY_URL.jsName());
|
|
94
|
+
}
|
|
95
|
+
if (consentTextMap.hasKey(FidelSetupProperties.ConsentText.PROGRAM_NAME.jsName())) {
|
|
96
|
+
Fidel.programName = consentTextMap.getString(FidelSetupProperties.ConsentText.PROGRAM_NAME.jsName());
|
|
97
|
+
}
|
|
98
|
+
if (consentTextMap.hasKey(FidelSetupProperties.ConsentText.DELETE_INSTRUCTIONS.jsName())) {
|
|
99
|
+
Fidel.deleteInstructions = consentTextMap
|
|
100
|
+
.getString(FidelSetupProperties.ConsentText.DELETE_INSTRUCTIONS.jsName());
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@Override
|
|
106
|
+
public void output(Bitmap data) {
|
|
107
|
+
Fidel.bannerImage = data;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@NonNull
|
|
111
|
+
@Override
|
|
112
|
+
public Map<String, Object> getConstants() {
|
|
113
|
+
Map<String, Object> constants = countryAdapter.getConstants();
|
|
114
|
+
constants.putAll(cardSchemesAdapter.getConstants());
|
|
115
|
+
constants.putAll(programTypeAdapter.getConstants());
|
|
116
|
+
return constants;
|
|
15
117
|
}
|
|
16
118
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
package com.fidelreactlibrary.adapters;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
|
|
5
|
+
public enum FidelSetupProperties {
|
|
6
|
+
SDK_KEY("sdkKey"),
|
|
7
|
+
PROGRAM_ID("programId"),
|
|
8
|
+
PROGRAM_TYPE("programType"),
|
|
9
|
+
OPTIONS("options"),
|
|
10
|
+
CONSENT_TEXT("consentText");
|
|
11
|
+
|
|
12
|
+
public enum Options {
|
|
13
|
+
BANNER_IMAGE("bannerImage"),
|
|
14
|
+
ALLOWED_COUNTRIES("allowedCountries"),
|
|
15
|
+
DEFAULT_SELECTED_COUNTRY("defaultSelectedCountry"),
|
|
16
|
+
SUPPORTED_CARD_SCHEMES("supportedCardSchemes"),
|
|
17
|
+
THIRD_PARTY_VERIFICATION_CHOICE("thirdPartyVerificationChoice"),
|
|
18
|
+
META_DATA("metaData");
|
|
19
|
+
|
|
20
|
+
private final @NonNull String jsName;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @param jsName The name of the key that will be available in JavaScript
|
|
24
|
+
*/
|
|
25
|
+
Options(final @NonNull String jsName) {
|
|
26
|
+
this.jsName = jsName;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public String jsName() {
|
|
30
|
+
return jsName;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public enum ConsentText {
|
|
35
|
+
COMPANY_NAME("companyName"),
|
|
36
|
+
TERMS_AND_CONDITIONS_URL("termsAndConditionsUrl"),
|
|
37
|
+
PRIVACY_POLICY_URL("privacyPolicyUrl"),
|
|
38
|
+
PROGRAM_NAME("programName"),
|
|
39
|
+
DELETE_INSTRUCTIONS("deleteInstructions");
|
|
40
|
+
|
|
41
|
+
private final @NonNull String jsName;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @param jsName The name of the key that will be available in JavaScript
|
|
45
|
+
*/
|
|
46
|
+
ConsentText(final @NonNull String jsName) {
|
|
47
|
+
this.jsName = jsName;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public String jsName() {
|
|
51
|
+
return jsName;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
private final @NonNull String jsName;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @param jsName The name of the key that will be available in JavaScript
|
|
59
|
+
*/
|
|
60
|
+
FidelSetupProperties(final @NonNull String jsName) {
|
|
61
|
+
this.jsName = jsName;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public String jsName() {
|
|
65
|
+
return jsName;
|
|
66
|
+
}
|
|
67
|
+
}
|