api_revenue.rs (1937B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2025 Taler Systems SA 4 5 TALER is free software; you can redistribute it and/or modify it under the 6 terms of the GNU Affero General Public License as published by the Free Software 7 Foundation; either version 3, or (at your option) any later version. 8 9 TALER is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 12 13 You should have received a copy of the GNU Affero General Public License along with 14 TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 */ 16 17 //! Type for the Taler Wire Gateway HTTP API <https://docs.taler.net/core/api-bank-wire.html#taler-wire-gateway-http-api> 18 19 use crate::types::{amount::Amount, payto::PaytoURI, timestamp::TalerTimestamp}; 20 21 use super::api_common::SafeU64; 22 use serde::{Deserialize, Serialize}; 23 24 /// <https://docs.taler.net/core/api-bank-revenue.html#tsref-type-RevenueConfig> 25 #[derive(Debug, Clone, Serialize, Deserialize)] 26 pub struct RevenueConfig<'a> { 27 pub name: &'a str, 28 pub version: &'a str, 29 pub currency: &'a str, 30 pub implementation: Option<&'a str>, 31 } 32 33 /// <https://docs.taler.net/core/api-bank-revenue.html#tsref-type-RevenueIncomingHistory> 34 #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] 35 pub struct RevenueIncomingHistory { 36 pub incoming_transactions: Vec<RevenueIncomingBankTransaction>, 37 pub credit_account: PaytoURI, 38 } 39 40 /// <https://docs.taler.net/core/api-bank-revenue.html#tsref-type-RevenueIncomingBankTransaction> 41 #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] 42 pub struct RevenueIncomingBankTransaction { 43 pub row_id: SafeU64, 44 pub date: TalerTimestamp, 45 pub amount: Amount, 46 pub credit_fee: Option<Amount>, 47 pub debit_account: PaytoURI, 48 pub subject: String, 49 }