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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
//! The shop (business profile) models, plus the acquirer identities a shop
//! presents per card network.
//!
//! `Debug` on [`ProfileResponse`] is hand-written: the API echoes
//! `payment_response_hash_key` (the secret used to sign payment responses) and
//! `webhook_details` (which can hold outgoing-webhook credentials), so a
//! derived `Debug` would leak both into logs.
use serde::Deserialize;
use serde_json::Value;
/// Placeholder printed in place of a credential-bearing field.
const REDACTED: &str = "[redacted]";
/// Custom format for generated payment ids (cloaking), e.g. `ORD-74219807`.
///
/// Absent means the default `pay_<random>` ids. Every field is optional: the
/// API may add or drop parts of the config without breaking deserialization.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PaymentIdFormatConfig {
/// Static prefix, e.g. `"ORD-"`. May be empty.
#[serde(default)]
pub prefix: Option<String>,
/// Charset used for the random body of the id.
#[serde(default)]
pub style: Option<String>,
/// Length of the random body.
#[serde(default)]
pub length: Option<i64>,
/// Any additional fields not modeled above.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}
/// A shop (business profile) as returned by the API.
///
/// Only [`profile_id`](ProfileResponse::profile_id) is required: the delete and
/// toggle endpoints answer with trimmed objects, so every other field is
/// optional rather than a hard deserialization failure.
///
/// Unmodeled fields are preserved in [`extra`](ProfileResponse::extra).
#[derive(Clone, Deserialize)]
#[non_exhaustive]
pub struct ProfileResponse {
/// Unique shop (business profile) ID.
pub profile_id: String,
/// Merchant account that owns the shop.
#[serde(default)]
pub merchant_id: Option<String>,
/// Display name for the shop.
#[serde(default)]
pub profile_name: Option<String>,
/// Whether payment responses are signed.
#[serde(default)]
pub enable_payment_response_hash: Option<bool>,
/// Signing key for payment response hashes. **Secret**: redacted by
/// [`Debug`].
#[serde(default)]
pub payment_response_hash_key: Option<String>,
/// Whether the customer is redirected back with an HTTP POST.
#[serde(default)]
pub redirect_to_merchant_with_http_post: Option<bool>,
/// URL customers are returned to after a payment.
#[serde(default)]
pub return_url: Option<String>,
/// Outgoing-webhook configuration (open shape). **May hold credentials**:
/// redacted by [`Debug`].
#[serde(default)]
pub webhook_details: Option<Value>,
/// Whether a tax connector is enabled for the shop.
#[serde(default)]
pub is_tax_connector_enabled: Option<bool>,
/// Whether network tokenization is enabled.
#[serde(default)]
pub is_network_tokenization_enabled: Option<bool>,
/// Whether automatic retries are enabled.
#[serde(default)]
pub is_auto_retries_enabled: Option<bool>,
/// Whether Click to Pay is enabled.
#[serde(default)]
pub is_click_to_pay_enabled: Option<bool>,
/// Whether retries with a clear PAN are enabled.
#[serde(default)]
pub is_clear_pan_retries_enabled: Option<bool>,
/// Whether every card payment is forced through a 3DS challenge.
#[serde(default)]
pub force_3ds_challenge: Option<bool>,
/// Whether pre-network tokenization is enabled.
#[serde(default)]
pub is_pre_network_tokenization_enabled: Option<bool>,
/// Origins permitted to embed this shop's hosted checkout in an iframe.
/// Each entry is a full origin (`scheme://host[:port]`, no path). Empty or
/// absent means same-origin only.
#[serde(default)]
pub iframe_allowed_origins: Option<Vec<String>>,
/// Merchant connector account ID of the billing processor (e.g. Stripe
/// Billing / PayPal) that owns this shop's native subscriptions.
#[serde(default)]
pub billing_processor_id: Option<String>,
/// Custom format for generated payment ids (cloaking).
#[serde(default)]
pub payment_id_format: Option<PaymentIdFormatConfig>,
/// Whether the payment's description is sent on to the processor.
/// Defaults to `false` server-side: the processor does not see the
/// description unless the shop opts in.
#[serde(default)]
pub send_description_to_processor: Option<bool>,
/// Whether the merchant's own metadata keys are sent on to the processor.
/// Defaults to `false` server-side.
#[serde(default)]
pub send_metadata_to_processor: Option<bool>,
/// The Stripe connected account this shop originates on, when it has one.
#[serde(default)]
pub stripe_connected_account_id: Option<String>,
/// Whether that connected account finished DeloPay's own onboarding.
#[serde(default)]
pub stripe_connected_account_delopay_onboarded: Option<bool>,
/// Arbitrary metadata.
#[serde(default)]
pub metadata: Option<Value>,
/// Whether the shop's payments are switched off (see
/// `Profiles::disable_payments`).
#[serde(default)]
pub payments_disabled: Option<bool>,
/// Whether the shop takes no new payment right now, for any reason.
/// `false` from an older API.
#[serde(default)]
pub payments_stopped: bool,
/// The shop's own website.
#[serde(default)]
pub shop_url: Option<String>,
/// Whether the payment's order details are passed on to the processor.
#[serde(default)]
pub send_order_details_to_processor: Option<bool>,
/// Whether the payment ID is passed on to the processor.
#[serde(default)]
pub send_payment_id_to_processor: Option<bool>,
/// Whether card payments go through the shop's card vault: `"enable"` or
/// `"skip"`.
#[serde(default)]
pub is_external_vault_enabled: Option<String>,
/// Custom format for generated product IDs. `None` is the default
/// `prd_` prefix.
#[serde(default)]
pub product_id_format: Option<PaymentIdFormatConfig>,
/// URL the buyer may use to leave an unpaid hosted checkout.
#[serde(default)]
pub cancel_url: Option<String>,
/// The shop's default checkout locale, as a BCP 47 tag.
#[serde(default)]
pub default_locale: Option<String>,
/// Whether the checkout uses `default_locale` over the buyer's browser
/// language.
#[serde(default)]
pub prefer_merchant_locale: Option<bool>,
/// Any additional response fields not modeled above.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}
impl std::fmt::Debug for ProfileResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("ProfileResponse")
.field("profile_id", &self.profile_id)
.field("merchant_id", &self.merchant_id)
.field("profile_name", &self.profile_name)
.field(
"enable_payment_response_hash",
&self.enable_payment_response_hash,
)
.field(
"payment_response_hash_key",
&self.payment_response_hash_key.as_ref().map(|_| REDACTED),
)
.field(
"redirect_to_merchant_with_http_post",
&self.redirect_to_merchant_with_http_post,
)
.field("return_url", &self.return_url)
.field(
"webhook_details",
&self.webhook_details.as_ref().map(|_| REDACTED),
)
.field("is_tax_connector_enabled", &self.is_tax_connector_enabled)
.field(
"is_network_tokenization_enabled",
&self.is_network_tokenization_enabled,
)
.field("is_auto_retries_enabled", &self.is_auto_retries_enabled)
.field("is_click_to_pay_enabled", &self.is_click_to_pay_enabled)
.field(
"is_clear_pan_retries_enabled",
&self.is_clear_pan_retries_enabled,
)
.field("force_3ds_challenge", &self.force_3ds_challenge)
.field(
"is_pre_network_tokenization_enabled",
&self.is_pre_network_tokenization_enabled,
)
.field("iframe_allowed_origins", &self.iframe_allowed_origins)
.field("billing_processor_id", &self.billing_processor_id)
.field("payment_id_format", &self.payment_id_format)
.field("metadata", &self.metadata)
.field("payments_disabled", &self.payments_disabled)
.field("payments_stopped", &self.payments_stopped)
.field("shop_url", &self.shop_url)
.field(
"send_order_details_to_processor",
&self.send_order_details_to_processor,
)
.field(
"send_payment_id_to_processor",
&self.send_payment_id_to_processor,
)
.field("is_external_vault_enabled", &self.is_external_vault_enabled)
.field("product_id_format", &self.product_id_format)
.field("cancel_url", &self.cancel_url)
.field("default_locale", &self.default_locale)
.field("prefer_merchant_locale", &self.prefer_merchant_locale)
.field("extra", &self.extra)
.finish()
}
}
/// The checkout-branding subset of a shop, as returned by both
/// `CheckoutBranding`-gated routes: the read, and the write echoing back what
/// it persisted.
///
/// Deliberately **not** a [`ProfileResponse`]. That one also carries
/// `payment_response_hash_key` — the webhook signing secret — along with the
/// card-vault and authentication configuration, none of which a role whose only
/// power is restyling a checkout has any business reading, whether it asked to
/// load the checkout or has just saved it. This carries what the branding
/// editor renders and nothing else.
///
/// `Debug` is hand-written all the same. The narrow field list keeps a
/// credential out of a *named* field, but `extra` preserves whatever else the
/// wire carried, so a payload that echoed `payment_response_hash_key` — a
/// router bug, or this type pointed at a wider endpoint — would print it in
/// clear text through a derived impl. The type's whole purpose is that this
/// role never sees that key, and "the endpoint does not send it" is not a
/// property this crate can enforce.
#[derive(Clone, Deserialize)]
#[non_exhaustive]
pub struct CheckoutBrandingResponse {
/// The shop (business profile) this branding belongs to.
pub profile_id: String,
/// Name of the shop, for labelling the editor.
pub profile_name: String,
/// The stored checkout appearance, open-shaped — decode it with
/// [`crate::branding::decode_branding`].
///
/// `None` is the shop that has never been styled: the untouched default,
/// not an error, and what tells an editor to seed its own defaults rather
/// than render a stored, empty style.
#[serde(default)]
pub payment_link_config: Option<Value>,
/// Whether this is the Test checkout's branding (`true`) or Live's.
#[serde(default)]
pub test_mode: bool,
/// For the Test checkout: `true` until its first save, while it follows
/// Live and `payment_link_config` is Live's. Always `false` for Live.
#[serde(default)]
pub follows_live: bool,
/// Any additional response fields not modeled above.
///
/// Credential-bearing keys are redacted by [`Debug`] but kept here intact
/// — dropping them would hide a router that is over-sending, which is the
/// one thing a reader of this type needs to be able to notice.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}
/// Keys a profile payload can carry that must never be printed.
///
/// `CheckoutBrandingResponse` models none of them, so each arrives in `extra`
/// rather than in a field with its own redaction. Mirrors the fields
/// [`ProfileResponse`] redacts by hand.
const PROFILE_SECRET_KEYS: &[&str] = &[
"payment_response_hash_key",
"webhook_details",
"outgoing_webhook_custom_http_headers",
];
impl std::fmt::Debug for CheckoutBrandingResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
struct Extra<'a>(&'a serde_json::Map<String, Value>);
impl std::fmt::Debug for Extra<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut map = f.debug_map();
for (key, value) in self.0 {
if PROFILE_SECRET_KEYS.contains(&key.as_str()) {
map.entry(key, &REDACTED);
} else {
map.entry(key, value);
}
}
map.finish()
}
}
f.debug_struct("CheckoutBrandingResponse")
.field("profile_id", &self.profile_id)
.field("profile_name", &self.profile_name)
.field("payment_link_config", &self.payment_link_config)
.field("test_mode", &self.test_mode)
.field("follows_live", &self.follows_live)
.field("extra", &Extra(&self.extra))
.finish()
}
}
/// An acquirer identity a shop (business profile) presents for one card
/// network: the acquirer BIN, the merchant ID the acquirer assigned, and the
/// acquirer-reported fraud rate.
///
/// Carries no credential, so `Debug` is derived.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct ProfileAcquirerResponse {
/// Unique profile-acquirer ID.
pub profile_acquirer_id: String,
/// Shop (business profile) the identity belongs to.
pub profile_id: String,
/// Merchant ID the acquirer assigned to this shop.
#[serde(default)]
pub acquirer_assigned_merchant_id: Option<String>,
/// Merchant name as registered with the acquirer.
#[serde(default)]
pub merchant_name: Option<String>,
/// Card network this identity applies to, e.g. `"Visa"`.
#[serde(default)]
pub network: Option<String>,
/// Acquirer BIN.
#[serde(default)]
pub acquirer_bin: Option<String>,
/// Acquirer ICA, where the network requires one.
#[serde(default)]
pub acquirer_ica: Option<String>,
/// Acquirer-reported fraud rate.
#[serde(default)]
pub acquirer_fraud_rate: Option<f64>,
/// Any additional response fields not modeled above.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}
/// A shop's navigation state after an archive or restore.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct ShopArchiveResponse {
/// The shop whose navigation state was saved.
pub profile_id: String,
/// The saved state after the request.
pub is_archived: bool,
/// Any additional response fields not modeled above.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}
/// An archived shop the caller may read.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct ArchivedShopResponse {
/// The shop's identity, unchanged by archiving.
pub profile_id: String,
/// The shop's name.
pub profile_name: String,
/// The shop's project, or `None` for a shop without one.
#[serde(default)]
pub project_id: Option<String>,
/// Always `true` in the archived-shops list.
pub is_archived: bool,
/// Any additional response fields not modeled above.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}
/// A shop's payments switch after it was set.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct ShopPaymentsSwitchResponse {
/// The shop whose switch was saved.
pub profile_id: String,
/// The saved state after the request: `true` while payments are off.
pub payments_disabled: bool,
/// Any additional response fields not modeled above.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}
/// A shop after its card vault was switched off.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct VaultSwitchOffResponse {
/// The shop.
pub profile_id: String,
/// Always `false`: the checkout draws each processor's own card form.
pub vault_enabled: bool,
/// Any additional response fields not modeled above.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}
#[cfg(test)]
mod tests {
use super::*;
/// The response-signing key and webhook credentials must not reach a log
/// line. Mutation: print `&self.payment_response_hash_key` instead of the
/// redacted map — the first assertion goes red.
#[test]
fn debug_redacts_the_signing_key_and_webhook_details() {
let parsed: ProfileResponse = serde_json::from_str(
r#"{
"profile_id": "pro_1",
"profile_name": "Shop",
"payment_response_hash_key": "hashkey_supersecret",
"webhook_details": {"webhook_password": "hunter2"}
}"#,
)
.unwrap();
let rendered = format!("{parsed:?}");
assert!(!rendered.contains("hashkey_supersecret"), "{rendered}");
assert!(!rendered.contains("hunter2"), "{rendered}");
assert!(
rendered.contains("payment_response_hash_key: Some(\"[redacted]\")"),
"{rendered}"
);
assert!(
rendered.contains("webhook_details: Some(\"[redacted]\")"),
"{rendered}"
);
// Non-secret fields still print, or the impl would be useless.
assert!(rendered.contains("Shop"), "{rendered}");
assert!(rendered.contains("pro_1"), "{rendered}");
}
/// A secret the branding response does not model still must not print.
///
/// The narrow field list keeps `payment_response_hash_key` out of a *named*
/// field, but `extra` preserves whatever else the wire carried, so a
/// derived `Debug` prints it in clear text. The type exists precisely
/// because this role must never see that key, and "the endpoint does not
/// send it" is not a property this crate can enforce.
///
/// Mutation: derive `Debug` on `CheckoutBrandingResponse`, or drop **any**
/// key from `PROFILE_SECRET_KEYS`, and the matching secret appears in the
/// output. The fixture carries one sentinel per denylisted key for exactly
/// that reason — a key no fixture exercises can be deleted with the test
/// still green, which makes the stated mutation untrue for that entry.
#[test]
fn branding_debug_redacts_every_denylisted_secret_that_arrived_in_extra() {
let parsed: CheckoutBrandingResponse = serde_json::from_str(
r#"{
"profile_id": "pro_1",
"profile_name": "EU Store",
"payment_link_config": {"theme": "dark"},
"payment_response_hash_key": "hashkey_supersecret",
"webhook_details": {"webhook_password": "hunter2"},
"outgoing_webhook_custom_http_headers": {
"Authorization": "Bearer header_supersecret"
},
"harmless": "keep me"
}"#,
)
.unwrap();
let rendered = format!("{parsed:?}");
assert!(!rendered.contains("hashkey_supersecret"), "{rendered}");
assert!(!rendered.contains("hunter2"), "{rendered}");
assert!(!rendered.contains("header_supersecret"), "{rendered}");
// Every denylisted key is covered by a sentinel above: if this fails,
// a key was added to `PROFILE_SECRET_KEYS` without a fixture entry, so
// deleting it again would leave this test green.
for key in PROFILE_SECRET_KEYS {
assert!(
parsed.extra.contains_key(*key),
"`{key}` is denylisted but not exercised by this fixture"
);
}
// Non-secret entries still print, or the impl would be useless — and
// the redaction has to be visible rather than silent, so a reader can
// see that the router sent something it should not have.
assert!(rendered.contains("keep me"), "{rendered}");
assert!(rendered.contains("[redacted]"), "{rendered}");
assert!(rendered.contains("EU Store"), "{rendered}");
// Kept in the data, so a caller can still notice an over-sending
// router; only the *printing* is redacted.
assert_eq!(
parsed.extra.get("payment_response_hash_key"),
Some(&Value::from("hashkey_supersecret"))
);
}
/// An absent secret must be distinguishable from a present one. Mutation:
/// redacting unconditionally makes this red.
#[test]
fn debug_shows_none_for_absent_secrets() {
let parsed: ProfileResponse = serde_json::from_str(r#"{"profile_id":"pro_1"}"#).unwrap();
let rendered = format!("{parsed:?}");
assert!(
rendered.contains("payment_response_hash_key: None"),
"{rendered}"
);
}
#[test]
fn profile_response_decodes_the_newer_fields() {
let parsed: ProfileResponse = serde_json::from_str(
r#"{"profile_id":"pro_1","payments_disabled":true,"payments_stopped":true,
"shop_url":"https://shop.test","send_order_details_to_processor":false,
"send_payment_id_to_processor":true,"is_external_vault_enabled":"skip",
"product_id_format":{"prefix":"PRD-","style":"numeric","length":6},
"cancel_url":"https://shop.test/cart","default_locale":"de",
"prefer_merchant_locale":true}"#,
)
.unwrap();
assert_eq!(parsed.payments_disabled, Some(true));
assert!(parsed.payments_stopped);
assert_eq!(parsed.is_external_vault_enabled.as_deref(), Some("skip"));
assert_eq!(
parsed.product_id_format.as_ref().unwrap().prefix.as_deref(),
Some("PRD-")
);
assert_eq!(parsed.default_locale.as_deref(), Some("de"));
assert!(parsed.extra.is_empty());
let older: ProfileResponse = serde_json::from_str(r#"{"profile_id":"pro_1"}"#).unwrap();
assert!(!older.payments_stopped);
}
/// The nested id-format config is typed, and unknown top-level fields
/// survive. Mutation: typing `payment_id_format` as `Option<String>` makes
/// the parse fail; dropping `#[serde(flatten)]` on `extra` makes the last
/// lookup return `None`.
#[test]
fn parses_the_payment_id_format_and_keeps_unknown_fields() {
let parsed: ProfileResponse = serde_json::from_str(
r#"{
"profile_id": "pro_1",
"force_3ds_challenge": true,
"iframe_allowed_origins": ["https://shop.test"],
"payment_id_format": {"prefix": "ORD-", "style": "alphanumeric", "length": 8},
"brand_new_field": "x"
}"#,
)
.unwrap();
assert_eq!(parsed.force_3ds_challenge, Some(true));
assert_eq!(
parsed.iframe_allowed_origins.as_deref(),
Some(["https://shop.test".to_string()].as_slice())
);
let format = parsed.payment_id_format.as_ref().unwrap();
assert_eq!(format.prefix.as_deref(), Some("ORD-"));
assert_eq!(format.length, Some(8));
assert_eq!(parsed.extra.get("brand_new_field"), Some(&Value::from("x")));
assert!(!parsed.extra.contains_key("force_3ds_challenge"));
}
/// The acquirer identity deserializes with its numeric fraud rate and keeps
/// unknown fields. Mutation: typing `acquirer_fraud_rate` as
/// `Option<String>` makes this fail to parse.
#[test]
fn profile_acquirer_parses_and_keeps_unknown_fields() {
let parsed: ProfileAcquirerResponse = serde_json::from_str(
r#"{
"profile_acquirer_id": "pa_1",
"profile_id": "pro_1",
"acquirer_assigned_merchant_id": "acq_mid_1",
"merchant_name": "Acme",
"network": "Visa",
"acquirer_bin": "412345",
"acquirer_fraud_rate": 0.02,
"brand_new_field": true
}"#,
)
.unwrap();
assert_eq!(parsed.profile_acquirer_id, "pa_1");
assert_eq!(parsed.acquirer_fraud_rate, Some(0.02));
assert_eq!(parsed.acquirer_ica, None);
assert_eq!(
parsed.extra.get("brand_new_field"),
Some(&Value::from(true))
);
assert!(!parsed.extra.contains_key("network"));
}
}