Skip to main content

btcpay_client/models/
checkout_options.rs

1/*
2 * BTCPay Greenfield API
3 *
4 * A full API to use your BTCPay Server
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10use crate::models::time_span_minutes::TimeSpanMinutes;
11
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct CheckoutOptions {
15    #[serde(rename = "speedPolicy", skip_serializing_if = "Option::is_none")]
16    pub speed_policy: Option<crate::models::SpeedPolicy>,
17    /// A specific set of payment methods to use for this invoice (ie. BTC, BTC-LightningNetwork). By default, select all payment methods enabled in the store.
18    #[serde(rename = "paymentMethods", skip_serializing_if = "Option::is_none")]
19    pub payment_methods: Option<Vec<String>>,
20    /// Default payment type for the invoice (e.g., BTC, BTC-LightningNetwork). Default payment method set for the store is used if this parameter is not specified.
21    #[serde(rename = "defaultPaymentMethod", skip_serializing_if = "Option::is_none")]
22    pub default_payment_method: Option<String>,
23    /// The number of minutes after which an invoice becomes expired. Defaults to the store's settings. (The default store settings is 15)
24    #[serde(rename = "expirationMinutes", skip_serializing_if = "Option::is_none")]
25    pub expiration_minutes: Option<Box<TimeSpanMinutes>>,
26    /// The number of minutes after an invoice expired after which we are still monitoring for incoming payments. Defaults to the store's settings. (The default store settings is 1440, 1 day)
27    #[serde(rename = "monitoringMinutes", skip_serializing_if = "Option::is_none")]
28    pub monitoring_minutes: Option<Box<TimeSpanMinutes>>,
29    /// A percentage determining whether to count the invoice as paid when the invoice is paid within the specified margin of error. Defaults to the store's settings. (The default store settings is 100)
30    #[serde(rename = "paymentTolerance", skip_serializing_if = "Option::is_none")]
31    pub payment_tolerance: Option<f64>,
32    /// When the customer has paid the invoice, the URL where the customer will be redirected when clicking on the `return to store` button. You can use placeholders `{InvoiceId}` or `{OrderId}` in the URL, BTCPay Server will replace those with this invoice `id` or `metadata.orderId` respectively.
33    #[serde(rename = "redirectURL", skip_serializing_if = "Option::is_none")]
34    pub redirect_url: Option<String>,
35    /// When the customer has paid the invoice, and a `redirectURL` is set, the checkout is redirected to `redirectURL` automatically if `redirectAutomatically` is true. Defaults to the store's settings. (The default store settings is false)
36    #[serde(rename = "redirectAutomatically", skip_serializing_if = "Option::is_none")]
37    pub redirect_automatically: Option<bool>,
38    /// Invoice will require user to provide a refund email if this option is set to `true`. Has no effect if `buyerEmail` metadata is set as there is no email to collect in this case.
39    #[serde(rename = "requiresRefundEmail", skip_serializing_if = "Option::is_none")]
40    pub requires_refund_email: Option<bool>,
41    /// The language code (eg. en-US, en, fr-FR...) of the language presented to your customer in the checkout page. BTCPay Server tries to match the best language available. If null or not set, will fallback on the store's default language. You can see the list of language codes with [this operation](#operation/langCodes).
42    #[serde(rename = "defaultLanguage", skip_serializing_if = "Option::is_none")]
43    pub default_language: Option<String>,
44}
45
46impl CheckoutOptions {
47    pub fn new() -> CheckoutOptions {
48        CheckoutOptions {
49            speed_policy: None,
50            payment_methods: None,
51            default_payment_method: None,
52            expiration_minutes: None,
53            monitoring_minutes: None,
54            payment_tolerance: None,
55            redirect_url: None,
56            redirect_automatically: None,
57            requires_refund_email: None,
58            default_language: None,
59        }
60    }
61}
62
63