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
//! The hosted payment link model.
use serde::Deserialize;
use serde_json::Value;
/// A hosted payment link as returned by the API.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct PaymentLinkResponse {
/// The shopper-facing payment link URL.
pub link: String,
/// Unique payment link ID.
pub payment_link_id: String,
/// Secure variant of the link, when the API issues one.
#[serde(default)]
pub secure_link: Option<String>,
/// The origin (scheme, host and port) of the website the buyer arrived
/// from when the hosted checkout first opened.
#[serde(default)]
pub site_origin: Option<String>,
/// Any additional response fields not modeled above.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}
/// One payment link, as [`PaymentLinks::retrieve`](crate::resources::payment_links::PaymentLinks::retrieve)
/// answers it.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct RetrievePaymentLinkResponse {
/// Identifier of the payment link.
pub payment_link_id: String,
/// The merchant the link belongs to.
pub merchant_id: String,
/// The open link, without security checks or saved payment methods.
pub link_to_pay: String,
/// The payment amount, in minor units.
pub amount: i64,
/// ISO 8601 creation time.
pub created_at: String,
/// ISO 8601 expiry time.
#[serde(default)]
pub expiry: Option<String>,
/// Description of the link.
#[serde(default)]
pub description: Option<String>,
/// `"active"` or `"expired"`.
pub status: String,
/// Three-letter ISO 4217 currency code.
#[serde(default)]
pub currency: Option<String>,
/// The secure link, with security checks and saved payment methods.
#[serde(default)]
pub secure_link: Option<String>,
/// Any additional response fields not modeled above.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}
/// The merchant and payment an opaque hosted checkout link opens.
///
/// A link the API issues names only its `payment_link_id`, so neither the
/// merchant nor the payment can be read off it; this answers which ones it
/// means.
#[derive(Debug, Clone, Deserialize)]
#[non_exhaustive]
pub struct CheckoutLinkResolveResponse {
/// The merchant the payment belongs to.
pub merchant_id: String,
/// The payment the link opens.
pub payment_id: String,
/// Any additional response fields not modeled above.
#[serde(flatten)]
pub extra: serde_json::Map<String, Value>,
}