-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscapi_messages.hpp
179 lines (147 loc) · 4.47 KB
/
scapi_messages.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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#pragma once
// TODO: This file should be generated
extern "C" {
#include "nexoid-ed/include/types.h"
}
#include <memory>
#include <variant>
#include <optional>
#include <vector>
#include <string>
namespace scapi {
typedef ::std::variant<
enum CvdPresence
, struct cn2
> CvdData;
struct Nak {
::std::optional<enum ::NokReason> nokReason;
::std::optional<enum ::TerminalErrorReason> terminalErrorReason;
};
struct UpdateInterfaces {
enum ::InterfaceStatus interfaceStatus;
};
struct PrintMessage {
enum ::PrintMessage type;
void* extraData;
};
struct LanguageSelection {
union ::Iso639_1 selectedLanguage;
};
struct ServiceSelection {
enum ::ServiceId serviceId;
};
struct ManualEntry {
::std::string pan;
union ExpirationDate expirationDate;
::std::optional<CvdData> cvdData;
};
struct AmountEntry {
union ::bcd6 totalAmount;
::std::optional<bool> minus;
::std::optional<::std::variant<
bool, // confirmed
union ::bcd6 // amount
>> supplementaryAmount;
::std::optional<union ::bcd6> cashbackAmount;
};
struct CardInserted {
};
typedef ::std::variant<
LanguageSelection
, ServiceSelection
, ManualEntry
, ::std::monostate // Terminate
, ::std::monostate // Reboot
, AmountEntry
, CardInserted
> Event;
typedef ::std::variant<
enum ::CardholderMessage // msg
, enum ::CardholderMessage // ssn
, struct ::UiParameters // uiParametersForOutcome
, struct ::UiParameters // uiParametersForRestart
, struct ::UiParameters // uiParametersForCompletion
, struct ::UiParameters // uiParametersForOutcomeStatusOnly
, ::std::string // declineDisplayMessage
, ::std::string // cardholderMessage - FIXME: See Scapi.asn1
, ::std::string // applicationLabelDisplayed
, struct ::string5 // commandKeyEnterLabel
, struct ::string6 // commandKeyChangeApplicationLabel
, struct ::string6 // commandKeyPinBypassLabel
, union ::bcd6 // paymentAmount
, union ::bcd6 // trxAmount
, union ::bcd6 // cashbackAmount
, union ::bcd6 // supplementaryAmount
, union ::CurrencyAlpha3 // trxCurrencyAlpha3
, enum ::ServiceId // selectedService
, enum ::NokReason // nokReason
, ::std::monostate // FIXME: Implement searchTrxResultList
, union ::bcd6 // updatePreAuthTotalAmount
, bool // minus
, union ::bcd // trxCurrencyExponent
, ::std::vector<::std::string> // missingParameters // non-nexo
, enum CtlssIndicatorStatus // Contactless LEDs status
> Interaction;
// Keep values synchronized with ASN.1 specification
enum class PinAbsentReason {
pinPadNotWorking = 0,
pinEntryBypassed = 1,
cardholderRequestedChangeOfApplication = 2
};
typedef ::std::variant<
std::string // plainTextPin
, struct ::OpaquePinData* // opaquePinData
, PinAbsentReason // noPin
> CardholderPin;
typedef ::std::variant<
std::string // PAN
, enum ::CvdPresence // CVD presence
, struct ::cn2 // CVD
, CardholderPin // PIN
, union ::ExpirationDate // Card expiry date
> AckEntry;
typedef ::std::variant<
UpdateInterfaces // updateInterfaces
, ::std::vector<Interaction> // output
, PrintMessage // print
, ::std::vector<Interaction> // entry
> Request;
typedef ::std::variant<
Nak // nak
, ::std::monostate // ack
, ::std::vector<AckEntry> // ackEntry
> Response;
struct Notification {
::std::vector<Event> events;
};
namespace socket {
struct RegistrationRequest {
};
struct NotificationRequest {
};
typedef ::std::variant<
::scapi::Request
, RegistrationRequest
, NotificationRequest
> Request;
typedef ::std::variant<
::scapi::Response
, ::scapi::Notification
> Response;
}
namespace nng {
typedef long ExchangeId_t;
struct Request {
::scapi::Request req;
ExchangeId_t id;
};
struct Response {
::scapi::Response rsp;
ExchangeId_t id;
};
struct Notification {
::scapi::Notification ntf;
ExchangeId_t id;
};
}
}