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
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 = "..."; let transactions = camt::CamtTransaction::parse(xml_content)?;
for tx in transactions {
println!("{}: {} from {}", tx.id(), tx.amount(), tx.debtor_name());
}
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
let output = value.id
Allows a get operation to work.
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.
let output = value.status
Allows a get operation to work.
value.status = input
Allows a set operation to work.
let output = value.book_date
Allows a get operation to work.
value.book_date = input
Allows a set operation to work.
let output = value.amount
Allows a get operation to work.
value.amount = input
Allows a set operation to work.
let output = value.direction
Allows a get operation to work.
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.
let output = value.reference
Allows a get operation to work.
value.reference = input
Allows a set operation to work.
let output = value.debtor_iban
Allows a get operation to work.
value.debtor_iban = input
Allows a set operation to work.
let output = value.debtor_name
Allows a get operation to work.
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.
let output = value.source
Allows a get operation to work.
value.source = input
Allows a set operation to work.
println("{}", value)
Allows the value to be display printed.
println("{:?}", value)
Allows the value to be debug printed.