Skip to main content

Transaction

Struct Transaction 

Source
pub struct Transaction {
Show 28 fields pub date: Date, pub valuta_date: Option<Date>, pub amount: Decimal, pub currency: Currency, pub applicant_name: Option<String>, pub applicant_iban: Option<Iban>, pub applicant_bic: Option<Bic>, pub purpose: Option<String>, pub posting_text: Option<String>, pub customer_reference: Option<String>, pub bank_reference: Option<String>, pub booking_id: Option<String>, pub gvc: Option<String>, pub prima_nota: Option<String>, pub purpose_code: Option<String>, pub mandate_id: Option<String>, pub end_to_end_id: Option<String>, pub creditor_id: Option<String>, pub debtor_id: Option<String>, pub ultimate_debtor: Option<String>, pub ultimate_creditor: Option<String>, pub reversal: bool, pub original_amount: Option<(Decimal, Currency)>, pub fees: Option<(Decimal, Currency)>, pub return_reason: Option<String>, pub sequence_type: Option<String>, pub raw: Value, pub status: TransactionStatus,
}
Available on non-crate feature tooling only.
Expand description

A parsed transaction.

A camt entry (Ntry) with several TxDtls (a batch booking) maps to one Transaction, built from the first TxDtls: the counterparty and purpose fields describe only that part of the batch. The amount is the entry’s, and booking_id is the entry’s own reference.

Fields§

§date: Date

Booking date (Buchungstag): the MT940 entry date, or the value date when the bank leaves the entry date out. A pending CAMT entry with neither date takes the day the bank made the report (CreDtTm).

§valuta_date: Option<Date>

Value date (Valuta, Wertstellung).

§amount: Decimal

Signed from the account holder’s view: negative = debit.

§currency: Currency§applicant_name: Option<String>§applicant_iban: Option<Iban>§applicant_bic: Option<Bic>§purpose: Option<String>

Remittance text: the SEPA SVWZ+ value of MT940 :86:, or CAMT Ustrd (None when the entry has none; its AddtlNtryInf is the posting_text). In MT940 without SEPA keywords, the whole :86: text. The keywords themselves and the other SEPA fields have their own fields; MT940 keeps the joined :86: text in raw["tag86"]. Characters are as the bank sent them.

§posting_text: Option<String>

Booking text (Buchungstext), e.g. “SEPA-BASISLASTSCHRIFT”.

§customer_reference: Option<String>

Customer reference (Kundenreferenz) from MT940 :61:; None for “NONREF”. CAMT has no such field: always None there (the end-to-end ID is end_to_end_id).

§bank_reference: Option<String>

Bank reference from :61: (after //), or CAMT AcctSvcrRef (transaction level before entry level), if the bank sends one. Not known to be unique: for de-duplication use booking_id.

§booking_id: Option<String>

The bank’s own ID of this booking, set only where the bank’s profile (BookingIdSource) names a reference the bank keeps unique and stable: no two transactions of a statement share it, and the bank does not reuse it for another booking. Safe as a key for de-duplication across fetches.

None for banks without such a reference, for every MT940 booking, for pending bookings (whether a booking keeps its reference from pending to booked is unverified at any bank), for an entry without the reference, and for a reference that occurs more than once in one statement.

§gvc: Option<String>

The DK business transaction code (Geschäftsvorfallcode, three digits) at the start of :86:; 166 is a SEPA credit transfer received.

§prima_nota: Option<String>

The bank’s Primanota number, subfield ?10 of :86:.

§purpose_code: Option<String>

ISO 20022 purpose code (e.g. SALA, IDCP): PURP+ or Purp/Cd.

§mandate_id: Option<String>

SEPA direct debit mandate reference (MREF+, MndtId). None for a placeholder such as NONREF.

§end_to_end_id: Option<String>

SEPA end-to-end reference (EREF+, EndToEndId). None for a placeholder such as NOTPROVIDED.

§creditor_id: Option<String>

SEPA creditor ID of a direct debit (CRED+ of MT940 :86:, CAMT Cdtr/Id/PrvtId/Othr/Id). None for a placeholder.

§debtor_id: Option<String>

SEPA identifier of the debtor (DEBT+ of MT940 :86:, CAMT Dbtr/Id): the originator ID of a transfer or the debtor’s own ID. None for a placeholder.

§ultimate_debtor: Option<String>

The ultimate debtor (Abweichender Zahlungspflichtiger) when it differs from the direct one: CAMT UltmtDbtr/Nm; MT940 ABWA+ of a transfer, ABWE+ of a direct debit. For an R-transaction (return, reversal) the original payment’s roles.

§ultimate_creditor: Option<String>

The ultimate creditor (Abweichender Zahlungsempfänger): CAMT UltmtCdtr/Nm; MT940 ABWE+ of a transfer, ABWA+ of a direct debit.

§reversal: bool

Whether the booking is a reversal (Storno): CAMT RvslInd true, MT940 :61: mark RC or RD.

§original_amount: Option<(Decimal, Currency)>

Original amount before conversion or before a return, with its currency (always positive): CAMT AmtDtls/InstdAmt/Amt; MT940 OAMT+, which carries no currency, so the statement currency is used.

§fees: Option<(Decimal, Currency)>

Fees or compensation charged on the booking, positive: CAMT Chrgs (TtlChrgsAndTaxAmt, else the first Rcrd/Amt); MT940 COAM+ in the statement currency.

§return_reason: Option<String>

Return or rejection reason code (e.g. AC04, MD06): CAMT RtrInf/Rsn/Cd; MT940 the code after the REJECT/RETURN marker in SVWZ+.

§sequence_type: Option<String>

Direct debit sequence type (FRST, RCUR, OOFF, FNAL): CAMT PmtTpInf/SeqTp. MT940 has no such field.

§raw: Value§status: TransactionStatus

Whether this transaction is booked or pending.

Trait Implementations§

Source§

impl Clone for Transaction

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Transaction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Transaction

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Transaction

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more