Struct ::camt::CamtTransaction

Overview

A unified transaction structure that represents a single transaction from either CAMT.053 or CAMT.054 formats.

This structure provides a consistent interface for accessing transaction data regardless of the original CAMT format.

Methods

fn parse(content: String) -> Result

Parse CAMT transaction data from a string

Automatically detects the format and uses the appropriate parser. Supported formats:

  • CAMT.053 XML (Bank-to-Customer Account Statement)
  • CAMT.054 XML (Bank-to-Customer Debit Credit Notification)
  • Raise Now CSV (Donation platform export)

Example

let xml_content = "..."; // Your CAMT XML content
let transactions = camt::CamtTransaction::parse(xml_content)?;
for tx in transactions {
   println!("{}: {} from {}", tx.id(), tx.amount(), tx.debtor_name());
}
fn id(self) -> Reference

Get the transaction ID

Example

let transactions = camt::CamtTransaction::parse(content)?;
let id = transactions[0].id();

Get the creditor IBAN

Example

let transactions = camt::CamtTransaction::parse(content)?;
let iban = transactions[0].creditor_iban();

Get the transaction status

Example

let transactions = camt::CamtTransaction::parse(content)?;
let status = transactions[0].status();

Get the booking date

Example

let transactions = camt::CamtTransaction::parse(content)?;
let date = transactions[0].book_date();

Get the transaction amount

Example

let transactions = camt::CamtTransaction::parse(content)?;
let amount = transactions[0].amount();

Get the transaction direction

Example

let transactions = camt::CamtTransaction::parse(content)?;
let direction = transactions[0].direction();

Get additional information about the transaction

Example

let transactions = camt::CamtTransaction::parse(content)?;
let info = transactions[0].additional_info();

Get the transaction reference

Example

let transactions = camt::CamtTransaction::parse(content)?;
let reference = transactions[0].reference();

Get the debtor IBAN

Example

let transactions = camt::CamtTransaction::parse(content)?;
let iban = transactions[0].debtor_iban();

Get the debtor name

Example

let transactions = camt::CamtTransaction::parse(content)?;
let name = transactions[0].debtor_name();

Get the debtor location

Example

let transactions = camt::CamtTransaction::parse(content)?;
let location = transactions[0].debtor_location();

Get the transaction source

Example

let transactions = camt::CamtTransaction::parse(content)?;
let source = transactions[0].source();

Clone the CamtTransaction

Example

let transactions = camt::CamtTransaction::parse(content)?;
let cloned = transactions[0].clone();

Protocols

protocol get id
let output = value.id

Allows a get operation to work.

protocol set id
value.id = input

Allows a set operation to work.

protocol get creditor_iban
let output = value.creditor_iban

Allows a get operation to work.

protocol set creditor_iban
value.creditor_iban = input

Allows a set operation to work.

protocol get status
let output = value.status

Allows a get operation to work.

protocol set status
value.status = input

Allows a set operation to work.

protocol get book_date
let output = value.book_date

Allows a get operation to work.

protocol set book_date
value.book_date = input

Allows a set operation to work.

protocol get amount
let output = value.amount

Allows a get operation to work.

protocol set amount
value.amount = input

Allows a set operation to work.

protocol get direction
let output = value.direction

Allows a get operation to work.

protocol set direction
value.direction = input

Allows a set operation to work.

protocol get additional_info
let output = value.additional_info

Allows a get operation to work.

protocol set additional_info
value.additional_info = input

Allows a set operation to work.

protocol get reference
let output = value.reference

Allows a get operation to work.

protocol set reference
value.reference = input

Allows a set operation to work.

protocol get debtor_iban
let output = value.debtor_iban

Allows a get operation to work.

protocol set debtor_iban
value.debtor_iban = input

Allows a set operation to work.

protocol get debtor_name
let output = value.debtor_name

Allows a get operation to work.

protocol set debtor_name
value.debtor_name = input

Allows a set operation to work.

protocol get debtor_location
let output = value.debtor_location

Allows a get operation to work.

protocol set debtor_location
value.debtor_location = input

Allows a set operation to work.

protocol get source
let output = value.source

Allows a get operation to work.

protocol set source
value.source = input

Allows a set operation to work.

protocol string_display
println("{}", value)

Allows the value to be display printed.

protocol string_debug
println("{:?}", value)

Allows the value to be debug printed.