Expand description
A Rust library to manage ISO 20022 pain.001 payment initiation messages widely used for corporate to bank payments.
Overview
Payment Initiation (PI) is a library that provides a set of structs
and enums that can be used to serialize and deserialize SEPA payment
information using the serde
library.
The structs include Payment, OriginalGroupInfoAndStatus, PaymentInfo, PaymentTypeInfo, ServiceLevel, Debtor, PostalAddress, DebtorAccount, AccountId, DebtorAgent, FinancialInstitutionId, CreditTransferTransactionInfo, PaymentId, Amount, InstructedAmount, Creditor, CreditorAccount, RemittanceInfo, and CreditorAgent.
The enum is PaymentFormat and has four variants: Pain001_001_02, Pain001_001_03, Pain001_001_04, and Pain001_001_05.
PaymentFormat
The PaymentFormat
enum defines the different formats of payment supported by the system.
Payment
The Payment
struct is the main data structure used to represent a payment. It contains the following fields:
payment_format
: The format of the payment, represented by thePaymentFormat
enum.original_group_info_and_status
: Information about the original group and its status, represented by theOriginalGroupInfoAndStatus
struct.payment_info
: Information about the payment, represented by thePaymentInfo
struct.
OriginalGroupInfoAndStatus
The OriginalGroupInfoAndStatus
struct contains information about the original group and its status. It has the following fields:
original_message_id
: The original message ID.original_message_name_id
: The original message name ID.group_status
: The status of the group.
PaymentInfo
The PaymentInfo
struct contains information about the payment. It has the following fields:
payment_info_id
: The ID of the payment information.payment_method
: The method used for the payment.number_of_transactions
: The number of transactions in the payment.control_sum
: The control sum of the payment.payment_type_info
: Information about the type of payment, represented by thePaymentTypeInfo
struct.requested_execution_date
: The requested execution date of the payment.debtor
: Information about the debtor, represented by theDebtor
struct.debtor_account
: Information about the debtor’s account, represented by theDebtorAccount
struct.debtor_agent
: Information about the debtor’s agent, represented by theDebtorAgent
struct.credit_transfer_transaction_info
: Information about the credit transfer transactions, represented by theCreditTransferTransactionInfo
struct.
PaymentTypeInfo
The PaymentTypeInfo
struct contains information about the type of payment. It has the following fields:
service_level
: The service level of the payment, represented by theServiceLevel
struct.local_instrument
: The local instrument used for the payment.payment_type_id
: The ID of the payment type.
ServiceLevel
The ServiceLevel
struct contains information about the service level of a payment. It has the following field:
code
: The code representing the service level.
Debtor
The Debtor
struct contains information about the debtor. It has the following fields:
name
: The name of the debtor.postal_address
: The postal address of the debtor, represented by thePostalAddress
struct.
PostalAddress
The PostalAddress
struct contains information about a postal address. It has the following fields:
country
: The country of the address.address_line
: The lines of the address. //!
DebtorAccount
The DebtorAccount
struct contains information about the debtor’s account. It has the following fields:
id
: The ID of the account, represented by theAccountId
struct.
AccountId
The AccountId
struct contains information about an account ID. It has the following fields:
IBAN
: The International Bank Account Number (IBAN) of the account.other
: Information about other types of accounts, represented by theOtherAccountId
struct.
OtherAccountId
The OtherAccountId
struct contains information about other types of accounts. It has the following fields:
id
: The ID of the account.issuer
: The issuer of the account.
DebtorAgent
The DebtorAgent
struct contains information about the debtor’s agent. It has the following fields:
financial_institution_id
: The ID of the financial institution.
CreditTransferTransactionInfo
The CreditTransferTransactionInfo
struct contains information about the credit transfer transactions. It has the following fields:
amount
: The amount of the transaction.currency
: The currency of the transaction.remittance_information
: The remittance information of the transaction.creditor
: Information about the creditor, represented by theCreditor
struct.creditor_account
: Information about the creditor’s account, represented by theCreditorAccount
struct.creditor_agent
: Information about the creditor’s agent, represented by theCreditorAgent
struct.ultimate_creditor
: Information about the ultimate creditor, represented by theUltimateCreditor
struct.
Creditor
The Creditor
struct contains information about the creditor. It has the following fields:
name
: The name of the creditor.postal_address
: The postal address of the creditor, represented by thePostalAddress
struct.
CreditorAccount
The CreditorAccount
struct contains information about the creditor’s account. It has the following fields:
id
: The ID of the account, represented by theAccountId
struct.
CreditorAgent
The CreditorAgent
struct contains information about the creditor’s agent. It has the following fields:
financial_institution_id
: The ID of the financial institution.
UltimateCreditor
The UltimateCreditor
struct contains information about the ultimate creditor. It has the following fields:
name
: The name of the ultimate creditor.postal_address
: The postal address of the ultimate creditor, represented by thePostalAddress
struct.
Usage
serde
: Enable serialization/deserialization via serde