sepa_rator 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +23 -0
  3. data/README.md +117 -0
  4. data/lib/schema/pain.001.001.03.ch.02.xsd +1212 -0
  5. data/lib/schema/pain.001.001.03.xsd +921 -0
  6. data/lib/schema/pain.001.001.09.xsd +1114 -0
  7. data/lib/schema/pain.001.001.13.xsd +1251 -0
  8. data/lib/schema/pain.001.002.03.xsd +450 -0
  9. data/lib/schema/pain.001.003.03.xsd +474 -0
  10. data/lib/schema/pain.008.001.02.xsd +879 -0
  11. data/lib/schema/pain.008.001.08.xsd +1106 -0
  12. data/lib/schema/pain.008.001.12.xsd +1135 -0
  13. data/lib/schema/pain.008.002.02.xsd +597 -0
  14. data/lib/schema/pain.008.003.02.xsd +614 -0
  15. data/lib/sepa_rator/account/address.rb +71 -0
  16. data/lib/sepa_rator/account/contact_details.rb +70 -0
  17. data/lib/sepa_rator/account/creditor_account.rb +16 -0
  18. data/lib/sepa_rator/account/creditor_address.rb +5 -0
  19. data/lib/sepa_rator/account/debtor_account.rb +20 -0
  20. data/lib/sepa_rator/account/debtor_address.rb +5 -0
  21. data/lib/sepa_rator/account.rb +64 -0
  22. data/lib/sepa_rator/concerns/attribute_initializer.rb +40 -0
  23. data/lib/sepa_rator/concerns/regulatory_reporting_validator.rb +111 -0
  24. data/lib/sepa_rator/concerns/schema_validation.rb +41 -0
  25. data/lib/sepa_rator/concerns/xml_builder.rb +111 -0
  26. data/lib/sepa_rator/converter.rb +46 -0
  27. data/lib/sepa_rator/error.rb +15 -0
  28. data/lib/sepa_rator/message/credit_transfer.rb +221 -0
  29. data/lib/sepa_rator/message/direct_debit.rb +153 -0
  30. data/lib/sepa_rator/message.rb +284 -0
  31. data/lib/sepa_rator/transaction/credit_transfer_transaction.rb +178 -0
  32. data/lib/sepa_rator/transaction/direct_debit_transaction.rb +104 -0
  33. data/lib/sepa_rator/transaction.rb +114 -0
  34. data/lib/sepa_rator/validator.rb +99 -0
  35. data/lib/sepa_rator/version.rb +5 -0
  36. data/lib/sepa_rator.rb +27 -0
  37. metadata +128 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5a58a4b048d1554e4d422e8a7f0d3a054e01c9f280c026bbcba373d826b72b23
4
+ data.tar.gz: db691fda7be2fb62d6d42b172708956ac12b17c46614a09c24ac4fd035dbfd20
5
+ SHA512:
6
+ metadata.gz: 9c3f27235b35022711b6115b025eb5b50694f6832d486238610144b676adf672917f1a354e2cf6a11dff98c5570a764cd27e1713cbc53e208a56c08b665bf702
7
+ data.tar.gz: 2f29c643d85508b1159d630a169f3248450b36556ca4bfd84032d1efc6325d68ab9956a7d36dbbbb063a83515aaa8fd16064ed2f9b2c461fd4c3966aa5a341df
data/LICENSE.txt ADDED
@@ -0,0 +1,23 @@
1
+ Copyright (c) 2013-2022 Georg Leciejewski (Sales King GmbH) & Georg Ledermann
2
+ Copyright (c) 2025-2026 AdVitam (https://www.advitam.fr)
3
+
4
+ MIT License
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining
7
+ a copy of this software and associated documentation files (the
8
+ "Software"), to deal in the Software without restriction, including
9
+ without limitation the rights to use, copy, modify, merge, publish,
10
+ distribute, sublicense, and/or sell copies of the Software, and to
11
+ permit persons to whom the Software is furnished to do so, subject to
12
+ the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be
15
+ included in all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,117 @@
1
+ # sepa_rator — Ruby gem for creating SEPA XML files
2
+
3
+ [![Build Status](https://github.com/AdVitam/sepa_rator/workflows/Test/badge.svg?branch=master)](https://github.com/AdVitam/sepa_rator/actions)
4
+
5
+ Successor to [salesking/sepa_king](https://github.com/salesking/sepa_king) (unmaintained since 2022).
6
+ Adds support for newer SEPA schemas (`pain.001.001.09`, `pain.001.001.13`,
7
+ `pain.008.001.08`, `pain.008.001.12`) with extensive code quality
8
+ and security improvements.
9
+
10
+ ## Features
11
+
12
+ * **Credit Transfer** (`pain.001`) — schemas `.001.13`, `.001.09`, `.003.03`, `.002.03`, `.001.03`, `.001.03.ch.02`
13
+ * **Direct Debit** (`pain.008`) — schemas `.001.12`, `.001.08`, `.003.02`, `.002.02`, `.001.02`
14
+ * Full XSD validation on every generated XML
15
+ * Postal addresses, contact details, LEI, regulatory reporting
16
+ * Flexible charge bearer (SLEV, DEBT, CRED, SHAR)
17
+ * Mandate amendment support (original mandate ID, debtor account, creditor scheme)
18
+
19
+ **pain** = **Pa**yment **In**itiation (ISO 20022).
20
+
21
+ ## Requirements
22
+
23
+ * Ruby 3.1+
24
+ * ActiveModel 7.0+ (including 8.1)
25
+
26
+ ## Installation
27
+
28
+ ```ruby
29
+ gem 'sepa_rator'
30
+ ```
31
+
32
+ ## Quick start
33
+
34
+ ### Credit Transfer
35
+
36
+ ```ruby
37
+ sct = SEPA::CreditTransfer.new(
38
+ name: 'Debtor Inc.',
39
+ bic: 'BANKDEFFXXX',
40
+ iban: 'DE87200500001234567890'
41
+ )
42
+
43
+ sct.add_transaction(
44
+ name: 'Creditor AG',
45
+ bic: 'PBNKDEFF370',
46
+ iban: 'DE37112589611964645802',
47
+ amount: 102.50,
48
+ reference: 'XYZ-1234/123',
49
+ remittance_information: 'Invoice 123'
50
+ )
51
+
52
+ xml = sct.to_xml # pain.001.001.03 (default)
53
+ xml = sct.to_xml('pain.001.001.09') # newer schema
54
+ xml = sct.to_xml('pain.001.001.13') # latest schema
55
+ ```
56
+
57
+ ### Direct Debit
58
+
59
+ ```ruby
60
+ sdd = SEPA::DirectDebit.new(
61
+ name: 'Creditor Inc.',
62
+ bic: 'BANKDEFFXXX',
63
+ iban: 'DE87200500001234567890',
64
+ creditor_identifier: 'DE98ZZZ09999999999'
65
+ )
66
+
67
+ sdd.add_transaction(
68
+ name: 'Debtor Corp.',
69
+ bic: 'SPUEDE2UXXX',
70
+ iban: 'DE21500500009876543210',
71
+ amount: 39.99,
72
+ reference: 'XYZ/2013-08-ABO/6789',
73
+ mandate_id: 'K-02-2011-12345',
74
+ mandate_date_of_signature: Date.new(2011, 1, 25),
75
+ sequence_type: 'OOFF'
76
+ )
77
+
78
+ xml = sdd.to_xml # pain.008.001.02 (default)
79
+ xml = sdd.to_xml('pain.008.001.08') # newer schema
80
+ xml = sdd.to_xml('pain.008.001.12') # latest schema
81
+ ```
82
+
83
+ ### Validators
84
+
85
+ Reuse SEPA validators in your own models:
86
+
87
+ ```ruby
88
+ class BankAccount < ActiveRecord::Base
89
+ validates_with SEPA::IBANValidator, field_name: :iban
90
+ validates_with SEPA::BICValidator, field_name: :bic
91
+ end
92
+ ```
93
+
94
+ ## Documentation
95
+
96
+ For the full list of options (addresses, charge bearer, amendment info, batch booking, service level, etc.), see [DOCUMENTATION.md](DOCUMENTATION.md).
97
+
98
+ ## Changelog
99
+
100
+ See [CHANGELOG.md](CHANGELOG.md).
101
+
102
+ ## Contributors
103
+
104
+ * [Original contributors](https://github.com/salesking/sepa_king/graphs/contributors) (salesking/sepa_king)
105
+ * [sepa_rator contributors](https://github.com/AdVitam/sepa_rator/graphs/contributors)
106
+
107
+ ## Resources
108
+
109
+ * [ISO 20022 message definitions](https://www.iso20022.org/iso-20022-message-definitions)
110
+ * <https://www.ebics.de/de/datenformate>
111
+
112
+ ## License
113
+
114
+ Released under the [MIT License](LICENSE.txt).
115
+
116
+ Originally copyright (c) 2013-2022 Georg Leciejewski (SalesKing), Georg Ledermann.
117
+ Copyright (c) 2025-2026 AdVitam.