Skip to content

Commit

Permalink
Merge pull request #11 from blinkcard/release/v2.6.0
Browse files Browse the repository at this point in the history
Release/v2.6.0
  • Loading branch information
krizaa authored Jul 18, 2022
2 parents c4e6a89 + 54812c9 commit ddb8d48
Show file tree
Hide file tree
Showing 23 changed files with 68 additions and 150 deletions.
4 changes: 2 additions & 2 deletions BlinkCard/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rootProject.allprojects {
repositories {
google()
jcenter()
maven { url 'http://maven.microblink.com' }
maven { url 'https://maven.microblink.com' }
}
}

Expand All @@ -34,7 +34,7 @@ android {
}

dependencies {
implementation('com.microblink:blinkcard:2.4.0@aar') {
implementation('com.microblink:blinkcard:2.6.0@aar') {
transitive = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public Recognizer<?> createRecognizer(JSONObject jsonObject) {
recognizer.setFullDocumentImageExtensionFactors(SerializationUtils.deserializeExtensionFactors(jsonObject.optJSONObject("fullDocumentImageExtensionFactors")));
recognizer.setPaddingEdge((float)jsonObject.optDouble("paddingEdge", 0.0));
recognizer.setReturnFullDocumentImage(jsonObject.optBoolean("returnFullDocumentImage", false));
recognizer.setSignResult(jsonObject.optBoolean("signResult", false));
return recognizer;
}

Expand All @@ -36,8 +35,6 @@ public JSONObject serializeResult(Recognizer<?> recognizer) {
jsonResult.put("cardNumberPrefix", result.getCardNumberPrefix());
jsonResult.put("cardNumberValid", result.isCardNumberValid());
jsonResult.put("cvv", result.getCvv());
jsonResult.put("digitalSignature", SerializationUtils.encodeByteArrayToBase64(result.getDigitalSignature()));
jsonResult.put("digitalSignatureVersion", (int)result.getDigitalSignatureVersion());
jsonResult.put("expiryDate", SerializationUtils.serializeDate(result.getExpiryDate()));
jsonResult.put("firstSideBlurred", result.isFirstSideBlurred());
jsonResult.put("firstSideFullDocumentImage", SerializationUtils.encodeImageBase64(result.getFirstSideFullDocumentImage()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public Recognizer<?> createRecognizer(JSONObject jsonObject) {
recognizer.setFullDocumentImageDpi(jsonObject.optInt("fullDocumentImageDpi", 250));
recognizer.setFullDocumentImageExtensionFactors(SerializationUtils.deserializeExtensionFactors(jsonObject.optJSONObject("fullDocumentImageExtensionFactors")));
recognizer.setReturnFullDocumentImage(jsonObject.optBoolean("returnFullDocumentImage", false));
recognizer.setSignResult(jsonObject.optBoolean("signResult", false));
return recognizer;
}

Expand All @@ -34,8 +33,6 @@ public JSONObject serializeResult(Recognizer<?> recognizer) {
SerializationUtils.addCommonRecognizerResultData(jsonResult, result);
jsonResult.put("cardNumber", result.getCardNumber());
jsonResult.put("cvv", result.getCvv());
jsonResult.put("digitalSignature", SerializationUtils.encodeByteArrayToBase64(result.getDigitalSignature()));
jsonResult.put("digitalSignatureVersion", (int)result.getDigitalSignatureVersion());
jsonResult.put("documentDataMatch", SerializationUtils.serializeEnum(result.getDocumentDataMatch()));
jsonResult.put("fullDocumentBackImage", SerializationUtils.encodeImageBase64(result.getFullDocumentBackImage()));
jsonResult.put("fullDocumentFrontImage", SerializationUtils.encodeImageBase64(result.getFullDocumentFrontImage()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public Recognizer<?> createRecognizer(JSONObject jsonObject) {
recognizer.setFullDocumentImageDpi(jsonObject.optInt("fullDocumentImageDpi", 250));
recognizer.setFullDocumentImageExtensionFactors(SerializationUtils.deserializeExtensionFactors(jsonObject.optJSONObject("fullDocumentImageExtensionFactors")));
recognizer.setReturnFullDocumentImage(jsonObject.optBoolean("returnFullDocumentImage", false));
recognizer.setSignResult(jsonObject.optBoolean("signResult", false));
return recognizer;
}

Expand All @@ -37,8 +36,6 @@ public JSONObject serializeResult(Recognizer<?> recognizer) {
SerializationUtils.addCommonRecognizerResultData(jsonResult, result);
jsonResult.put("cardNumber", result.getCardNumber());
jsonResult.put("cvv", result.getCvv());
jsonResult.put("digitalSignature", SerializationUtils.encodeByteArrayToBase64(result.getDigitalSignature()));
jsonResult.put("digitalSignatureVersion", (int)result.getDigitalSignatureVersion());
jsonResult.put("documentDataMatch", SerializationUtils.serializeEnum(result.getDocumentDataMatch()));
jsonResult.put("fullDocumentBackImage", SerializationUtils.encodeImageBase64(result.getFullDocumentBackImage()));
jsonResult.put("fullDocumentFrontImage", SerializationUtils.encodeImageBase64(result.getFullDocumentFrontImage()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ -(MBCRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer {
recognizer.returnFullDocumentImage = [(NSNumber *)returnFullDocumentImage boolValue];
}

}
{
id signResult = [jsonRecognizer valueForKey:@"signResult"];
if (signResult != nil) {
recognizer.signResult = [(NSNumber *)signResult boolValue];
}

}

return recognizer;
Expand All @@ -111,8 +104,6 @@ -(NSDictionary *) serializeResult {
[jsonResult setValue:self.result.cardNumberPrefix forKey:@"cardNumberPrefix"];
[jsonResult setValue:[NSNumber numberWithBool:self.result.cardNumberValid] forKey:@"cardNumberValid"];
[jsonResult setValue:self.result.cvv forKey:@"cvv"];
[jsonResult setValue:[self.result.digitalSignature base64EncodedStringWithOptions:0] forKey:@"digitalSignature"];
[jsonResult setValue:[NSNumber numberWithInteger:self.result.digitalSignatureVersion] forKey:@"digitalSignatureVersion"];
[jsonResult setValue:[MBCSerializationUtils serializeMBDateResult:self.result.expiryDate] forKey:@"expiryDate"];
[jsonResult setValue:[NSNumber numberWithBool:self.result.firstSideBlurred] forKey:@"firstSideBlurred"];
[jsonResult setValue:[MBCSerializationUtils encodeMBImage:self.result.firstSideFullDocumentImage] forKey:@"firstSideFullDocumentImage"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ -(MBCRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer {
recognizer.returnFullDocumentImage = [(NSNumber *)returnFullDocumentImage boolValue];
}

}
{
id signResult = [jsonRecognizer valueForKey:@"signResult"];
if (signResult != nil) {
recognizer.signResult = [(NSNumber *)signResult boolValue];
}

}

return recognizer;
Expand All @@ -109,8 +102,6 @@ -(NSDictionary *) serializeResult {
NSMutableDictionary* jsonResult = (NSMutableDictionary*)[super serializeResult];
[jsonResult setValue:self.result.cardNumber forKey:@"cardNumber"];
[jsonResult setValue:self.result.cvv forKey:@"cvv"];
[jsonResult setValue:[self.result.digitalSignature base64EncodedStringWithOptions:0] forKey:@"digitalSignature"];
[jsonResult setValue:[NSNumber numberWithInteger:self.result.digitalSignatureVersion] forKey:@"digitalSignatureVersion"];
[jsonResult setValue:[NSNumber numberWithInteger:(self.result.documentDataMatch)] forKey:@"documentDataMatch"];
[jsonResult setValue:[MBCSerializationUtils encodeMBImage:self.result.fullDocumentBackImage] forKey:@"fullDocumentBackImage"];
[jsonResult setValue:[MBCSerializationUtils encodeMBImage:self.result.fullDocumentFrontImage] forKey:@"fullDocumentFrontImage"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,6 @@ -(MBCRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer {
recognizer.returnFullDocumentImage = [(NSNumber *)returnFullDocumentImage boolValue];
}

}
{
id signResult = [jsonRecognizer valueForKey:@"signResult"];
if (signResult != nil) {
recognizer.signResult = [(NSNumber *)signResult boolValue];
}

}

return recognizer;
Expand All @@ -130,8 +123,6 @@ -(NSDictionary *) serializeResult {
NSMutableDictionary* jsonResult = (NSMutableDictionary*)[super serializeResult];
[jsonResult setValue:self.result.cardNumber forKey:@"cardNumber"];
[jsonResult setValue:self.result.cvv forKey:@"cvv"];
[jsonResult setValue:[self.result.digitalSignature base64EncodedStringWithOptions:0] forKey:@"digitalSignature"];
[jsonResult setValue:[NSNumber numberWithInteger:self.result.digitalSignatureVersion] forKey:@"digitalSignatureVersion"];
[jsonResult setValue:[NSNumber numberWithInteger:(self.result.documentDataMatch)] forKey:@"documentDataMatch"];
[jsonResult setValue:[MBCSerializationUtils encodeMBImage:self.result.fullDocumentBackImage] forKey:@"fullDocumentBackImage"];
[jsonResult setValue:[MBCSerializationUtils encodeMBImage:self.result.fullDocumentFrontImage] forKey:@"fullDocumentFrontImage"];
Expand Down
6 changes: 3 additions & 3 deletions BlinkCard/ios/blinkcard_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'blinkcard_flutter'
s.version = '2.4.2'
s.version = '2.6.0'
s.summary = 'Flutter plugin for BlinkCard, SDK for scanning and OCR of various credit cards.'
s.description = <<-DESC
Flutter plugin for BlinkCard, SDK for scanning and OCR of various credit cards.
Expand All @@ -16,9 +16,9 @@ Flutter plugin for BlinkCard, SDK for scanning and OCR of various credit cards.
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.platform = :ios, '9.0'
s.platform = :ios, '12.0'

s.dependency 'MBBlinkCard', '~> 2.4.0'
s.dependency 'MBBlinkCard', '~> 2.6.0'

# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
Expand Down
1 change: 0 additions & 1 deletion BlinkCard/lib/overlay_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ class OverlaySettings {
OverlaySettings(this.overlaySettingsType);

factory OverlaySettings.fromJson(Map<String, dynamic> json) => _$OverlaySettingsFromJson(json);

Map<String, dynamic> toJson() => _$OverlaySettingsToJson(this);
}
29 changes: 15 additions & 14 deletions BlinkCard/lib/overlays/blinkcard_overlays.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,24 @@ part 'blinkcard_overlays.g.dart';
/// BlinkCard overlay is best suited for scanning payment cards.
@JsonSerializable()
class BlinkCardOverlaySettings extends OverlaySettings {
/// String: user instructions that are shown above camera preview while the first side of the
/// document is being scanned.
/// If null, default value will be used.
String? firstSideInstructions;
/// String: user instructions that are shown above camera preview while the first side of the
/// document is being scanned.
/// If null, default value will be used.
String? firstSideInstructions;

/// String: user instructions that are shown above camera preview while the second side of the
/// document is being scanned.
/// If null, default value will be used.
String? flipCardInstructions;
/// String: user instructions that are shown above camera preview while the second side of the
/// document is being scanned.
/// If null, default value will be used.
String? flipCardInstructions;

/// Defines whether glare warning will be displayed when user turn on a flashlight
/// Default true
bool showFlashlightWarning = true;
/// Defines whether glare warning will be displayed when user turn on a flashlight
/// Default true
bool showFlashlightWarning = true;

BlinkCardOverlaySettings(): super('BlinkCardOverlaySettings');
BlinkCardOverlaySettings() : super('BlinkCardOverlaySettings');

factory BlinkCardOverlaySettings.fromJson(Map<String, dynamic> json) => _$BlinkCardOverlaySettingsFromJson(json);
factory BlinkCardOverlaySettings.fromJson(Map<String, dynamic> json) =>
_$BlinkCardOverlaySettingsFromJson(json);

Map<String, dynamic> toJson() => _$BlinkCardOverlaySettingsToJson(this);
Map<String, dynamic> toJson() => _$BlinkCardOverlaySettingsToJson(this);
}
3 changes: 0 additions & 3 deletions BlinkCard/lib/recognizer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class Recognizer {
}

factory Recognizer.fromJson(Map<String, dynamic> json) => _$RecognizerFromJson(json);

Map<String, dynamic> toJson() => _$RecognizerToJson(this);
}

Expand All @@ -48,7 +47,6 @@ class RecognizerResult {
RecognizerResult(this.resultState);

factory RecognizerResult.fromJson(Map<String, dynamic> json) => _$RecognizerResultFromJson(json);

Map<String, dynamic> toJson() => _$RecognizerResultToJson(this);
}

Expand All @@ -64,6 +62,5 @@ class RecognizerCollection {
RecognizerCollection(this.recognizerArray);

factory RecognizerCollection.fromJson(Map<String, dynamic> json) => _$RecognizerCollectionFromJson(json);

Map<String, dynamic> toJson() => _$RecognizerCollectionToJson(this);
}
16 changes: 0 additions & 16 deletions BlinkCard/lib/recognizers/blink_card_recognizer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ class BlinkCardRecognizerResult extends RecognizerResult {
/// Payment card's security code/value.
String? cvv;

///Digital signature of the recognition result. Available only if enabled with signResult property.
String? digitalSignature;

///Version of the digital signature. Available only if enabled with signResult property.
int? digitalSignatureVersion;

///The payment card's expiry date.
Date? expiryDate;

Expand Down Expand Up @@ -66,10 +60,6 @@ class BlinkCardRecognizerResult extends RecognizerResult {

this.cvv = nativeResult["cvv"];

this.digitalSignature = nativeResult["digitalSignature"];

this.digitalSignatureVersion = nativeResult["digitalSignatureVersion"];

this.expiryDate = nativeResult["expiryDate"] != null ? Date(Map<String, dynamic>.from(nativeResult["expiryDate"])) : null;

this.firstSideBlurred = nativeResult["firstSideBlurred"];
Expand Down Expand Up @@ -152,18 +142,12 @@ class BlinkCardRecognizer extends Recognizer {
///
bool returnFullDocumentImage = false;

///Whether or not recognition result should be signed.
///
///
bool signResult = false;

BlinkCardRecognizer(): super('BlinkCardRecognizer');

RecognizerResult createResultFromNative(Map<String, dynamic> nativeResult) {
return BlinkCardRecognizerResult(nativeResult);
}

factory BlinkCardRecognizer.fromJson(Map<String, dynamic> json) => _$BlinkCardRecognizerFromJson(json);

Map<String, dynamic> toJson() => _$BlinkCardRecognizerToJson(this);
}
4 changes: 1 addition & 3 deletions BlinkCard/lib/recognizers/blink_card_recognizer.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions BlinkCard/lib/recognizers/legacy_blink_card_elite_recognizer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ class LegacyBlinkCardEliteRecognizerResult extends RecognizerResult {
/// Payment card's security code/value
String? cvv;

///Digital signature of the recognition result. Available only if enabled with signResult property.
String? digitalSignature;

///Version of the digital signature. Available only if enabled with signResult property.
int? digitalSignatureVersion;

///Returns CDataMatchResultSuccess if data from scanned parts/sides of the document match,
/// CDataMatchResultFailed otherwise. For example if date of expiry is scanned from the front and back side
/// of the document and values do not match, this method will return CDataMatchResultFailed. Result will
Expand Down Expand Up @@ -50,10 +44,6 @@ class LegacyBlinkCardEliteRecognizerResult extends RecognizerResult {

this.cvv = nativeResult["cvv"];

this.digitalSignature = nativeResult["digitalSignature"];

this.digitalSignatureVersion = nativeResult["digitalSignatureVersion"];

this.documentDataMatch = DataMatchResult.values[nativeResult["documentDataMatch"]];

this.fullDocumentBackImage = nativeResult["fullDocumentBackImage"];
Expand Down Expand Up @@ -128,18 +118,12 @@ class LegacyBlinkCardEliteRecognizer extends Recognizer {
///
bool returnFullDocumentImage = false;

///Whether or not recognition result should be signed.
///
///
bool signResult = false;

LegacyBlinkCardEliteRecognizer(): super('LegacyBlinkCardEliteRecognizer');

RecognizerResult createResultFromNative(Map<String, dynamic> nativeResult) {
return LegacyBlinkCardEliteRecognizerResult(nativeResult);
}

factory LegacyBlinkCardEliteRecognizer.fromJson(Map<String, dynamic> json) => _$LegacyBlinkCardEliteRecognizerFromJson(json);

Map<String, dynamic> toJson() => _$LegacyBlinkCardEliteRecognizerToJson(this);
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions BlinkCard/lib/recognizers/legacy_blink_card_recognizer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ class LegacyBlinkCardRecognizerResult extends RecognizerResult {
/// Payment card's security code/value
String? cvv;

///Digital signature of the recognition result. Available only if enabled with signResult property.
String? digitalSignature;

///Version of the digital signature. Available only if enabled with signResult property.
int? digitalSignatureVersion;

///Returns CDataMatchResultSuccess if data from scanned parts/sides of the document match,
/// CDataMatchResultFailed otherwise. For example if date of expiry is scanned from the front and back side
/// of the document and values do not match, this method will return CDataMatchResultFailed. Result will
Expand Down Expand Up @@ -56,10 +50,6 @@ class LegacyBlinkCardRecognizerResult extends RecognizerResult {

this.cvv = nativeResult["cvv"];

this.digitalSignature = nativeResult["digitalSignature"];

this.digitalSignatureVersion = nativeResult["digitalSignatureVersion"];

this.documentDataMatch = DataMatchResult.values[nativeResult["documentDataMatch"]];

this.fullDocumentBackImage = nativeResult["fullDocumentBackImage"];
Expand Down Expand Up @@ -153,18 +143,12 @@ class LegacyBlinkCardRecognizer extends Recognizer {
///
bool returnFullDocumentImage = false;

///Whether or not recognition result should be signed.
///
///
bool signResult = false;

LegacyBlinkCardRecognizer(): super('LegacyBlinkCardRecognizer');

RecognizerResult createResultFromNative(Map<String, dynamic> nativeResult) {
return LegacyBlinkCardRecognizerResult(nativeResult);
}

factory LegacyBlinkCardRecognizer.fromJson(Map<String, dynamic> json) => _$LegacyBlinkCardRecognizerFromJson(json);

Map<String, dynamic> toJson() => _$LegacyBlinkCardRecognizerToJson(this);
}
Loading

0 comments on commit ddb8d48

Please sign in to comment.