From b91ecf49033e3584a398de6174f40dabb66cb6df Mon Sep 17 00:00:00 2001 From: Joana Bertoldi Date: Wed, 4 Dec 2024 15:22:54 +0100 Subject: [PATCH] Update readme --- README.md | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index caa1d4b..1546bd8 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,27 @@ gem 'cfonb' `OperationDetails` are lines starting with `05`. They aim at providing additional information about the operation. Below is the list of additional details available for each operation. -These details can be accessed through `operation.details`, which will provide all the attributes. To fetch a specific attribute, you can use `operation.details.attribute`. For example, `operation.details.unstructured_label`. Ultimately, you can also access the 70 characters of the detail by using its code like `operation.details.mmo` -All unmapped details can be accessed via `details.unknown` which will return the codes and the corresponding line details. +These details can be accessed through `operation.details`, which will provide all the attributes. To fetch a specific attribute, you can use `operation.details.attribute`. For example, `operation.details.unstructured_label`. Ultimately, you can also access the 70 characters of the detail by using its code like `operation.details.mmo`. + +All unmapped details can be accessed via `details.unknown` which are stored in a hash with the format `'detail_code' => 'line_detail'`, so +to get the data for the unknown detail_code `AAA` the call would be `details.unknown['AAA']`. + +Object example: +``` +#"UNKNOWN DETAIL INFO"} +> +``` If you encounter new and relevant ones, please open an issue or a pull request with the appropriate implementation. We aimed at making it as easy as possible to add new details. You just need to do the following on initialization: @@ -59,14 +78,6 @@ CFONB::OperationDetails.register('FEE', self) | RCN | `client_reference`, `purpose` | Client reference and Payment nature/purpose | | REF | `operation_reference` | Bank operation reference | -TODO: -| Detail Code | Attributes | Description | -| --- | --- | --- | -| RET | `unifi_code`, `sit_code`, `payback_label` | Payback informations | -| CBE | `creditor_account` | Account of the creditor or beneficiary | -| BDB | `creditor_bank` | Bank of the creditor or beneficiary | -| LEM | `issuer_label` | Issuer Label | - ## Usage ```ruby