@@ -6,32 +6,45 @@ use api_models::{
6
6
enums:: { AuthenticationConnectors , Connector , PmAuthConnectors , TaxConnectors } ,
7
7
payments,
8
8
} ;
9
- use serde:: Deserialize ;
9
+ use serde:: { Deserialize , Serialize } ;
10
10
use toml;
11
11
12
12
use crate :: common_config:: { CardProvider , InputData , Provider , ZenApplePay } ;
13
13
14
- #[ derive( Default , Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
14
+ #[ derive( Default , Debug , Clone , Serialize , Deserialize ) ]
15
+ pub struct PayloadCurrencyAuthKeyType {
16
+ pub api_key : String ,
17
+ pub processing_account_id : String ,
18
+ }
19
+
20
+ #[ derive( Default , Debug , Clone , Serialize , Deserialize ) ]
15
21
pub struct Classic {
16
22
pub password_classic : String ,
17
23
pub username_classic : String ,
18
24
pub merchant_id_classic : String ,
19
25
}
20
26
21
- #[ derive( Default , Debug , Clone , serde :: Serialize , serde :: Deserialize ) ]
27
+ #[ derive( Default , Debug , Clone , Serialize , Deserialize ) ]
22
28
pub struct Evoucher {
23
29
pub password_evoucher : String ,
24
30
pub username_evoucher : String ,
25
31
pub merchant_id_evoucher : String ,
26
32
}
27
33
28
- #[ derive( Default , Debug , Clone , serde :: Serialize , serde :: Deserialize ) ]
29
- pub struct CurrencyAuthKeyType {
34
+ #[ derive( Default , Debug , Clone , Serialize , Deserialize ) ]
35
+ pub struct CashtoCodeCurrencyAuthKeyType {
30
36
pub classic : Classic ,
31
37
pub evoucher : Evoucher ,
32
38
}
33
39
34
- #[ derive( Default , Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
40
+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
41
+ #[ serde( untagged) ]
42
+ pub enum CurrencyAuthValue {
43
+ CashtoCode ( CashtoCodeCurrencyAuthKeyType ) ,
44
+ Payload ( PayloadCurrencyAuthKeyType ) ,
45
+ }
46
+
47
+ #[ derive( Default , Debug , Clone , Serialize , Deserialize ) ]
35
48
pub enum ConnectorAuthType {
36
49
HeaderKey {
37
50
api_key : String ,
@@ -52,7 +65,7 @@ pub enum ConnectorAuthType {
52
65
key2 : String ,
53
66
} ,
54
67
CurrencyAuthKey {
55
- auth_key_map : HashMap < String , CurrencyAuthKeyType > ,
68
+ auth_key_map : HashMap < String , CurrencyAuthValue > ,
56
69
} ,
57
70
CertificateAuth {
58
71
certificate : String ,
@@ -63,23 +76,23 @@ pub enum ConnectorAuthType {
63
76
}
64
77
65
78
#[ serde_with:: skip_serializing_none]
66
- #[ derive( Debug , Deserialize , serde :: Serialize , Clone ) ]
79
+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
67
80
#[ serde( untagged) ]
68
81
pub enum ApplePayTomlConfig {
69
82
Standard ( Box < payments:: ApplePayMetadata > ) ,
70
83
Zen ( ZenApplePay ) ,
71
84
}
72
85
73
86
#[ serde_with:: skip_serializing_none]
74
- #[ derive( Debug , Clone , serde :: Serialize , Deserialize ) ]
87
+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
75
88
pub enum KlarnaEndpoint {
76
89
Europe ,
77
90
NorthAmerica ,
78
91
Oceania ,
79
92
}
80
93
81
94
#[ serde_with:: skip_serializing_none]
82
- #[ derive( Debug , Deserialize , serde :: Serialize , Clone ) ]
95
+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
83
96
pub struct ConfigMerchantAdditionalDetails {
84
97
pub open_banking_recipient_data : Option < InputData > ,
85
98
pub account_data : Option < InputData > ,
@@ -96,7 +109,7 @@ pub struct ConfigMerchantAdditionalDetails {
96
109
}
97
110
98
111
#[ serde_with:: skip_serializing_none]
99
- #[ derive( Debug , Deserialize , serde :: Serialize , Clone ) ]
112
+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
100
113
pub struct ConfigMetadata {
101
114
pub merchant_config_currency : Option < InputData > ,
102
115
pub merchant_account_id : Option < InputData > ,
@@ -137,15 +150,15 @@ pub struct ConfigMetadata {
137
150
}
138
151
139
152
#[ serde_with:: skip_serializing_none]
140
- #[ derive( Debug , Deserialize , serde :: Serialize , Clone ) ]
153
+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
141
154
pub struct ConnectorWalletDetailsConfig {
142
155
pub samsung_pay : Option < Vec < InputData > > ,
143
156
pub paze : Option < Vec < InputData > > ,
144
157
pub google_pay : Option < Vec < InputData > > ,
145
158
}
146
159
147
160
#[ serde_with:: skip_serializing_none]
148
- #[ derive( Debug , Deserialize , serde :: Serialize , Clone ) ]
161
+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
149
162
pub struct ConnectorTomlConfig {
150
163
pub connector_auth : Option < ConnectorAuthType > ,
151
164
pub connector_webhook_details : Option < api_models:: admin:: MerchantConnectorWebhookDetails > ,
@@ -170,7 +183,7 @@ pub struct ConnectorTomlConfig {
170
183
pub real_time_payment : Option < Vec < Provider > > ,
171
184
}
172
185
#[ serde_with:: skip_serializing_none]
173
- #[ derive( Debug , Deserialize , serde :: Serialize , Clone ) ]
186
+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
174
187
pub struct ConnectorConfig {
175
188
pub authipay : Option < ConnectorTomlConfig > ,
176
189
pub juspaythreedsserver : Option < ConnectorTomlConfig > ,
0 commit comments