hanzo_client/models/collected.rs
1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Collected {
16 /// BalanceUsedCents is how much was covered by prepaid balance.
17 #[serde(rename = "balanceUsedCents", skip_serializing_if = "Option::is_none")]
18 pub balance_used_cents: Option<i32>,
19 /// CardChargedCents is how much was charged to the card on file.
20 #[serde(rename = "cardChargedCents", skip_serializing_if = "Option::is_none")]
21 pub card_charged_cents: Option<i32>,
22 /// CreditUsedCents is how much was covered by credit grants.
23 #[serde(rename = "creditUsedCents", skip_serializing_if = "Option::is_none")]
24 pub credit_used_cents: Option<i32>,
25 /// Invoice is the invoice AFTER the attempt — its status is the authority on what happened, not this struct's other fields.
26 #[serde(rename = "invoice", skip_serializing_if = "Option::is_none")]
27 pub invoice: Option<Box<models::Invoice>>,
28 /// Paid reports whether the invoice is now settled in full. A false here with no error is a DECLINE: the invoice stays open and may be collected again.
29 #[serde(rename = "paid", skip_serializing_if = "Option::is_none")]
30 pub paid: Option<bool>,
31 /// ProcessorRef is the processor's reference for any card charge — the field that proves money moved at the gateway rather than only in our ledger.
32 #[serde(rename = "processorRef", skip_serializing_if = "Option::is_none")]
33 pub processor_ref: Option<String>,
34 /// Reason explains a decline or partial collection. Empty on success.
35 #[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
36 pub reason: Option<String>,
37}
38
39impl Collected {
40 pub fn new() -> Collected {
41 Collected {
42 balance_used_cents: None,
43 card_charged_cents: None,
44 credit_used_cents: None,
45 invoice: None,
46 paid: None,
47 processor_ref: None,
48 reason: None,
49 }
50 }
51}
52