delopay 0.20.0

Official Rust SDK for the DeloPay payments API
Documentation
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
//! The saved payment method model, plus the *discovery* response
//! [`PaymentMethods::list`](crate::resources::payment_methods::PaymentMethods::list)
//! returns — a different shape entirely, see [`PaymentMethodListResponse`].

use serde::Deserialize;
use serde_json::Value;

use crate::core::models::common::{Currency, PaymentMethod, PaymentMethodType};

/// A saved payment method as returned by the API.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PaymentMethodResponse {
    /// Merchant account ID.
    pub merchant_id: String,
    /// Unique payment method ID.
    pub payment_method_id: String,
    /// Payment method family.
    pub payment_method: PaymentMethod,
    /// Owning customer, if any.
    #[serde(default)]
    pub customer_id: Option<String>,
    /// Payment method sub-type.
    #[serde(default)]
    pub payment_method_type: Option<PaymentMethodType>,
    /// Whether this method can be charged off-session (recurring).
    #[serde(default)]
    pub recurring_enabled: Option<bool>,
    /// Token to charge this method on a later payment (pass as `payment_token`).
    #[serde(default)]
    pub payment_token: Option<String>,
    /// Lifecycle status.
    #[serde(default)]
    pub status: Option<String>,
    /// ISO 8601 creation timestamp.
    #[serde(default)]
    pub created: Option<String>,
    /// Any additional response fields not modeled above (e.g. `card`).
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// A customer's saved payment methods, as
/// [`PaymentMethods::list_for_customer`](crate::resources::payment_methods::PaymentMethods::list_for_customer)
/// returns them.
///
/// An envelope, not a bare array: `is_guest_customer` rides alongside the list
/// and would be lost if the methods were returned on their own.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct CustomerPaymentMethodsListResponse {
    /// The customer's saved methods.
    #[serde(default = "Vec::new")]
    pub customer_payment_methods: Vec<PaymentMethodResponse>,
    /// Whether the call resolved no stored customer.
    #[serde(default)]
    pub is_guest_customer: Option<bool>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// Human-facing name and icon for a payment method type, so a custom checkout
/// can render without maintaining a parallel name/logo table.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PaymentMethodDisplayInfo {
    /// Canonical name, e.g. `"Credit Card"`, `"PayPal"`. English only for now.
    #[serde(default)]
    pub display_name: Option<String>,
    /// Stable lowercase icon identifier, e.g. `"card"`, `"paypal"`. The same
    /// value as `payment_method_type`, except that `credit` and `debit` share
    /// the `card` slug. Safe to map 1:1 onto your own icon set.
    #[serde(default)]
    pub icon_slug: Option<String>,
    /// Absolute URL to a DeloPay-hosted icon, when icon hosting is configured
    /// for the deployment. Always `null` today — map `icon_slug` against your
    /// own assets.
    #[serde(default)]
    pub icon_url: Option<String>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// A closed, inclusive band of order values in minor units.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct AmountRange {
    pub min_amount: i64,
    pub max_amount: i64,
}

/// The order values a payment method is available for, so a checkout can
/// re-evaluate its own tiles as the cart total changes instead of re-listing on
/// every keystroke.
///
/// A method is available when `min_amount <= amount <= max_amount` **and** the
/// amount falls in none of [`excluded_ranges`](Self::excluded_ranges). Bounds
/// are inclusive minor units in [`currency`](Self::currency); `None` means
/// unbounded on that side.
///
/// Folds together the connector's own configured limits and the merchant's
/// order-value availability rules. Stated in the payment's currency and never
/// converted, which is how the merchant rules are evaluated — so the field is
/// absent when the call resolves no currency.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PaymentMethodAmountLimits {
    /// The currency the bounds are stated in.
    #[serde(default)]
    pub currency: Option<Currency>,
    /// Lowest order value the method stays available for. `None` is unbounded.
    #[serde(default)]
    pub min_amount: Option<i64>,
    /// Highest order value the method stays available for. `None` is unbounded.
    #[serde(default)]
    pub max_amount: Option<i64>,
    /// Bands *inside* `[min_amount, max_amount]` where the method is
    /// nevertheless unavailable, produced by a merchant rule hiding it for a
    /// closed range. Almost always empty — but the backend enforces these rules
    /// on payment create, so a cart total inside one of these bands is
    /// **refused**, not merely untiled. Reading only the outer bounds would
    /// offer a method the API then rejects.
    #[serde(default = "Vec::new")]
    pub excluded_ranges: Vec<AmountRange>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// One payment method type offered for a payment, with what is needed to
/// render it.
///
/// The nested connector shapes (`payment_experience`, `card_networks`,
/// `required_fields`, `surcharge_details`, …) stay raw JSON: they are open
/// connector-driven shapes, and modelling them here would fail a response the
/// checkout could otherwise render.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct ResponsePaymentMethodTypes {
    /// The method sub-type, e.g. `"credit"`, `"ideal"`.
    pub payment_method_type: PaymentMethodType,

    /// Experiences the method can be presented through (open shapes).
    #[serde(default)]
    pub payment_experience: Option<Vec<Value>>,
    /// Card networks offered, each with its own surcharge detail (open shapes).
    #[serde(default)]
    pub card_networks: Option<Vec<Value>>,
    /// Deprecated bank list; use the bank list from `required_fields` instead.
    #[serde(default)]
    pub bank_names: Option<Vec<Value>>,
    /// Bank-debit specifics (open shape).
    #[serde(default)]
    pub bank_debits: Option<Value>,
    /// Bank-transfer specifics (open shape).
    #[serde(default)]
    pub bank_transfers: Option<Value>,
    /// Fields the customer must supply for this method, keyed by field path.
    #[serde(default)]
    pub required_fields: Option<Value>,
    /// Surcharge applied to this method, when the merchant configures one.
    #[serde(default)]
    pub surcharge_details: Option<Value>,
    /// Merchant-internal; omitted for publishable-key callers.
    #[serde(default)]
    pub pm_auth_connector: Option<String>,
    /// Name and icon slug for rendering.
    #[serde(default)]
    pub display: Option<PaymentMethodDisplayInfo>,
    /// The order values this method stays available for.
    #[serde(default)]
    pub amount_limits: Option<PaymentMethodAmountLimits>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// The method types offered under one broad payment method (`card`, `wallet`,
/// …).
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct ResponsePaymentMethodsEnabled {
    /// The broad method family.
    pub payment_method: PaymentMethod,
    /// The sub-types offered under it.
    #[serde(default = "Vec::new")]
    pub payment_method_types: Vec<ResponsePaymentMethodTypes>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// What
/// [`PaymentMethods::list`](crate::resources::payment_methods::PaymentMethods::list)
/// returns: the methods available **for a payment**, already filtered by
/// country, order value and the merchant's availability rules.
///
/// An envelope, not an array of saved methods — `GET /payment-methods` is the
/// discovery endpoint. A customer's stored methods come from
/// [`list_for_customer`](crate::resources::payment_methods::PaymentMethods::list_for_customer).
///
/// Only `payment_methods` is required: everything else is a render hint the
/// server may omit, and a missing hint must not fail a checkout that could
/// otherwise draw its tiles.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PaymentMethodListResponse {
    /// The methods available for this payment, grouped by method family.
    #[serde(default = "Vec::new")]
    pub payment_methods: Vec<ResponsePaymentMethodsEnabled>,

    /// The payment's currency.
    #[serde(default)]
    pub currency: Option<Currency>,
    /// Where to send the buyer after an off-site step.
    #[serde(default)]
    pub redirect_url: Option<String>,
    /// Mandate type the payment sets up, when any.
    #[serde(default)]
    pub mandate_payment: Option<Value>,
    /// Merchant display name for the checkout.
    #[serde(default)]
    pub merchant_name: Option<String>,
    /// Whether the checkout must show the surcharge breakup screen.
    #[serde(default)]
    pub show_surcharge_breakup_screen: Option<bool>,
    /// Payment type, e.g. `"normal"`.
    #[serde(default)]
    pub payment_type: Option<String>,
    /// Whether external 3DS authentication is requested.
    #[serde(default)]
    pub request_external_three_ds_authentication: Option<bool>,
    /// Whether wallets should collect shipping details.
    #[serde(default)]
    pub collect_shipping_details_from_wallets: Option<bool>,
    /// Whether wallets should collect billing details.
    #[serde(default)]
    pub collect_billing_details_from_wallets: Option<bool>,
    /// Whether tax calculation runs for this payment.
    #[serde(default)]
    pub is_tax_calculation_enabled: Option<bool>,
    /// The next action the SDK should take (open shape).
    #[serde(default)]
    pub sdk_next_action: Option<Value>,
    /// Whether the call resolved no stored customer.
    #[serde(default)]
    pub is_guest_customer: Option<bool>,
    /// Payment intent details, present when the call was made with a client
    /// secret — so a checkout can render without a second round-trip. Open
    /// shape.
    #[serde(default)]
    pub intent_data: Option<Value>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

#[cfg(test)]
mod tests {
    use super::*;

    /// The discovery endpoint answers with an envelope, not an array of saved
    /// methods. Mutation: typing `list` as `Vec<PaymentMethodResponse>` — the
    /// shape this test pins — makes every field below unreachable.
    #[test]
    fn discovery_response_parses_the_envelope_with_display_and_limits() {
        let listed: PaymentMethodListResponse = serde_json::from_str(
            r#"{
                "currency": "EUR",
                "merchant_name": "Shop",
                "payment_methods": [
                    {
                        "payment_method": "card",
                        "payment_method_types": [
                            {
                                "payment_method_type": "credit",
                                "display": {"display_name": "Credit Card", "icon_slug": "card"},
                                "amount_limits": {
                                    "currency": "EUR",
                                    "min_amount": 100,
                                    "max_amount": 500000,
                                    "excluded_ranges": [{"min_amount": 1000, "max_amount": 1999}]
                                }
                            }
                        ]
                    }
                ]
            }"#,
        )
        .unwrap();

        let group = &listed.payment_methods[0];
        let method = &group.payment_method_types[0];
        assert_eq!(
            method.display.as_ref().unwrap().icon_slug.as_deref(),
            Some("card")
        );
        let limits = method.amount_limits.as_ref().unwrap();
        assert_eq!(limits.min_amount, Some(100));
        // The closed excluded band is the field a client reading only the outer
        // bounds would miss — and the backend refuses a create inside it.
        assert_eq!(limits.excluded_ranges[0].min_amount, 1000);
        assert_eq!(limits.excluded_ranges[0].max_amount, 1999);
    }

    /// Render hints are optional: a response carrying only the method list must
    /// still deserialize, or a checkout that could draw its tiles fails instead.
    #[test]
    fn discovery_response_tolerates_missing_render_hints() {
        let listed: PaymentMethodListResponse = serde_json::from_str(
            r#"{"payment_methods":[{"payment_method":"wallet","payment_method_types":[]}]}"#,
        )
        .unwrap();
        assert_eq!(listed.payment_methods.len(), 1);
        assert_eq!(listed.currency, None);
        assert_eq!(listed.sdk_next_action, None);
    }

    /// `is_guest_customer` rides alongside the list and would be lost if the
    /// saved methods were returned as a bare array.
    #[test]
    fn customer_saved_methods_parse_as_an_envelope() {
        let listed: CustomerPaymentMethodsListResponse = serde_json::from_str(
            r#"{
                "customer_payment_methods": [
                    {"merchant_id":"mer_1","payment_method_id":"pm_1","payment_method":"card"}
                ],
                "is_guest_customer": false
            }"#,
        )
        .unwrap();
        assert_eq!(listed.customer_payment_methods[0].payment_method_id, "pm_1");
        assert_eq!(listed.is_guest_customer, Some(false));
    }
}

/// The shop's payment buttons as the hosted checkout draws them, returned by
/// [`PaymentMethods::presentation`](crate::resources::payment_methods::PaymentMethods::presentation).
///
/// A displayed entry is not a promise: the payment is confirmed against the
/// current configuration.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PaymentMethodPresentationResponse {
    /// The response contract this answer follows.
    pub contract_version: u32,
    /// Changes exactly when anything else in the response changes; also the
    /// `ETag`.
    pub revision: String,
    /// Which question the response answers: `"shop"` (before any payment)
    /// or `"payment"`.
    pub scope: String,
    /// The environment the entries are for: `"live"` or `"test"`.
    pub environment: String,
    /// The language `label` and `sublabel` are in.
    pub locale: String,
    /// The buyer context the answer was resolved for.
    pub context: PresentationContext,
    /// Whether the shop has anything to show: `"ready"`, `"not_configured"`
    /// or `"no_eligible_methods"`.
    pub status: String,
    /// Whether the layout is the merchant's own (`"stored"`) or derived from
    /// the shop's connector accounts (`"derived"`).
    pub layout_source: String,
    /// How long the answer may be reused.
    pub cache: PresentationCachePolicy,
    /// The entries, in display order.
    #[serde(default)]
    pub entries: Vec<PaymentMethodPresentationEntry>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// The buyer context a presentation was resolved for. A field left `None`
/// was not applied.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PresentationContext {
    /// ISO 3166-1 alpha-2 buyer country.
    #[serde(default)]
    pub country: Option<String>,
    /// ISO 4217 currency.
    #[serde(default)]
    pub currency: Option<Currency>,
    /// Amount in minor units of `currency`.
    #[serde(default)]
    pub amount: Option<i64>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// How long a presentation may be reused. Also sent as `Cache-Control`.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PresentationCachePolicy {
    /// Seconds the answer may be reused without asking again. `0` for a
    /// payment's answer, which is never reused.
    pub max_age_seconds: u32,
    /// Seconds past `max_age_seconds` the last answer may still be shown
    /// while the API cannot be reached. `0` for a payment's answer.
    pub stale_if_error_seconds: u32,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// One payment button, heading or group of a presentation.
///
/// New kinds may be added within a contract version: skip an entry whose
/// [`kind`](Self::kind) you do not know.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PaymentMethodPresentationEntry {
    /// Stable for the same placement in the same shop and environment,
    /// across revisions.
    pub id: String,
    /// `"method"`, `"card"`, `"general"`, `"heading"` or `"group"`.
    pub kind: String,
    /// Where the entry sits: `"express"`, `"normal"` or `"alternative"`.
    pub tier: String,
    /// The express row, from 0. `None` outside the express strip.
    #[serde(default)]
    pub row: Option<u32>,
    /// The resolved text in the response's `locale`.
    pub label: String,
    /// The resolved second line, if any.
    #[serde(default)]
    pub sublabel: Option<String>,
    /// Who chose `label`: `"merchant"` or `"default"`.
    pub label_source: String,
    /// Who chose `sublabel`: `"merchant"` or `"default"`.
    pub sublabel_source: String,
    /// The catalogue section (`wallet`, `bank`, `bnpl`, `crypto`, `card`,
    /// …). `None` on headings.
    #[serde(default)]
    pub category: Option<String>,
    /// The entry's artwork.
    #[serde(default)]
    pub icon: Option<PresentationIcon>,
    /// The built-in glyph to draw when `icon` cannot be. `None` on headings.
    #[serde(default)]
    pub fallback_icon: Option<String>,
    /// Payment method family.
    #[serde(default)]
    pub payment_method: Option<PaymentMethod>,
    /// Payment method sub-type.
    #[serde(default)]
    pub payment_method_type: Option<PaymentMethodType>,
    /// The provider's brand as a buyer reads it, only where two entries
    /// would otherwise look the same.
    #[serde(default)]
    pub provider_name: Option<String>,
    /// Drawn only where the buyer's device or browser supports it (Apple
    /// Pay, Google Pay).
    pub requires_device_support: bool,
    /// Whether the buyer still chooses after selecting the entry: `"none"`
    /// or `"provider"`.
    pub further_choice: String,
    /// How much is known about what the entry contains: `"none"`,
    /// `"category"`, `"partial"` or `"known"`.
    pub children_detail: String,
    /// Descriptive badges.
    #[serde(default)]
    pub children: Vec<PresentationChild>,
    /// Why `children` holds what it holds: `"not_applicable"`,
    /// `"available"`, `"unknown"`, `"context_required"` or
    /// `"lookup_failed"`.
    pub children_status: String,
    /// Where the list of children comes from: `"provider"`,
    /// `"account_configuration"` or `"merchant"`.
    #[serde(default)]
    pub children_source: Option<String>,
    /// ISO 8601 time the provider gave the answer, or the account was last
    /// changed.
    #[serde(default)]
    pub children_checked_at: Option<String>,
    /// The provider could not be asked just now, and the list is its last
    /// stored answer.
    pub children_stale: bool,
    /// The merchant's selection narrowed the list.
    pub children_narrowed: bool,
    /// What selecting the entry does.
    #[serde(default)]
    pub action: Option<PresentationAction>,
    /// `kind: "group"` only: the entries the group opens, in the merchant's
    /// order.
    #[serde(default)]
    pub members: Option<Vec<PaymentMethodPresentationEntry>>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// An entry's or child's artwork: one of the built-in glyphs
/// (`kind == "builtin"`, named by [`key`](Self::key)) or an SVG document
/// (`kind == "svg"`, in [`data_uri`](Self::data_uri)).
///
/// Draw `data_uri` with an image element, never as inline markup.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PresentationIcon {
    /// `"builtin"` or `"svg"` (the wire field `type`).
    #[serde(rename = "type")]
    pub kind: String,
    /// The built-in glyph's name, for `"builtin"`.
    #[serde(default)]
    pub key: Option<String>,
    /// The SVG document as a data URI, for `"svg"`.
    #[serde(default)]
    pub data_uri: Option<String>,
    /// Hex SHA-256 of the SVG document, for `"svg"`. Changes exactly when the
    /// artwork does.
    #[serde(default)]
    pub sha256: Option<String>,
    /// Who chose the SVG: `"merchant"` or `"default"`.
    #[serde(default)]
    pub source: Option<String>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// A descriptive badge of a presentation entry: a card network, a method or
/// a crypto asset it contains.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PresentationChild {
    /// Stable across shops, accounts and revisions, e.g. `card_network:visa`.
    pub id: String,
    /// `"method"`, `"card_network"` or `"crypto_asset"`.
    pub kind: String,
    /// Display text.
    pub label: String,
    /// The child's artwork.
    #[serde(default)]
    pub icon: Option<PresentationIcon>,
    /// Where the child comes from: `"provider"`, `"account_configuration"`
    /// or `"merchant"`.
    pub source: String,
    /// `"display_only"` or `"direct"` (can be chosen on its own).
    pub selection: String,
    /// The entry of the same response that offers the child on its own. Set
    /// exactly when `selection` is `"direct"`.
    #[serde(default)]
    pub direct_entry_id: Option<String>,
    /// Payment method sub-type.
    #[serde(default)]
    pub payment_method_type: Option<PaymentMethodType>,
    /// `kind: "crypto_asset"`: the coin's ticker (`USDT`).
    #[serde(default)]
    pub code: Option<String>,
    /// `kind: "crypto_asset"`: the network the coin is offered on.
    #[serde(default)]
    pub network: Option<PresentationCryptoNetwork>,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// A crypto network a presentation child is offered on.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PresentationCryptoNetwork {
    /// Stable: `bitcoin`, `ethereum`, `tron`, `bsc`, …
    pub id: String,
    /// Display text.
    pub label: String,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}

/// What selecting a presentation entry does.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PresentationAction {
    /// `"hosted_checkout"` (create the payment and send the buyer to its
    /// hosted checkout) or `"open_group"` (show the entry's `members`; it
    /// creates no payment). The wire field `type`.
    #[serde(rename = "type")]
    pub kind: String,
    /// Any additional response fields not modeled above.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, Value>,
}