-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathttd_keeper.hpp
44 lines (38 loc) · 1.68 KB
/
ttd_keeper.hpp
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
#pragma once
#include "singleton.hpp"
#include "scapi_messages.hpp"
/** The purpose of this class is to guarantee TTD consitency on updates
*/
class TtdKeeper final : public Singleton<TtdKeeper> {
friend class Singleton<TtdKeeper>;
TtdKeeper(void) = default;
public:
void update(const scapi::Event&);
void update(enum NokReason);
void update(enum AuthorisationResponseCode);
void update(enum TransactionResult);
enum TerminalErrorReason update(enum TerminalErrorReason);
std::optional<enum CvdPresence> update(enum CvdPresence);
enum Technology update(enum Technology);
/** Exception handler, should be used on a boundary between C and C++
*/
void handle_exception(const char* func = nullptr) noexcept;
/** Should be called when wrong kind of response was received
*/
void handle_bad_response(const scapi::Response&) noexcept;
std::string fetch_application_label_displayed(void);
enum NokReason fetch_nok_reason(void);
enum TerminalErrorReason fetch_ter_reason(void);
enum ServiceId fetch_selected_service(void);
union Iso639_1 fetch_selected_language(void);
union bcd6 fetch_transaction_amount(void);
union CurrencyAlpha3 fetch_transaction_currency_code_alpha3(void);
union bcd fetch_transaction_currency_exponent(void);
std::vector<std::string> fetch_missing_parameters(void);
enum CtlssIndicatorStatus fetch_ctlss_indicator_status(void);
struct ::string5 fetch_command_key_enter_label(void); ///< Not in TTD, It's in E0
struct ::string6 fetch_command_key_bypass_pin_label(void); ///< Not in TTD, It's in E0
/** Unconditionaly clears TTD. Useful for testing
*/
void reset(void) noexcept;
};