open_payments_fednow/lib.rs
1// Open Payment Message Parsing Library
2// https://github.com/Open-Payments/messages
3//
4// This library is designed to parse message formats based on the ISO 20022 standards,
5// including but not limited to FedNow messages. It supports various financial message types,
6// such as customer credit transfers, payment status reports, administrative notifications,
7// and other ISO 20022 messages, using Serde for efficient serialization and deserialization.
8//
9// Copyright (c) 2024 Open Payments by Harishankar Narayanan
10// Licensed under the Apache License, Version 2.0 (the "License");
11// you may not use this file except in compliance with the License.
12// You may obtain a copy of the License at
13//
14// http://www.apache.org/licenses/LICENSE-2.0
15//
16// Unless required by applicable law or agreed to in writing, software
17// distributed under the License is distributed on an "AS IS" BASIS,
18// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19// See the License for the specific language governing permissions and
20// limitations under the License.
21//
22// You may obtain a copy of this library at
23// https://github.com/Open-Payments/messages
24
25pub mod fednow_extra;
26pub mod iso;
27pub mod fednow_incoming_external;
28pub mod fednow_outgoing_external;
29pub mod document;
30pub mod common;
31
32use crate::fednow_incoming_external::*;
33use crate::fednow_outgoing_external::*;
34
35#[cfg(feature = "derive_serde")]
36use serde::{Deserialize, Serialize};
37
38#[cfg_attr(feature = "derive_debug", derive(Debug))]
39#[cfg_attr(feature = "derive_clone", derive(Clone))]
40#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
41#[cfg_attr(feature = "derive_default", derive(Default))]
42#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
43pub enum FednowMessage {
44 #[cfg_attr( feature = "derive_serde", serde(rename = "FedNowIncoming") )]
45 FedNowIncoming(Box<FedNowIncoming>),
46
47 #[cfg_attr( feature = "derive_serde", serde(rename = "FedNowOutgoing") )]
48 FedNowOutgoing(Box<FedNowOutgoing>),
49
50 #[cfg_attr(feature = "derive_default", default)]
51 UNKNOWN
52}