fidel-react-native 1.5.0 → 1.6.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 +3 -0
- package/README.md +13 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/fidelreactlibrary/adapters/FidelOptionsAdapter.java +4 -0
- package/ios/FLRNOptionsAdapter.m +5 -0
- package/ios/FLRNSDKOptions.h +10 -9
- package/ios/RCTConvert+Options.h +3 -1
- package/ios/RCTConvert+Options.m +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Fidel React Native bridge library change log
|
|
2
2
|
|
|
3
|
+
## 1.6.0
|
|
4
|
+
- Added the `defaultSelectedCountry` property which sets the country that will be selected by default, when opening the card enrollment screen.
|
|
5
|
+
|
|
3
6
|
## 1.5.0
|
|
4
7
|
- Remove card scanning confirmation screen.
|
|
5
8
|
|
package/README.md
CHANGED
|
@@ -81,6 +81,7 @@ const countries = [Fidel.Country.ireland, Fidel.Country.unitedStates];
|
|
|
81
81
|
Fidel.setOptions({
|
|
82
82
|
bannerImage: resolvedImage,
|
|
83
83
|
allowedCountries: countries,
|
|
84
|
+
defaultSelectedCountry: Fidel.Country.unitedStates,
|
|
84
85
|
supportedCardSchemes: Array.from(cardSchemes),
|
|
85
86
|
autoScan: false,
|
|
86
87
|
metaData: {'meta-data-1': 'value1'}, // additional data to pass with the card
|
|
@@ -183,6 +184,18 @@ Fidel.setOptions({
|
|
|
183
184
|
|
|
184
185
|
The possible options are: `.canada`, `.ireland`, `.japan`, `.sweden`, `.unitedArabEmirates`, `.unitedKingdom`, `.unitedStates`. You can set one or multiple of these countries. If you don't set any allowed countries, the user will be able to choose any of the countries above. If you set only one country, the card linking screen will not show the country picker UI. Note that, when you set multiple countries, they will be displayed in the country picker UI in the order that you set them.
|
|
185
186
|
|
|
187
|
+
### defaultSelectedCountry
|
|
188
|
+
|
|
189
|
+
Use this parameter to set the country that will be selected by default when opening the card enrollment screen.
|
|
190
|
+
|
|
191
|
+
```javascript
|
|
192
|
+
Fidel.setOptions({
|
|
193
|
+
defaultSelectedCountry: Fidel.Country.unitedKingdom
|
|
194
|
+
});
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
The possible options are: `.canada`, `.ireland`, `.japan`, `.sweden`, `.unitedArabEmirates`, `.unitedKingdom`, `.unitedStates`. The `defaultSelectedCountry` has to be part of the `allowedCountries` list. The default value of this option is `.unitedKingdom`.
|
|
198
|
+
|
|
186
199
|
### supportedCardSchemes
|
|
187
200
|
|
|
188
201
|
We currently support _Visa_, _Mastercard_ and _AmericanExpress_, but you can choose to support only one, two or all three. By default the SDK is configured to support all three.
|
package/android/build.gradle
CHANGED
|
@@ -20,7 +20,7 @@ android {
|
|
|
20
20
|
minSdkVersion 21
|
|
21
21
|
targetSdkVersion 30
|
|
22
22
|
versionCode 1
|
|
23
|
-
versionName "1.
|
|
23
|
+
versionName "1.6.0"
|
|
24
24
|
}
|
|
25
25
|
lintOptions {
|
|
26
26
|
abortOnError false
|
|
@@ -39,7 +39,7 @@ repositories {
|
|
|
39
39
|
|
|
40
40
|
dependencies {
|
|
41
41
|
implementation 'com.facebook.react:react-native:+'
|
|
42
|
-
implementation 'com.github.FidelLimited:android-sdk:1.
|
|
42
|
+
implementation 'com.github.FidelLimited:android-sdk:1.7.0'
|
|
43
43
|
|
|
44
44
|
testImplementation 'junit:junit:4.13.2'
|
|
45
45
|
testImplementation 'androidx.test.ext:junit:1.1.2'
|
|
@@ -30,6 +30,7 @@ public final class FidelOptionsAdapter implements DataProcessor<ReadableMap>, Da
|
|
|
30
30
|
public static final String TERMS_CONDITIONS_URL_KEY = "termsConditionsUrl";
|
|
31
31
|
public static final String META_DATA_KEY = "metaData";
|
|
32
32
|
public static final String ALLOWED_COUNTRIES_KEY = "allowedCountries";
|
|
33
|
+
public static final String DEFAULT_SELECTED_COUNTRY_KEY = "defaultSelectedCountry";
|
|
33
34
|
public static final String CARD_SCHEMES_KEY = "supportedCardSchemes";
|
|
34
35
|
public static final List<String> OPTION_KEYS = Collections.unmodifiableList(
|
|
35
36
|
Arrays.asList(
|
|
@@ -89,6 +90,9 @@ public final class FidelOptionsAdapter implements DataProcessor<ReadableMap>, Da
|
|
|
89
90
|
if (valueIsValidFor(data, ALLOWED_COUNTRIES_KEY)) {
|
|
90
91
|
Fidel.allowedCountries = countryAdapter.parseAllowedCountries(data.getArray(ALLOWED_COUNTRIES_KEY));
|
|
91
92
|
}
|
|
93
|
+
if (valueIsValidFor(data, DEFAULT_SELECTED_COUNTRY_KEY)) {
|
|
94
|
+
Fidel.defaultSelectedCountry = countryAdapter.countryWithInteger(data.getInt(DEFAULT_SELECTED_COUNTRY_KEY));
|
|
95
|
+
}
|
|
92
96
|
if (data.hasKey(CARD_SCHEMES_KEY)) {
|
|
93
97
|
Fidel.supportedCardSchemes = cardSchemesAdapter.cardSchemesWithReadableArray(data.getArray(CARD_SCHEMES_KEY));
|
|
94
98
|
}
|
package/ios/FLRNOptionsAdapter.m
CHANGED
|
@@ -62,6 +62,11 @@ NSString *const kOptionKey = @"Option";
|
|
|
62
62
|
FLFidel.objc_allowedCountries = (NSArray<NSNumber *> *) rawData;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
if ([self valueIsValidFor:kDefaultSelectedCountryOptionKey fromDictionary:options]) {
|
|
66
|
+
id rawData = options[kDefaultSelectedCountryOptionKey];
|
|
67
|
+
FLFidel.defaultSelectedCountry = [((NSNumber *) rawData) integerValue];
|
|
68
|
+
}
|
|
69
|
+
|
|
65
70
|
if ([self valueIsValidFor:kAutoScanOptionKey fromDictionary:options]) {
|
|
66
71
|
FLFidel.autoScan = [options[kAutoScanOptionKey] boolValue];
|
|
67
72
|
}
|
package/ios/FLRNSDKOptions.h
CHANGED
|
@@ -10,14 +10,15 @@
|
|
|
10
10
|
|
|
11
11
|
typedef NS_ENUM(NSUInteger, FLSDKOption) {
|
|
12
12
|
FLSDKOptionBannerImage = 0,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
FLSDKOptionAllowedCountries = 1,
|
|
14
|
+
FLSDKOptionDefaultSelectedCountry = 2,
|
|
15
|
+
FLSDKOptionAutoScan = 3,
|
|
16
|
+
FLSDKOptionMetaData = 4,
|
|
17
|
+
FLSDKOptionCompanyName = 5,
|
|
18
|
+
FLSDKOptionProgramName = 6,
|
|
19
|
+
FLSDKOptionDeleteInstructions = 7,
|
|
20
|
+
FLSDKOptionPrivacyURL = 8,
|
|
21
|
+
FLSDKOptionTermsConditionsURL = 9,
|
|
22
|
+
FLSDKOptionCardSchemes = 10,
|
|
22
23
|
FLSDKOptionUnexistent = NSUIntegerMax
|
|
23
24
|
};
|
package/ios/RCTConvert+Options.h
CHANGED
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
#define FLSDKOptionValues\
|
|
21
21
|
@{\
|
|
22
22
|
kBannerImageOptionKey: @(FLSDKOptionBannerImage), \
|
|
23
|
-
kAllowedCountriesOptionKey: @(
|
|
23
|
+
kAllowedCountriesOptionKey: @(FLSDKOptionAllowedCountries), \
|
|
24
|
+
kDefaultSelectedCountryOptionKey: @(FLSDKOptionDefaultSelectedCountry), \
|
|
24
25
|
kAutoScanOptionKey: @(FLSDKOptionAutoScan),\
|
|
25
26
|
kMetaDataOptionKey: @(FLSDKOptionMetaData), \
|
|
26
27
|
kCompanyNameOptionKey: @(FLSDKOptionCompanyName), \
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
|
|
34
35
|
FOUNDATION_EXPORT NSString *const kBannerImageOptionKey;
|
|
35
36
|
FOUNDATION_EXPORT NSString *const kAllowedCountriesOptionKey;
|
|
37
|
+
FOUNDATION_EXPORT NSString *const kDefaultSelectedCountryOptionKey;
|
|
36
38
|
FOUNDATION_EXPORT NSString *const kAutoScanOptionKey;
|
|
37
39
|
FOUNDATION_EXPORT NSString *const kMetaDataOptionKey;
|
|
38
40
|
FOUNDATION_EXPORT NSString *const kCompanyNameOptionKey;
|
package/ios/RCTConvert+Options.m
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
NSString *const kBannerImageOptionKey = @"bannerImage";
|
|
12
12
|
NSString *const kAllowedCountriesOptionKey = @"allowedCountries";
|
|
13
|
+
NSString *const kDefaultSelectedCountryOptionKey = @"defaultSelectedCountry";
|
|
13
14
|
NSString *const kAutoScanOptionKey = @"autoScan";
|
|
14
15
|
NSString *const kMetaDataOptionKey = @"metaData";
|
|
15
16
|
NSString *const kCompanyNameOptionKey = @"companyName";
|