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 thePaymentFormatenum.original_group_info_and_status: Information about the original group and its status, represented by theOriginalGroupInfoAndStatusstruct.payment_info: Information about the payment, represented by thePaymentInfostruct.
§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 thePaymentTypeInfostruct.requested_execution_date: The requested execution date of the payment.debtor: Information about the debtor, represented by theDebtorstruct.debtor_account: Information about the debtor’s account, represented by theDebtorAccountstruct.debtor_agent: Information about the debtor’s agent, represented by theDebtorAgentstruct.credit_transfer_transaction_info: Information about the credit transfer transactions, represented by theCreditTransferTransactionInfostruct.
§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 theServiceLevelstruct.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 thePostalAddressstruct.
§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 theAccountIdstruct.
§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 theOtherAccountIdstruct.
§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 theCreditorstruct.creditor_account: Information about the creditor’s account, represented by theCreditorAccountstruct.creditor_agent: Information about the creditor’s agent, represented by theCreditorAgentstruct.ultimate_creditor: Information about the ultimate creditor, represented by theUltimateCreditorstruct.
§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 thePostalAddressstruct.
§CreditorAccount
The CreditorAccount struct contains information about the creditor’s account. It has the following fields:
id: The ID of the account, represented by theAccountIdstruct.
§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 thePostalAddressstruct.
§Usage
serde: Enable serialization/deserialization via serde
Structs§
- Account
Id - Amount
- Credit
Transfer Transaction Info - Creditor
- Creditor
Account - Creditor
Agent - Debtor
- Debtor
Account - Debtor
Agent - Debtor
Transaction Info - Financial
Institution Id - Instructed
Amount - Original
Group Info AndStatus - Payment
- Payment
Id - Payment
Info - Payment
Type Info - Postal
Address - Remittance
Info - Service
Level