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
//! Processor cost schedule models: what the processor a merchant brought
//! itself charges it, as configured contract rates.
use serde::Deserialize;
use serde_json::Value;
/// A recorded processor cost schedule.
///
/// A schedule prices the rails that report no fee on the payment itself. The
/// cost it produces is stamped `estimated` on the settlement line, never
/// `reported`.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct ProcessorCostScheduleResponse {
/// Schedule ID.
pub id: String,
/// The merchant the schedule belongs to.
#[serde(default)]
pub merchant_id: Option<String>,
/// The one shop it covers. `None` covers every shop.
#[serde(default)]
pub shop_id: Option<String>,
/// The connector the rate belongs to, e.g. `"stripe"`.
pub connector: String,
/// Payment-method scope, e.g. `"card"`. `None` covers any method.
#[serde(default)]
pub payment_method: Option<String>,
/// Card-network scope, e.g. `"Visa"`. `None` covers any network.
#[serde(default)]
pub card_network: Option<String>,
/// Payment-method-type scope. `None` covers any type.
#[serde(default)]
pub payment_method_type: Option<String>,
/// The processor's own method identifier the rate is scoped to.
#[serde(default)]
pub connector_method_code: Option<String>,
/// The processor's own commission, in percent.
#[serde(default)]
pub percentage: Option<f64>,
/// The underlying provider's fee, in percent, added to
/// [`percentage`](Self::percentage).
#[serde(default)]
pub provider_fee_percentage: Option<f64>,
/// Flat component in minor units of [`flat_currency`](Self::flat_currency).
#[serde(default)]
pub flat_amount: Option<i64>,
/// ISO 4217 currency of the fixed components. `None` states them in the
/// transaction currency.
#[serde(default)]
pub flat_currency: Option<String>,
/// Per-transaction floor.
#[serde(default)]
pub min_amount: Option<i64>,
/// Per-transaction ceiling.
#[serde(default)]
pub max_amount: Option<i64>,
/// When the rate starts applying (ISO 8601).
pub effective_from: String,
/// When it stops applying (ISO 8601, exclusive). `None` while open-ended.
#[serde(default)]
pub effective_to: Option<String>,
/// Whether the schedule is active.
pub is_active: bool,
/// Free-text note.
#[serde(default)]
pub description: Option<String>,
/// Any additional response fields not modeled above.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}