sepa_king 0.0.7 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -11
- data/lib/schema/pain.001.002.03.xsd +450 -450
- data/lib/schema/pain.001.003.03.xsd +474 -0
- data/lib/schema/pain.008.002.02.xsd +597 -597
- data/lib/schema/pain.008.003.02.xsd +614 -0
- data/lib/sepa_king/converter.rb +2 -0
- data/lib/sepa_king/message/credit_transfer.rb +16 -13
- data/lib/sepa_king/message/direct_debit.rb +16 -10
- data/lib/sepa_king/message.rb +27 -3
- data/lib/sepa_king/transaction/credit_transfer_transaction.rb +17 -0
- data/lib/sepa_king/transaction/direct_debit_transaction.rb +10 -1
- data/lib/sepa_king/validator.rb +6 -4
- data/lib/sepa_king/version.rb +1 -1
- data/spec/account_spec.rb +1 -1
- data/spec/converter_spec.rb +7 -0
- data/spec/credit_transfer_spec.rb +52 -4
- data/spec/credit_transfer_transaction_spec.rb +30 -9
- data/spec/direct_debit_spec.rb +56 -3
- data/spec/direct_debit_transaction_spec.rb +32 -11
- data/spec/examples/pain.001.002.03.xml +89 -89
- data/spec/examples/pain.001.003.03.xml +89 -0
- data/spec/examples/pain.008.002.02.xml +134 -134
- data/spec/examples/pain.008.003.02.xml +134 -0
- data/spec/transaction_spec.rb +1 -1
- data/spec/validation_spec.rb +4 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72f5b41884bc29b3dfe4032b8973d0b4f99fce20
|
4
|
+
data.tar.gz: 49097e2be968e3ac86c9660214d18512a9d289b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f17e0ff69c50df21d785deb0b92d57f2c16ad34c3fe9ba4a828032d01322b1dba0f705207cf843ed166bad6d13129a91388b2991373fa2f7199e48d7c5c20614
|
7
|
+
data.tar.gz: 626b15c006d37daa9bb4882c2cf973efd6fae25f0d595ca202edc42e81fe129fbf14260de7452caafa1c370e9d8099c1569ed7937d601728e275afe1e1af0145
|
data/README.md
CHANGED
@@ -13,8 +13,10 @@ We love building payment applications! So after developing the [DTAUS library fo
|
|
13
13
|
|
14
14
|
This gem implements the following two messages out of the ISO 20022 standard:
|
15
15
|
|
16
|
-
* Credit Transfer Initiation (pain.001.002.03)
|
17
|
-
* Direct Debit Initiation (pain.008.002.02)
|
16
|
+
* Credit Transfer Initiation (pain.001.003.03 and pain.001.002.03)
|
17
|
+
* Direct Debit Initiation (pain.008.003.02 and pain.008.002.02)
|
18
|
+
|
19
|
+
This means it handles the "Specification of Data Formats" in version 2.6 (2012-11-17) and version 2.7 (2013-11-04)
|
18
20
|
|
19
21
|
BTW: **pain** is a shortcut for **Pa**yment **In**itiation.
|
20
22
|
|
@@ -40,7 +42,7 @@ sdd = SEPA::DirectDebit.new(
|
|
40
42
|
# String, max. 70 char
|
41
43
|
name: 'Gläubiger GmbH',
|
42
44
|
|
43
|
-
# Business Identifier Code (SWIFT-Code) of the creditor
|
45
|
+
# OPTIONAL: Business Identifier Code (SWIFT-Code) of the creditor
|
44
46
|
# String, 8 or 11 char
|
45
47
|
bic: 'BANKDEFFXXX',
|
46
48
|
|
@@ -59,7 +61,7 @@ sdd.add_transaction(
|
|
59
61
|
# String, max. 70 char
|
60
62
|
name: 'Zahlemann & Söhne GbR',
|
61
63
|
|
62
|
-
# Business Identifier Code (SWIFT-Code) of the debtor's account
|
64
|
+
# OPTIONAL: Business Identifier Code (SWIFT-Code) of the debtor's account
|
63
65
|
# String, 8 or 11 char
|
64
66
|
bic: 'SPUEDE2UXXX',
|
65
67
|
|
@@ -90,6 +92,7 @@ sdd.add_transaction(
|
|
90
92
|
# Local instrument, in German "Lastschriftart"
|
91
93
|
# One of these strings:
|
92
94
|
# 'CORE' ("Basis-Lastschrift")
|
95
|
+
# 'COR1' ("Basis-Lastschrift mit verkürzter Vorlagefrist")
|
93
96
|
# 'B2B' ("Firmen-Lastschrift")
|
94
97
|
local_instrument: 'CORE',
|
95
98
|
|
@@ -109,7 +112,7 @@ sdd.add_transaction(
|
|
109
112
|
# True or False
|
110
113
|
batch_booking: true
|
111
114
|
|
112
|
-
#
|
115
|
+
# OPTIONAL: Use a different creditor account
|
113
116
|
# CreditorAccount
|
114
117
|
creditor_account: SEPA::CreditorAccount.new(
|
115
118
|
name: 'Creditor Inc.',
|
@@ -121,11 +124,12 @@ sdd.add_transaction(
|
|
121
124
|
sdd.add_transaction ...
|
122
125
|
|
123
126
|
# Last: create XML string
|
124
|
-
xml_string = sdd.to_xml
|
127
|
+
xml_string = sdd.to_xml # Use latest schema pain.008.003.02
|
128
|
+
xml_string = sdd.to_xml('pain.008.002.02') # Use former schema pain.008.002.02
|
125
129
|
```
|
126
130
|
|
127
131
|
|
128
|
-
How to create the XML for **Credit Transfer Initiation** (in
|
132
|
+
How to create the XML for **Credit Transfer Initiation** (in German: "Überweisungen")
|
129
133
|
|
130
134
|
```ruby
|
131
135
|
# First: Create the main object
|
@@ -134,7 +138,7 @@ sct = SEPA::CreditTransfer.new(
|
|
134
138
|
# String, max. 70 char
|
135
139
|
name: 'Schuldner GmbH',
|
136
140
|
|
137
|
-
# Business Identifier Code (SWIFT-Code) of the debtor
|
141
|
+
# OPTIONAL: Business Identifier Code (SWIFT-Code) of the debtor
|
138
142
|
# String, 8 or 11 char
|
139
143
|
bic: 'BANKDEFFXXX',
|
140
144
|
|
@@ -149,7 +153,7 @@ sct.add_transaction(
|
|
149
153
|
# String, max. 70 char
|
150
154
|
name: 'Telekomiker AG',
|
151
155
|
|
152
|
-
# Business Identifier Code (SWIFT-Code) of the creditor's account
|
156
|
+
# OPTIONAL: Business Identifier Code (SWIFT-Code) of the creditor's account
|
153
157
|
# String, 8 or 11 char
|
154
158
|
bic: 'PBNKDEFF370',
|
155
159
|
|
@@ -175,12 +179,19 @@ sct.add_transaction(
|
|
175
179
|
|
176
180
|
# OPTIONAL: Enables or disables batch booking, in German "Sammelbuchung / Einzelbuchung"
|
177
181
|
# True or False
|
178
|
-
batch_booking: true
|
182
|
+
batch_booking: true,
|
183
|
+
|
184
|
+
# OPTIONAL: Urgent Payment
|
185
|
+
# One of these strings:
|
186
|
+
# 'SEPA' ("SEPA-Zahlung")
|
187
|
+
# 'URGP' ("Taggleiche Eilüberweisung")
|
188
|
+
service_level: 'URGP'
|
179
189
|
)
|
180
190
|
sct.add_transaction ...
|
181
191
|
|
182
192
|
# Last: create XML string
|
183
|
-
xml_string = sct.to_xml
|
193
|
+
xml_string = sct.to_xml # Use latest schema pain.001.003.03
|
194
|
+
xml_string = sct.to_xml('pain.001.002.03') # Use former schema pain.001.002.03
|
184
195
|
```
|
185
196
|
|
186
197
|
|