capacitor-microblink 0.3.1 → 0.4.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.
|
@@ -248,14 +248,18 @@ public class MicroblinkPlugin extends Plugin {
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
private JSObject toBlinkCardDate(DateResult<String> dateResult) {
|
|
251
|
-
if (dateResult == null || dateResult.
|
|
251
|
+
if (dateResult == null || dateResult.getMonth() == null || dateResult.getYear() == null) {
|
|
252
252
|
return null;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
JSObject date = new JSObject();
|
|
256
|
-
date.put("day", dateResult.getDay());
|
|
257
256
|
date.put("month", dateResult.getMonth());
|
|
258
257
|
date.put("year", dateResult.getYear());
|
|
258
|
+
|
|
259
|
+
if (dateResult.getDay() != null) {
|
|
260
|
+
date.put("day", dateResult.getDay());
|
|
261
|
+
}
|
|
262
|
+
|
|
259
263
|
return date;
|
|
260
264
|
}
|
|
261
265
|
|
package/dist/docs.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface BlinkCardDate {\n day
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface BlinkCardDate {\n day?: number;\n month: number;\n year: number;\n}\n\nexport interface ScanCardOptions {\n licenseKey?: string;\n licensee?: string;\n extractOwner?: boolean;\n extractExpiryDate?: boolean;\n extractCvv?: boolean;\n extractIban?: boolean;\n allowInvalidCardNumber?: boolean;\n enableEditScreen?: boolean;\n}\n\nexport interface InitializeBlinkCardOptions {\n licenseKey: string;\n licensee?: string;\n}\n\nexport interface InitializeBlinkCardResult {\n initialized: boolean;\n}\n\nexport interface TerminateBlinkCardResult {\n terminated: boolean;\n}\n\nexport interface ScanCardResult {\n canceled: boolean;\n resultState?: 'empty' | 'uncertain' | 'valid' | 'stageValid';\n processingStatus?:\n | 'success'\n | 'detectionFailed'\n | 'imagePreprocessingFailed'\n | 'stabilityTestFailed'\n | 'scanningWrongSide'\n | 'fieldIdentificationFailed'\n | 'imageReturnFailed'\n | 'unsupportedCard';\n cardNumber?: string;\n cardNumberValid?: boolean;\n cardNumberPrefix?: string;\n owner?: string;\n cvv?: string;\n iban?: string;\n expiryDate?: BlinkCardDate | null;\n}\n\nexport interface MicroblinkPlugin {\n /**\n * Starts BlinkCard card scanning flow.\n */\n scanCard(options: ScanCardOptions): Promise<ScanCardResult>;\n\n /**\n * Initializes BlinkCard SDK/license before scanning.\n */\n initializeBlinkCard(\n options: InitializeBlinkCardOptions,\n ): Promise<InitializeBlinkCardResult>;\n\n /**\n * Terminates BlinkCard SDK and clears cached plugin initialization state.\n */\n terminateBlinkCard(): Promise<TerminateBlinkCardResult>;\n}\n"]}
|
|
@@ -233,16 +233,21 @@ public class MicroblinkPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
233
233
|
|
|
234
234
|
private func mapBlinkCardDate(_ date: DateResult?) -> [String: Int]? {
|
|
235
235
|
guard let date,
|
|
236
|
-
let day = date.day,
|
|
237
236
|
let month = date.month,
|
|
238
237
|
let year = date.year else {
|
|
239
238
|
return nil
|
|
240
239
|
}
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
|
|
241
|
+
var mappedDate: [String: Int] = [
|
|
243
242
|
"month": month,
|
|
244
243
|
"year": year
|
|
245
244
|
]
|
|
245
|
+
|
|
246
|
+
if let day = date.day {
|
|
247
|
+
mappedDate["day"] = day
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return mappedDate
|
|
246
251
|
}
|
|
247
252
|
|
|
248
253
|
private func createBlinkCardSdk(licenseKey: String, licensee: String?) async throws -> BlinkCardSdk {
|