From b4e7c8d05c4ef46a3ba4740ccc53df1c93147b43 Mon Sep 17 00:00:00 2001 From: Matija Krizanec Date: Wed, 13 Jul 2022 16:11:35 +0200 Subject: [PATCH 1/4] [Android] generate bindings --- .../BlinkCardRecognizerSerialization.java | 3 - ...BlinkCardEliteRecognizerSerialization.java | 3 - ...egacyBlinkCardRecognizerSerialization.java | 3 - BlinkCard/lib/overlay_settings.dart | 1 - .../lib/overlays/blinkcard_overlays.dart | 29 +++---- BlinkCard/lib/recognizer.dart | 3 - .../recognizers/blink_card_recognizer.dart | 73 ++++------------- .../recognizers/blink_card_recognizer.g.dart | 4 +- .../legacy_blink_card_elite_recognizer.dart | 66 +++------------ .../legacy_blink_card_elite_recognizer.g.dart | 4 +- .../legacy_blink_card_recognizer.dart | 80 ++++--------------- .../legacy_blink_card_recognizer.g.dart | 4 +- .../success_frame_grabber_recognizer.dart | 56 ++++++------- BlinkCard/lib/types.dart | 3 - 14 files changed, 91 insertions(+), 241 deletions(-) diff --git a/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/recognizers/serialization/BlinkCardRecognizerSerialization.java b/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/recognizers/serialization/BlinkCardRecognizerSerialization.java index 9066523..0ef3889 100644 --- a/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/recognizers/serialization/BlinkCardRecognizerSerialization.java +++ b/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/recognizers/serialization/BlinkCardRecognizerSerialization.java @@ -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; } @@ -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())); diff --git a/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/recognizers/serialization/LegacyBlinkCardEliteRecognizerSerialization.java b/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/recognizers/serialization/LegacyBlinkCardEliteRecognizerSerialization.java index cf3477c..107cef1 100644 --- a/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/recognizers/serialization/LegacyBlinkCardEliteRecognizerSerialization.java +++ b/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/recognizers/serialization/LegacyBlinkCardEliteRecognizerSerialization.java @@ -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; } @@ -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())); diff --git a/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/recognizers/serialization/LegacyBlinkCardRecognizerSerialization.java b/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/recognizers/serialization/LegacyBlinkCardRecognizerSerialization.java index e9b6b98..55c71b6 100644 --- a/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/recognizers/serialization/LegacyBlinkCardRecognizerSerialization.java +++ b/BlinkCard/android/src/main/java/com/microblink/blinkcard/flutter/recognizers/serialization/LegacyBlinkCardRecognizerSerialization.java @@ -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; } @@ -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())); diff --git a/BlinkCard/lib/overlay_settings.dart b/BlinkCard/lib/overlay_settings.dart index 4f28ef3..8f96457 100644 --- a/BlinkCard/lib/overlay_settings.dart +++ b/BlinkCard/lib/overlay_settings.dart @@ -28,6 +28,5 @@ class OverlaySettings { OverlaySettings(this.overlaySettingsType); factory OverlaySettings.fromJson(Map json) => _$OverlaySettingsFromJson(json); - Map toJson() => _$OverlaySettingsToJson(this); } \ No newline at end of file diff --git a/BlinkCard/lib/overlays/blinkcard_overlays.dart b/BlinkCard/lib/overlays/blinkcard_overlays.dart index 0578236..fc4705f 100644 --- a/BlinkCard/lib/overlays/blinkcard_overlays.dart +++ b/BlinkCard/lib/overlays/blinkcard_overlays.dart @@ -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 json) => _$BlinkCardOverlaySettingsFromJson(json); + factory BlinkCardOverlaySettings.fromJson(Map json) => + _$BlinkCardOverlaySettingsFromJson(json); - Map toJson() => _$BlinkCardOverlaySettingsToJson(this); + Map toJson() => _$BlinkCardOverlaySettingsToJson(this); } diff --git a/BlinkCard/lib/recognizer.dart b/BlinkCard/lib/recognizer.dart index c1ecb33..62f21d8 100644 --- a/BlinkCard/lib/recognizer.dart +++ b/BlinkCard/lib/recognizer.dart @@ -22,7 +22,6 @@ class Recognizer { } factory Recognizer.fromJson(Map json) => _$RecognizerFromJson(json); - Map toJson() => _$RecognizerToJson(this); } @@ -48,7 +47,6 @@ class RecognizerResult { RecognizerResult(this.resultState); factory RecognizerResult.fromJson(Map json) => _$RecognizerResultFromJson(json); - Map toJson() => _$RecognizerResultToJson(this); } @@ -64,6 +62,5 @@ class RecognizerCollection { RecognizerCollection(this.recognizerArray); factory RecognizerCollection.fromJson(Map json) => _$RecognizerCollectionFromJson(json); - Map toJson() => _$RecognizerCollectionToJson(this); } \ No newline at end of file diff --git a/BlinkCard/lib/recognizers/blink_card_recognizer.dart b/BlinkCard/lib/recognizers/blink_card_recognizer.dart index a955179..d2707f1 100644 --- a/BlinkCard/lib/recognizers/blink_card_recognizer.dart +++ b/BlinkCard/lib/recognizers/blink_card_recognizer.dart @@ -13,22 +13,16 @@ class BlinkCardRecognizerResult extends RecognizerResult { ///The payment card number prefix. String? cardNumberPrefix; - ///The payment card number is valid + ///Flag which indicatew whether the payment card number is valid or not. bool? cardNumberValid; - /// Payment card's security code/value. + ///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; - ///Wheater the first scanned side is blurred. + ///Whether the first scanned side is blurred. bool? firstSideBlurred; ///Full image of the payment card from first side recognition. @@ -40,17 +34,16 @@ class BlinkCardRecognizerResult extends RecognizerResult { ///Payment card's issuing network. Issuer? issuer; - ///Information about the payment card owner (name, company, etc.). + ///Information about the payment card owner. String? owner; ///Status of the last recognition process. BlinkCardProcessingStatus? processingStatus; - ///Returns true if recognizer has finished scanning first side and is now scanning back side, - /// false if it's still scanning first side. + ///{true} if recognizer has finished scanning first side and is now scanning back side, bool? scanningFirstSideDone; - ///Wheater the second scanned side is blurred. + ///Whether the second scanned side is blurred. bool? secondSideBlurred; ///Full image of the payment card from second side recognition. @@ -66,10 +59,6 @@ class BlinkCardRecognizerResult extends RecognizerResult { this.cvv = nativeResult["cvv"]; - this.digitalSignature = nativeResult["digitalSignature"]; - - this.digitalSignatureVersion = nativeResult["digitalSignatureVersion"]; - this.expiryDate = nativeResult["expiryDate"] != null ? Date(Map.from(nativeResult["expiryDate"])) : null; this.firstSideBlurred = nativeResult["firstSideBlurred"]; @@ -94,69 +83,40 @@ class BlinkCardRecognizerResult extends RecognizerResult { } -///Recognizer used for scanning credit/debit cards. +///Recognizer used for scanning both sides of payment cards. @JsonSerializable() class BlinkCardRecognizer extends Recognizer { - ///Defines whether blured frames filtering is allowed - /// - /// + ///Whether blured frames filtering is allowed. bool allowBlurFilter = true; - ///Defines whether sensitive data should be redacted from the result. - /// - /// + ///The settings which control the anonymization of returned data. BlinkCardAnonymizationSettings anonymizationSettings = BlinkCardAnonymizationSettings(); - ///Should extract CVV - /// - /// + ///Should extract the card CVV bool extractCvv = true; - ///Should extract the payment card's month of expiry - /// - /// + ///Should extract the payment card's expiry date. bool extractExpiryDate = true; - ///Should extract the payment card's IBAN - /// - /// + ///Should extract the card IBAN bool extractIban = true; ///Should extract the card owner information - /// - /// bool extractOwner = true; - ///Property for setting DPI for full document images - /// Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - /// - /// + ///The DPI (Dots Per Inch) for full document image that should be returned. int fullDocumentImageDpi = 250; - ///Image extension factors for full document image. - /// - /// @see CImageExtensionFactors - /// + ///The extension factors for full document image. ImageExtensionFactors fullDocumentImageExtensionFactors = ImageExtensionFactors(); - ///Pading is a minimum distance from the edge of the frame and is defined as a percentage of the frame width. Default value is 0.0f and in that case - /// padding edge and image edge are the same. - /// Recommended value is 0.02f. - /// - /// + ///Padding is a minimum distance from the edge of the frame and it is defined as a percentage double paddingEdge = 0.0; - ///Sets whether full document image of ID card should be extracted. - /// - /// + ///Defines whether full document image will be available in bool returnFullDocumentImage = false; - ///Whether or not recognition result should be signed. - /// - /// - bool signResult = false; - BlinkCardRecognizer(): super('BlinkCardRecognizer'); RecognizerResult createResultFromNative(Map nativeResult) { @@ -164,6 +124,5 @@ class BlinkCardRecognizer extends Recognizer { } factory BlinkCardRecognizer.fromJson(Map json) => _$BlinkCardRecognizerFromJson(json); - Map toJson() => _$BlinkCardRecognizerToJson(this); } \ No newline at end of file diff --git a/BlinkCard/lib/recognizers/blink_card_recognizer.g.dart b/BlinkCard/lib/recognizers/blink_card_recognizer.g.dart index d85fb41..7f7f3bc 100644 --- a/BlinkCard/lib/recognizers/blink_card_recognizer.g.dart +++ b/BlinkCard/lib/recognizers/blink_card_recognizer.g.dart @@ -20,8 +20,7 @@ BlinkCardRecognizer _$BlinkCardRecognizerFromJson(Map json) { ..fullDocumentImageExtensionFactors = ImageExtensionFactors.fromJson( json['fullDocumentImageExtensionFactors'] as Map) ..paddingEdge = (json['paddingEdge'] as num).toDouble() - ..returnFullDocumentImage = json['returnFullDocumentImage'] as bool - ..signResult = json['signResult'] as bool; + ..returnFullDocumentImage = json['returnFullDocumentImage'] as bool; } Map _$BlinkCardRecognizerToJson( @@ -39,5 +38,4 @@ Map _$BlinkCardRecognizerToJson( instance.fullDocumentImageExtensionFactors, 'paddingEdge': instance.paddingEdge, 'returnFullDocumentImage': instance.returnFullDocumentImage, - 'signResult': instance.signResult, }; diff --git a/BlinkCard/lib/recognizers/legacy_blink_card_elite_recognizer.dart b/BlinkCard/lib/recognizers/legacy_blink_card_elite_recognizer.dart index e142769..f9c76aa 100644 --- a/BlinkCard/lib/recognizers/legacy_blink_card_elite_recognizer.dart +++ b/BlinkCard/lib/recognizers/legacy_blink_card_elite_recognizer.dart @@ -10,35 +10,25 @@ class LegacyBlinkCardEliteRecognizerResult extends RecognizerResult { ///The payment card number. String? cardNumber; - /// Payment card's security code/value + ///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 - /// be CDataMatchResultSuccess only if scanned values for all fields that are compared are the same. + ///Defines result of the data matching algorithm for scanned parts/sides of the document. DataMatchResult? documentDataMatch; - ///back side image of the document if enabled with returnFullDocumentImage property. + ///Back side image of the document String? fullDocumentBackImage; - ///front side image of the document if enabled with returnFullDocumentImage property. + ///Front side image of the document String? fullDocumentFrontImage; ///Payment card's inventory number. String? inventoryNumber; - ///Information about the payment card owner (name, company, etc.). + ///Information about the payment card owner (name, company, etc.) String? owner; - ///Returns true if recognizer has finished scanning first side and is now scanning back side, - /// false if it's still scanning first side. + ///{true} if recognizer has finished scanning first side and is now scanning back side, bool? scanningFirstSideDone; ///The payment card's last month of validity. @@ -50,10 +40,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"]; @@ -72,67 +58,40 @@ class LegacyBlinkCardEliteRecognizerResult extends RecognizerResult { } -///Recognizer used for scanning the front side of elite credit/debit cards. +///Recognizer used for scanning both sides of elite payment cards. @JsonSerializable() class LegacyBlinkCardEliteRecognizer extends Recognizer { ///Should anonymize the card number area (redact image pixels) on the document image result - /// - /// bool anonymizeCardNumber = false; - ///Should anonymize the CVV on the document image result - /// - /// + ///Should anonymize the CVV area (redact image pixels) on the document image result bool anonymizeCvv = false; ///Should anonymize the owner area (redact image pixels) on the document image result - /// - /// bool anonymizeOwner = false; - ///Defines if glare detection should be turned on/off. - /// - /// + ///Defines whether glare detector is enabled. bool detectGlare = true; ///Should extract the card's inventory number - /// - /// bool extractInventoryNumber = true; ///Should extract the card owner information - /// - /// bool extractOwner = true; ///Should extract the payment card's month of expiry - /// - /// bool extractValidThru = true; - ///Property for setting DPI for full document images - /// Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - /// - /// + ///The DPI (Dots Per Inch) for full document image that should be returned. int fullDocumentImageDpi = 250; - ///Image extension factors for full document image. - /// - /// @see CImageExtensionFactors - /// + ///The extension factors for full document image. ImageExtensionFactors fullDocumentImageExtensionFactors = ImageExtensionFactors(); - ///Sets whether full document image of ID card should be extracted. - /// - /// + ///Defines whether full document image will be available in bool returnFullDocumentImage = false; - ///Whether or not recognition result should be signed. - /// - /// - bool signResult = false; - LegacyBlinkCardEliteRecognizer(): super('LegacyBlinkCardEliteRecognizer'); RecognizerResult createResultFromNative(Map nativeResult) { @@ -140,6 +99,5 @@ class LegacyBlinkCardEliteRecognizer extends Recognizer { } factory LegacyBlinkCardEliteRecognizer.fromJson(Map json) => _$LegacyBlinkCardEliteRecognizerFromJson(json); - Map toJson() => _$LegacyBlinkCardEliteRecognizerToJson(this); } \ No newline at end of file diff --git a/BlinkCard/lib/recognizers/legacy_blink_card_elite_recognizer.g.dart b/BlinkCard/lib/recognizers/legacy_blink_card_elite_recognizer.g.dart index 5a84df2..2f2a60c 100644 --- a/BlinkCard/lib/recognizers/legacy_blink_card_elite_recognizer.g.dart +++ b/BlinkCard/lib/recognizers/legacy_blink_card_elite_recognizer.g.dart @@ -20,8 +20,7 @@ LegacyBlinkCardEliteRecognizer _$LegacyBlinkCardEliteRecognizerFromJson( ..fullDocumentImageDpi = json['fullDocumentImageDpi'] as int ..fullDocumentImageExtensionFactors = ImageExtensionFactors.fromJson( json['fullDocumentImageExtensionFactors'] as Map) - ..returnFullDocumentImage = json['returnFullDocumentImage'] as bool - ..signResult = json['signResult'] as bool; + ..returnFullDocumentImage = json['returnFullDocumentImage'] as bool; } Map _$LegacyBlinkCardEliteRecognizerToJson( @@ -39,5 +38,4 @@ Map _$LegacyBlinkCardEliteRecognizerToJson( 'fullDocumentImageExtensionFactors': instance.fullDocumentImageExtensionFactors, 'returnFullDocumentImage': instance.returnFullDocumentImage, - 'signResult': instance.signResult, }; diff --git a/BlinkCard/lib/recognizers/legacy_blink_card_recognizer.dart b/BlinkCard/lib/recognizers/legacy_blink_card_recognizer.dart index b86bba5..2a47b04 100644 --- a/BlinkCard/lib/recognizers/legacy_blink_card_recognizer.dart +++ b/BlinkCard/lib/recognizers/legacy_blink_card_recognizer.dart @@ -10,41 +10,31 @@ class LegacyBlinkCardRecognizerResult extends RecognizerResult { ///The payment card number. String? cardNumber; - /// Payment card's security code/value + ///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 - /// be CDataMatchResultSuccess only if scanned values for all fields that are compared are the same. + ///Defines result of the data matching algorithm for scanned parts/sides of the document. DataMatchResult? documentDataMatch; - ///back side image of the document if enabled with returnFullDocumentImage property. + ///Back side image of the document String? fullDocumentBackImage; - ///front side image of the document if enabled with returnFullDocumentImage property. + ///Front side image of the document String? fullDocumentFrontImage; - ///Payment card's IBAN + ///Payment card's IBAN. String? iban; ///Payment card's inventory number. String? inventoryNumber; - ///Payment card's issuing network + ///The payment card's issuing network. LegacyCardIssuer? issuer; - ///Information about the payment card owner (name, company, etc.). + ///Information about the payment card owner (name, company, etc.) String? owner; - ///Returns true if recognizer has finished scanning first side and is now scanning back side, - /// false if it's still scanning first side. + ///{true} if recognizer has finished scanning first side and is now scanning back side, bool? scanningFirstSideDone; ///The payment card's last month of validity. @@ -56,10 +46,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"]; @@ -82,82 +68,49 @@ class LegacyBlinkCardRecognizerResult extends RecognizerResult { } -///Recognizer used for scanning the front side of credit/debit cards. +///Recognizer used for scanning both sides of payment cards. @JsonSerializable() class LegacyBlinkCardRecognizer extends Recognizer { ///Should anonymize the card number area (redact image pixels) on the document image result - /// - /// bool anonymizeCardNumber = false; - ///Should anonymize the CVV on the document image result - /// - /// + ///Should anonymize the CVV area (redact image pixels) on the document image result bool anonymizeCvv = false; ///Should anonymize the IBAN area (redact image pixels) on the document image result - /// - /// bool anonymizeIban = false; ///Should anonymize the owner area (redact image pixels) on the document image result - /// - /// bool anonymizeOwner = false; - ///Defines if glare detection should be turned on/off. - /// - /// + ///Defines whether glare detector is enabled. bool detectGlare = true; - ///Should extract CVV - /// - /// + ///Should extract the card CVV bool extractCvv = true; - ///Should extract the payment card's IBAN - /// - /// + ///Should extract the card IBAN bool extractIban = false; ///Should extract the card's inventory number - /// - /// bool extractInventoryNumber = true; ///Should extract the card owner information - /// - /// bool extractOwner = false; ///Should extract the payment card's month of expiry - /// - /// bool extractValidThru = true; - ///Property for setting DPI for full document images - /// Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - /// - /// + ///The DPI (Dots Per Inch) for full document image that should be returned. int fullDocumentImageDpi = 250; - ///Image extension factors for full document image. - /// - /// @see CImageExtensionFactors - /// + ///The extension factors for full document image. ImageExtensionFactors fullDocumentImageExtensionFactors = ImageExtensionFactors(); - ///Sets whether full document image of ID card should be extracted. - /// - /// + ///Defines whether full document image will be available in bool returnFullDocumentImage = false; - ///Whether or not recognition result should be signed. - /// - /// - bool signResult = false; - LegacyBlinkCardRecognizer(): super('LegacyBlinkCardRecognizer'); RecognizerResult createResultFromNative(Map nativeResult) { @@ -165,6 +118,5 @@ class LegacyBlinkCardRecognizer extends Recognizer { } factory LegacyBlinkCardRecognizer.fromJson(Map json) => _$LegacyBlinkCardRecognizerFromJson(json); - Map toJson() => _$LegacyBlinkCardRecognizerToJson(this); } \ No newline at end of file diff --git a/BlinkCard/lib/recognizers/legacy_blink_card_recognizer.g.dart b/BlinkCard/lib/recognizers/legacy_blink_card_recognizer.g.dart index 81bb851..50fad52 100644 --- a/BlinkCard/lib/recognizers/legacy_blink_card_recognizer.g.dart +++ b/BlinkCard/lib/recognizers/legacy_blink_card_recognizer.g.dart @@ -23,8 +23,7 @@ LegacyBlinkCardRecognizer _$LegacyBlinkCardRecognizerFromJson( ..fullDocumentImageDpi = json['fullDocumentImageDpi'] as int ..fullDocumentImageExtensionFactors = ImageExtensionFactors.fromJson( json['fullDocumentImageExtensionFactors'] as Map) - ..returnFullDocumentImage = json['returnFullDocumentImage'] as bool - ..signResult = json['signResult'] as bool; + ..returnFullDocumentImage = json['returnFullDocumentImage'] as bool; } Map _$LegacyBlinkCardRecognizerToJson( @@ -45,5 +44,4 @@ Map _$LegacyBlinkCardRecognizerToJson( 'fullDocumentImageExtensionFactors': instance.fullDocumentImageExtensionFactors, 'returnFullDocumentImage': instance.returnFullDocumentImage, - 'signResult': instance.signResult, }; diff --git a/BlinkCard/lib/recognizers/success_frame_grabber_recognizer.dart b/BlinkCard/lib/recognizers/success_frame_grabber_recognizer.dart index e6f2851..1908662 100644 --- a/BlinkCard/lib/recognizers/success_frame_grabber_recognizer.dart +++ b/BlinkCard/lib/recognizers/success_frame_grabber_recognizer.dart @@ -5,39 +5,41 @@ part 'success_frame_grabber_recognizer.g.dart'; /// Result object for SuccessFrameGrabberRecognizer. class SuccessFrameGrabberRecognizerResult extends RecognizerResult { - - /// Camera frame at the time slave recognizer finished recognition - String? successFrame; - - /// RecognizerResult of the slave recognizer - RecognizerResult slaveRecognizerResult; - - SuccessFrameGrabberRecognizerResult(Map nativeResult, this.slaveRecognizerResult): super(RecognizerResultState.values[nativeResult['resultState']]) { - - /// Camera frame at the time slave recognizer finished recognition - this.successFrame = nativeResult['successFrame']; - } + /// Camera frame at the time slave recognizer finished recognition + String? successFrame; + + /// RecognizerResult of the slave recognizer + RecognizerResult slaveRecognizerResult; + + SuccessFrameGrabberRecognizerResult( + Map nativeResult, this.slaveRecognizerResult) + : super(RecognizerResultState.values[nativeResult['resultState']]) { + /// Camera frame at the time slave recognizer finished recognition + this.successFrame = nativeResult['successFrame']; + } } /// SuccessFrameGrabberRecognizer can wrap any other recognizer and obtain camera /// frame on which the other recognizer finished recognition. @JsonSerializable() class SuccessFrameGrabberRecognizer extends Recognizer { + Recognizer slaveRecognizer; - Recognizer slaveRecognizer; - - SuccessFrameGrabberRecognizer(this.slaveRecognizer): super('SuccessFrameGrabberRecognizer') { - - if (!(this.slaveRecognizer is Recognizer)) { - throw Exception("Slave recognizer must be Recognizer!"); - } - } - - RecognizerResult createResultFromNative(Map nativeResult) { - return SuccessFrameGrabberRecognizerResult(nativeResult, this.slaveRecognizer.createResultFromNative(Map.from(nativeResult['slaveRecognizerResult']))); + SuccessFrameGrabberRecognizer(this.slaveRecognizer) + : super('SuccessFrameGrabberRecognizer') { + if (!(this.slaveRecognizer is Recognizer)) { + throw Exception("Slave recognizer must be Recognizer!"); } - - factory SuccessFrameGrabberRecognizer.fromJson(Map json) => _$SuccessFrameGrabberRecognizerFromJson(json); - - Map toJson() => _$SuccessFrameGrabberRecognizerToJson(this); + } + + RecognizerResult createResultFromNative(Map nativeResult) { + return SuccessFrameGrabberRecognizerResult( + nativeResult, + this.slaveRecognizer.createResultFromNative( + Map.from(nativeResult['slaveRecognizerResult']))); + } + + factory SuccessFrameGrabberRecognizer.fromJson(Map json) => + _$SuccessFrameGrabberRecognizerFromJson(json); + Map toJson() => _$SuccessFrameGrabberRecognizerToJson(this); } diff --git a/BlinkCard/lib/types.dart b/BlinkCard/lib/types.dart index 32733e9..4ec7dbf 100644 --- a/BlinkCard/lib/types.dart +++ b/BlinkCard/lib/types.dart @@ -187,7 +187,6 @@ class CardNumberAnonymizationSettings { CardNumberAnonymizationSettings(); factory CardNumberAnonymizationSettings.fromJson(Map json) => _$CardNumberAnonymizationSettingsFromJson(json); - Map toJson() => _$CardNumberAnonymizationSettingsToJson(this); } @@ -209,7 +208,6 @@ class BlinkCardAnonymizationSettings { BlinkCardAnonymizationSettings(); factory BlinkCardAnonymizationSettings.fromJson(Map json) => _$BlinkCardAnonymizationSettingsFromJson(json); - Map toJson() => _$BlinkCardAnonymizationSettingsToJson(this); } @@ -232,7 +230,6 @@ class ImageExtensionFactors { ImageExtensionFactors(); factory ImageExtensionFactors.fromJson(Map json) => _$ImageExtensionFactorsFromJson(json); - Map toJson() => _$ImageExtensionFactorsToJson(this); } From b5b7fefeffad8f531be7a823d7cad65039c6dcb1 Mon Sep 17 00:00:00 2001 From: Matija Krizanec Date: Wed, 13 Jul 2022 16:16:25 +0200 Subject: [PATCH 2/4] update version, release notes, Android version and license --- BlinkCard/android/build.gradle | 4 ++-- BlinkCard/pubspec.yaml | 2 +- Release notes.md | 4 ++++ initFlutterSample.sh | 5 +++++ sample_files/main.dart | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/BlinkCard/android/build.gradle b/BlinkCard/android/build.gradle index 919e860..4ad0d99 100644 --- a/BlinkCard/android/build.gradle +++ b/BlinkCard/android/build.gradle @@ -16,7 +16,7 @@ rootProject.allprojects { repositories { google() jcenter() - maven { url 'http://maven.microblink.com' } + maven { url 'https://maven.microblink.com' } } } @@ -34,7 +34,7 @@ android { } dependencies { - implementation('com.microblink:blinkcard:2.4.0@aar') { + implementation('com.microblink:blinkcard:2.6.0@aar') { transitive = true } } diff --git a/BlinkCard/pubspec.yaml b/BlinkCard/pubspec.yaml index cf046b1..40755f0 100644 --- a/BlinkCard/pubspec.yaml +++ b/BlinkCard/pubspec.yaml @@ -1,6 +1,6 @@ name: blinkcard_flutter description: Flutter plugin for BlinkCard, SDK for scanning and OCR of various credit cards. -version: 2.4.2 +version: 2.6.0 author: Microblink homepage: https://microblink.com diff --git a/Release notes.md b/Release notes.md index 0c1db33..4d24eee 100644 --- a/Release notes.md +++ b/Release notes.md @@ -1,3 +1,7 @@ +## 2.6.0 + +- Updated to [Android SDK v2.6.0](https://github.com/BlinkCard/blinkcard-android/releases/tag/v2.6.0) and [iOS SDK v2.6.0](https://github.com/BlinkCard/blinkcard-ios/releases/tag/v2.6.0) + ## 2.4.2 - Hotfix - change channel name diff --git a/initFlutterSample.sh b/initFlutterSample.sh index 23487f7..6e3ca44 100755 --- a/initFlutterSample.sh +++ b/initFlutterSample.sh @@ -52,6 +52,11 @@ popd cp ../sample_files/main.dart lib/ +#update compile and target sdk versions to 31, add android:exported="true" to manifest +sed -i '' 's#compileSdkVersion 30#compileSdkVersion 31#g' ./android/app/build.gradle +sed -i '' 's#targetSdkVersion 30#targetSdkVersion 31#g' ./android/app/build.gradle +sed -i '' 's#android:name=".MainActivity"#android:name=".MainActivity" android:exported="true"#g' ./android/app/src/main/AndroidManifest.xml + echo "" echo "Go to Flutter project folder: cd $appName" echo "To run on Android type: flutter run" diff --git a/sample_files/main.dart b/sample_files/main.dart index e5ad8c4..24c678a 100644 --- a/sample_files/main.dart +++ b/sample_files/main.dart @@ -22,7 +22,7 @@ class _MyAppState extends State { if (Theme.of(context).platform == TargetPlatform.iOS) { license = "sRwAAAEVY29tLm1pY3JvYmxpbmsuc2FtcGxl1BIcP6dpSuS/37rVPvGgnEXtW6n0WYNXlN/0i1f88yoVpcC6wVI7C9/PwW96iHudfFxZtXdYuU3G3FGWKgCcqkSdZwRtiHrFeYz8beVEwPAGbLMPGidJ8qm5ZtgfLYHJ5NqR0qfIfqKTIDlsGzUY2D2qp3KUfYcscbf9JftuQdMpQ8VfQ8eu0+x1aUckcowsgAfq8/CTF3cpaSF1mBKMCO+idtTRWI8B52aZZDeybQ=="; } else if (Theme.of(context).platform == TargetPlatform.android) { - license = "sRwAAAAVY29tLm1pY3JvYmxpbmsuc2FtcGxlU9kJdb5ZkGlTu623Pixsw037mGhBUOlKf9FyC46r0aJfr+2FJclONWXQv/Xlj27pDDhp07b66EWvmCZeP9oUM7zUHo17x8A4DC8nIZhxCsRgz5FLeMD7opEa+XVTb3/kxNOc8zNZ2XSG0Pw9VTxYf/74hEC7mVhYMIK+4Nf94HM5hujNJInjb5BRLBqrje6tcOlqgSDdQGBkCIre9FOLJDgVtyq41HIwC4cxSS/ryg=="; + license = "sRwAAAAVY29tLm1pY3JvYmxpbmsuc2FtcGxlU9kJdb5ZkGlTu623PARDZ2y3bw/2FMh5N8Ns88iVHtrPi9+/nWa1Jfjuaio9sNqvjMT6OtkQ6mJBjE58IcmwG5+mm6WUi+Jy6MYfmGIzIoMFQvkqfYUo2Q/WFqsbYjo57kuic4Q5BWQbqavo1wF7llPipW1ABXqrTLnoewhyHJrJCMyXSOvK6ensoeNbd2iJtgi2L6myHxmekGcmW2ZnKr9otoMUy0YqZ5AjqMxjDw=="; } else { license = ""; } From f964159cd5c8c98fd936d841e8d0fe20e6b0dcf5 Mon Sep 17 00:00:00 2001 From: Toni Kreso Date: Mon, 18 Jul 2022 09:54:39 +0200 Subject: [PATCH 3/4] [iOS] generate bindings --- .../Wrappers/MBCBlinkCardRecognizerWrapper.m | 9 --- ...MBCLegacyBlinkCardEliteRecognizerWrapper.m | 9 --- .../MBCLegacyBlinkCardRecognizerWrapper.m | 9 --- .../recognizers/blink_card_recognizer.dart | 57 ++++++++++++----- .../legacy_blink_card_elite_recognizer.dart | 50 +++++++++++---- .../legacy_blink_card_recognizer.dart | 64 ++++++++++++++----- 6 files changed, 127 insertions(+), 71 deletions(-) diff --git a/BlinkCard/ios/Classes/MicroblinkModule/Recognizers/Wrappers/MBCBlinkCardRecognizerWrapper.m b/BlinkCard/ios/Classes/MicroblinkModule/Recognizers/Wrappers/MBCBlinkCardRecognizerWrapper.m index 7d4ee92..4bbc2d7 100644 --- a/BlinkCard/ios/Classes/MicroblinkModule/Recognizers/Wrappers/MBCBlinkCardRecognizerWrapper.m +++ b/BlinkCard/ios/Classes/MicroblinkModule/Recognizers/Wrappers/MBCBlinkCardRecognizerWrapper.m @@ -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; @@ -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"]; diff --git a/BlinkCard/ios/Classes/MicroblinkModule/Recognizers/Wrappers/MBCLegacyBlinkCardEliteRecognizerWrapper.m b/BlinkCard/ios/Classes/MicroblinkModule/Recognizers/Wrappers/MBCLegacyBlinkCardEliteRecognizerWrapper.m index 57859e6..5d30233 100644 --- a/BlinkCard/ios/Classes/MicroblinkModule/Recognizers/Wrappers/MBCLegacyBlinkCardEliteRecognizerWrapper.m +++ b/BlinkCard/ios/Classes/MicroblinkModule/Recognizers/Wrappers/MBCLegacyBlinkCardEliteRecognizerWrapper.m @@ -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; @@ -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"]; diff --git a/BlinkCard/ios/Classes/MicroblinkModule/Recognizers/Wrappers/MBCLegacyBlinkCardRecognizerWrapper.m b/BlinkCard/ios/Classes/MicroblinkModule/Recognizers/Wrappers/MBCLegacyBlinkCardRecognizerWrapper.m index d614c6d..6bf3f52 100644 --- a/BlinkCard/ios/Classes/MicroblinkModule/Recognizers/Wrappers/MBCLegacyBlinkCardRecognizerWrapper.m +++ b/BlinkCard/ios/Classes/MicroblinkModule/Recognizers/Wrappers/MBCLegacyBlinkCardRecognizerWrapper.m @@ -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; @@ -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"]; diff --git a/BlinkCard/lib/recognizers/blink_card_recognizer.dart b/BlinkCard/lib/recognizers/blink_card_recognizer.dart index d2707f1..0de84a8 100644 --- a/BlinkCard/lib/recognizers/blink_card_recognizer.dart +++ b/BlinkCard/lib/recognizers/blink_card_recognizer.dart @@ -13,16 +13,16 @@ class BlinkCardRecognizerResult extends RecognizerResult { ///The payment card number prefix. String? cardNumberPrefix; - ///Flag which indicatew whether the payment card number is valid or not. + ///The payment card number is valid bool? cardNumberValid; - ///Payment card's security code/value. + /// Payment card's security code/value. String? cvv; ///The payment card's expiry date. Date? expiryDate; - ///Whether the first scanned side is blurred. + ///Wheater the first scanned side is blurred. bool? firstSideBlurred; ///Full image of the payment card from first side recognition. @@ -34,16 +34,17 @@ class BlinkCardRecognizerResult extends RecognizerResult { ///Payment card's issuing network. Issuer? issuer; - ///Information about the payment card owner. + ///Information about the payment card owner (name, company, etc.). String? owner; ///Status of the last recognition process. BlinkCardProcessingStatus? processingStatus; - ///{true} if recognizer has finished scanning first side and is now scanning back side, + ///Returns true if recognizer has finished scanning first side and is now scanning back side, + /// false if it's still scanning first side. bool? scanningFirstSideDone; - ///Whether the second scanned side is blurred. + ///Wheater the second scanned side is blurred. bool? secondSideBlurred; ///Full image of the payment card from second side recognition. @@ -83,38 +84,62 @@ class BlinkCardRecognizerResult extends RecognizerResult { } -///Recognizer used for scanning both sides of payment cards. +///Recognizer used for scanning credit/debit cards. @JsonSerializable() class BlinkCardRecognizer extends Recognizer { - ///Whether blured frames filtering is allowed. + ///Defines whether blured frames filtering is allowed + /// + /// bool allowBlurFilter = true; - ///The settings which control the anonymization of returned data. + ///Defines whether sensitive data should be redacted from the result. + /// + /// BlinkCardAnonymizationSettings anonymizationSettings = BlinkCardAnonymizationSettings(); - ///Should extract the card CVV + ///Should extract CVV + /// + /// bool extractCvv = true; - ///Should extract the payment card's expiry date. + ///Should extract the payment card's month of expiry + /// + /// bool extractExpiryDate = true; - ///Should extract the card IBAN + ///Should extract the payment card's IBAN + /// + /// bool extractIban = true; ///Should extract the card owner information + /// + /// bool extractOwner = true; - ///The DPI (Dots Per Inch) for full document image that should be returned. + ///Property for setting DPI for full document images + /// Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + /// + /// int fullDocumentImageDpi = 250; - ///The extension factors for full document image. + ///Image extension factors for full document image. + /// + /// @see CImageExtensionFactors + /// ImageExtensionFactors fullDocumentImageExtensionFactors = ImageExtensionFactors(); - ///Padding is a minimum distance from the edge of the frame and it is defined as a percentage + ///Pading is a minimum distance from the edge of the frame and is defined as a percentage of the frame width. Default value is 0.0f and in that case + /// padding edge and image edge are the same. + /// Recommended value is 0.02f. + /// + /// double paddingEdge = 0.0; - ///Defines whether full document image will be available in + ///Sets whether full document image of ID card should be extracted. + /// + /// bool returnFullDocumentImage = false; BlinkCardRecognizer(): super('BlinkCardRecognizer'); diff --git a/BlinkCard/lib/recognizers/legacy_blink_card_elite_recognizer.dart b/BlinkCard/lib/recognizers/legacy_blink_card_elite_recognizer.dart index f9c76aa..01f3161 100644 --- a/BlinkCard/lib/recognizers/legacy_blink_card_elite_recognizer.dart +++ b/BlinkCard/lib/recognizers/legacy_blink_card_elite_recognizer.dart @@ -10,25 +10,29 @@ class LegacyBlinkCardEliteRecognizerResult extends RecognizerResult { ///The payment card number. String? cardNumber; - ///Payment card's security code/value. + /// Payment card's security code/value String? cvv; - ///Defines result of the data matching algorithm for scanned parts/sides of the document. + ///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 + /// be CDataMatchResultSuccess only if scanned values for all fields that are compared are the same. DataMatchResult? documentDataMatch; - ///Back side image of the document + ///back side image of the document if enabled with returnFullDocumentImage property. String? fullDocumentBackImage; - ///Front side image of the document + ///front side image of the document if enabled with returnFullDocumentImage property. String? fullDocumentFrontImage; ///Payment card's inventory number. String? inventoryNumber; - ///Information about the payment card owner (name, company, etc.) + ///Information about the payment card owner (name, company, etc.). String? owner; - ///{true} if recognizer has finished scanning first side and is now scanning back side, + ///Returns true if recognizer has finished scanning first side and is now scanning back side, + /// false if it's still scanning first side. bool? scanningFirstSideDone; ///The payment card's last month of validity. @@ -58,38 +62,60 @@ class LegacyBlinkCardEliteRecognizerResult extends RecognizerResult { } -///Recognizer used for scanning both sides of elite payment cards. +///Recognizer used for scanning the front side of elite credit/debit cards. @JsonSerializable() class LegacyBlinkCardEliteRecognizer extends Recognizer { ///Should anonymize the card number area (redact image pixels) on the document image result + /// + /// bool anonymizeCardNumber = false; - ///Should anonymize the CVV area (redact image pixels) on the document image result + ///Should anonymize the CVV on the document image result + /// + /// bool anonymizeCvv = false; ///Should anonymize the owner area (redact image pixels) on the document image result + /// + /// bool anonymizeOwner = false; - ///Defines whether glare detector is enabled. + ///Defines if glare detection should be turned on/off. + /// + /// bool detectGlare = true; ///Should extract the card's inventory number + /// + /// bool extractInventoryNumber = true; ///Should extract the card owner information + /// + /// bool extractOwner = true; ///Should extract the payment card's month of expiry + /// + /// bool extractValidThru = true; - ///The DPI (Dots Per Inch) for full document image that should be returned. + ///Property for setting DPI for full document images + /// Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + /// + /// int fullDocumentImageDpi = 250; - ///The extension factors for full document image. + ///Image extension factors for full document image. + /// + /// @see CImageExtensionFactors + /// ImageExtensionFactors fullDocumentImageExtensionFactors = ImageExtensionFactors(); - ///Defines whether full document image will be available in + ///Sets whether full document image of ID card should be extracted. + /// + /// bool returnFullDocumentImage = false; LegacyBlinkCardEliteRecognizer(): super('LegacyBlinkCardEliteRecognizer'); diff --git a/BlinkCard/lib/recognizers/legacy_blink_card_recognizer.dart b/BlinkCard/lib/recognizers/legacy_blink_card_recognizer.dart index 2a47b04..fcbb652 100644 --- a/BlinkCard/lib/recognizers/legacy_blink_card_recognizer.dart +++ b/BlinkCard/lib/recognizers/legacy_blink_card_recognizer.dart @@ -10,31 +10,35 @@ class LegacyBlinkCardRecognizerResult extends RecognizerResult { ///The payment card number. String? cardNumber; - ///Payment card's security code/value. + /// Payment card's security code/value String? cvv; - ///Defines result of the data matching algorithm for scanned parts/sides of the document. + ///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 + /// be CDataMatchResultSuccess only if scanned values for all fields that are compared are the same. DataMatchResult? documentDataMatch; - ///Back side image of the document + ///back side image of the document if enabled with returnFullDocumentImage property. String? fullDocumentBackImage; - ///Front side image of the document + ///front side image of the document if enabled with returnFullDocumentImage property. String? fullDocumentFrontImage; - ///Payment card's IBAN. + ///Payment card's IBAN String? iban; ///Payment card's inventory number. String? inventoryNumber; - ///The payment card's issuing network. + ///Payment card's issuing network LegacyCardIssuer? issuer; - ///Information about the payment card owner (name, company, etc.) + ///Information about the payment card owner (name, company, etc.). String? owner; - ///{true} if recognizer has finished scanning first side and is now scanning back side, + ///Returns true if recognizer has finished scanning first side and is now scanning back side, + /// false if it's still scanning first side. bool? scanningFirstSideDone; ///The payment card's last month of validity. @@ -68,47 +72,75 @@ class LegacyBlinkCardRecognizerResult extends RecognizerResult { } -///Recognizer used for scanning both sides of payment cards. +///Recognizer used for scanning the front side of credit/debit cards. @JsonSerializable() class LegacyBlinkCardRecognizer extends Recognizer { ///Should anonymize the card number area (redact image pixels) on the document image result + /// + /// bool anonymizeCardNumber = false; - ///Should anonymize the CVV area (redact image pixels) on the document image result + ///Should anonymize the CVV on the document image result + /// + /// bool anonymizeCvv = false; ///Should anonymize the IBAN area (redact image pixels) on the document image result + /// + /// bool anonymizeIban = false; ///Should anonymize the owner area (redact image pixels) on the document image result + /// + /// bool anonymizeOwner = false; - ///Defines whether glare detector is enabled. + ///Defines if glare detection should be turned on/off. + /// + /// bool detectGlare = true; - ///Should extract the card CVV + ///Should extract CVV + /// + /// bool extractCvv = true; - ///Should extract the card IBAN + ///Should extract the payment card's IBAN + /// + /// bool extractIban = false; ///Should extract the card's inventory number + /// + /// bool extractInventoryNumber = true; ///Should extract the card owner information + /// + /// bool extractOwner = false; ///Should extract the payment card's month of expiry + /// + /// bool extractValidThru = true; - ///The DPI (Dots Per Inch) for full document image that should be returned. + ///Property for setting DPI for full document images + /// Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + /// + /// int fullDocumentImageDpi = 250; - ///The extension factors for full document image. + ///Image extension factors for full document image. + /// + /// @see CImageExtensionFactors + /// ImageExtensionFactors fullDocumentImageExtensionFactors = ImageExtensionFactors(); - ///Defines whether full document image will be available in + ///Sets whether full document image of ID card should be extracted. + /// + /// bool returnFullDocumentImage = false; LegacyBlinkCardRecognizer(): super('LegacyBlinkCardRecognizer'); From 54812c9402cf751a9f244b6162c547842d5c5d8a Mon Sep 17 00:00:00 2001 From: Toni Kreso Date: Mon, 18 Jul 2022 10:12:27 +0200 Subject: [PATCH 4/4] update ios version and licence --- BlinkCard/ios/blinkcard_flutter.podspec | 6 +++--- BlinkCard/pubspec.yaml | 2 +- initFlutterSample.sh | 3 +++ sample_files/main.dart | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/BlinkCard/ios/blinkcard_flutter.podspec b/BlinkCard/ios/blinkcard_flutter.podspec index f2fa00c..dd8aecf 100644 --- a/BlinkCard/ios/blinkcard_flutter.podspec +++ b/BlinkCard/ios/blinkcard_flutter.podspec @@ -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. @@ -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' } diff --git a/BlinkCard/pubspec.yaml b/BlinkCard/pubspec.yaml index 40755f0..bd3cebf 100644 --- a/BlinkCard/pubspec.yaml +++ b/BlinkCard/pubspec.yaml @@ -34,4 +34,4 @@ flutter: package: com.microblink.blinkcard.flutter pluginClass: MicroblinkFlutterPlugin ios: - pluginClass: MicroblinkFlutterPlugin \ No newline at end of file + pluginClass: BlinkCardFlutterPlugin diff --git a/initFlutterSample.sh b/initFlutterSample.sh index 6e3ca44..3d77f1c 100755 --- a/initFlutterSample.sh +++ b/initFlutterSample.sh @@ -32,6 +32,9 @@ popd # enter into ios project folder pushd ios +#Force minimal iOS version +sed -i '' "s/# platform :ios, '9.0'/platform :ios, '12.0'/" Podfile + # install pod pod install diff --git a/sample_files/main.dart b/sample_files/main.dart index 24c678a..ed9fd4b 100644 --- a/sample_files/main.dart +++ b/sample_files/main.dart @@ -20,7 +20,7 @@ class _MyAppState extends State { Future scan() async { String license; if (Theme.of(context).platform == TargetPlatform.iOS) { - license = "sRwAAAEVY29tLm1pY3JvYmxpbmsuc2FtcGxl1BIcP6dpSuS/37rVPvGgnEXtW6n0WYNXlN/0i1f88yoVpcC6wVI7C9/PwW96iHudfFxZtXdYuU3G3FGWKgCcqkSdZwRtiHrFeYz8beVEwPAGbLMPGidJ8qm5ZtgfLYHJ5NqR0qfIfqKTIDlsGzUY2D2qp3KUfYcscbf9JftuQdMpQ8VfQ8eu0+x1aUckcowsgAfq8/CTF3cpaSF1mBKMCO+idtTRWI8B52aZZDeybQ=="; + license = "sRwAAAEVY29tLm1pY3JvYmxpbmsuc2FtcGxl1BIcP6dpSuS/37rVPPmJM1WVgUPxJ6drb0RlV8e0cdQjsz2ti42it9NqPg8OAPX47u13pXjleAvZAuxN0Fr8kBeUjMM8y/GJ/4FRBIETzsuJKokzMn2HTkkeMXtep7afy/JHdc+8FKJdSEn0RJfEkxAVdvY0OV+Ozu2Zjca+ULM9jA23TXgGkRWicDTBuPbNzT2exFl7fHx6/olVSQ9zrAa/dMpIWjqfRyM22uSc5g=="; } else if (Theme.of(context).platform == TargetPlatform.android) { license = "sRwAAAAVY29tLm1pY3JvYmxpbmsuc2FtcGxlU9kJdb5ZkGlTu623PARDZ2y3bw/2FMh5N8Ns88iVHtrPi9+/nWa1Jfjuaio9sNqvjMT6OtkQ6mJBjE58IcmwG5+mm6WUi+Jy6MYfmGIzIoMFQvkqfYUo2Q/WFqsbYjo57kuic4Q5BWQbqavo1wF7llPipW1ABXqrTLnoewhyHJrJCMyXSOvK6ensoeNbd2iJtgi2L6myHxmekGcmW2ZnKr9otoMUy0YqZ5AjqMxjDw=="; } else {