This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AustriaQrCodePaymentRecognizer.ts
107 lines (92 loc) · 2.7 KB
/
AustriaQrCodePaymentRecognizer.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/**
* Copyright (c) Microblink Ltd. All rights reserved.
*/
import
{
Recognizer,
RecognizerResult,
RecognizerSettings,
WasmSDK
} from "../../../MicroblinkSDK/DataStructures";
/**
* A settings object that is used for configuring the AustriaQrCodePaymentRecognizer.
*/
export class AustriaQrCodePaymentRecognizerSettings implements RecognizerSettings
{
/**
* Defines if the recognizer should go slower through scan. If slowerThoroughScan is enabled,
* then scanning will be slower, but more thorough, thus giving higher possibility of successful
* scan.
*
* By default, slowerThoroughScan is disabled.
*/
slowerThoroughScan = true;
}
/**
* The result of image recognition when using the AustriaQrCodePaymentRecognizer.
*/
export interface AustriaQrCodePaymentRecognizerResult extends RecognizerResult
{
/**
* The scanned amount in smallest currency (e.g. cents), 0 if nothing was scanned.
*/
readonly amount: number;
/**
* BIC of the receiving side.
*/
readonly bic: string;
/**
* The currency of the payment.
*/
readonly currency: string;
/**
* Description of the payment as placed in last row of STUZZA QR code
*/
readonly displayData: string;
/**
* The account number of the receiving side.
*/
readonly iban: string;
/**
* The description of the payment.
*/
readonly paymentDescription: string;
/**
* Purpose code
*/
readonly purposeCode: string;
/**
* The name of the receiving side.
*/
readonly recipientName: string;
/**
* The reference of the payment.
*/
readonly reference: string;
}
/**
* Recognizer which can scan Austrian payment QR code.
*/
export interface AustriaQrCodePaymentRecognizer extends Recognizer
{
/** Returns the currently applied AustriaQrCodePaymentRecognizerSettings. */
currentSettings(): Promise< AustriaQrCodePaymentRecognizerSettings >
/** Applies new settings to the recognizer. */
updateSettings( newSettings: AustriaQrCodePaymentRecognizerSettings ): Promise< void >;
/** Returns the current result of the recognition. */
getResult(): Promise< AustriaQrCodePaymentRecognizerResult >;
}
/**
* This function is used to create a new instance of `AustriaQrCodePaymentRecognizer`.
* @param wasmSDK Instance of WasmSDK which will be used to communicate with the WebAssembly module.
*/
export async function createAustriaQrCodePaymentRecognizer
(
wasmSDK: WasmSDK
): Promise< AustriaQrCodePaymentRecognizer >
{
return wasmSDK.mbWasmModule.newRecognizer
(
"AustriaQrCodePaymentRecognizer"
) as Promise< AustriaQrCodePaymentRecognizer >;
}