sepa 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +22 -16
- data/lib/sepa/direct_debit_order.rb +2 -0
- data/lib/sepa/payments_initiation/cash_account.rb +1 -0
- data/lib/sepa/payments_initiation/pain00800104/direct_debit_transaction_information.rb +2 -0
- data/lib/sepa/payments_initiation/pain00800104/group_header.rb +4 -0
- data/lib/sepa/payments_initiation/party_identification.rb +1 -0
- data/lib/sepa/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Sepa
|
2
2
|
|
3
|
-
An implementation of pain.008.001.04 CustomerDirectDebitInitiation. WARNING: NO WARRANTY, USE AT YOUR OWN RISK AND PERIL.
|
3
|
+
An implementation of pain.008.001.04 CustomerDirectDebitInitiation. WARNING: NO WARRANTY, USE AT YOUR OWN RISK AND PERIL.
|
4
4
|
|
5
5
|
I wanted to make it as easy as possible to define message types and components so this library will be easy to grow to implement the entire standard.
|
6
6
|
|
@@ -22,30 +22,36 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
The simplest way to generate a pain.008.001.04 xml message is to use the DirectDebitOrder module which exposes only the bare essentials. Which
|
25
|
+
The simplest way to generate a pain.008.001.04 xml message is to use the DirectDebitOrder module which exposes only the bare essentials. Which
|
26
|
+
is still a lot, but hey, this is a banking standard, what do you expect.
|
26
27
|
|
27
|
-
Here's an example, ripped off from the spec, of a direct debit order for payments to a single creditor
|
28
|
+
Here's an example, ripped off from the spec, of a direct debit order for payments to a single creditor. You need to provide a list of direct
|
29
|
+
debits, each with information about the amount, the bank account to debit, and the name and contact details of the debtor. You also need to
|
30
|
+
provide a "creditor" and "initiator" object, which also contain bank account and contact details. Finally, you need to supply a message identifier.
|
28
31
|
|
29
|
-
direct_debits
|
32
|
+
def create_sepa_direct_debit_order direct_debits, creditor, initiator, message_id
|
33
|
+
dd_list = []
|
30
34
|
|
31
|
-
|
35
|
+
# for each direct debit you want to order ...
|
32
36
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
37
|
+
for(each direct_debit to order) do | ... |
|
38
|
+
bank_account = Sepa::DirectDebitOrder::BankAccount.new direct_debit.iban, direct_debit.bic
|
39
|
+
debtor = Sepa::DirectDebitOrder::Party.new direct_debit.name, direct_debit.addr, nil, direct_debit.postcode, direct_debit.town, direct_debit.country, direct_debit.contact, direct_debit.phone, direct_debit.email
|
40
|
+
dd_list << Sepa::DirectDebitOrder::DirectDebit.new debtor, bank_account, end_to_end_id(direct_debit), direct_debit.amount, "EUR"
|
41
|
+
end
|
42
|
+
|
43
|
+
creditor = Sepa::DirectDebitOrder::Party.new creditor.name, creditor.address, nil, creditor.postcode, creditor.town, creditor.country, creditor.contact, creditor.phone, creditor.email
|
38
44
|
|
39
|
-
|
45
|
+
creditor_account = Sepa::DirectDebitOrder::BankAccount.new creditor.iban, creditor.bic
|
40
46
|
|
41
|
-
|
42
|
-
payment = Sepa::DirectDebitOrder::CreditorPayment.new creditor, creditor_account, payment_identifier, collection_date, direct_debits
|
47
|
+
payment = Sepa::DirectDebitOrder::CreditorPayment.new creditor, creditor_account, payment_identifier, collection_date, dd_list
|
43
48
|
|
44
|
-
|
49
|
+
initiator = Sepa::DirectDebitOrder::Party.new initiator.identifier, initiator.address, nil, initiator.postcode, initiator.town, initiator.country, initiator.contact, initiator.phone, initiator.email
|
45
50
|
|
46
|
-
|
51
|
+
order = Sepa::DirectDebitOrder::Order.new message_id, initiator, [payment]
|
47
52
|
|
48
|
-
|
53
|
+
order.to_xml
|
54
|
+
end
|
49
55
|
|
50
56
|
The last line returns a string that you will then need to send to your bank one way or another. For example, you might use an EBICS client.
|
51
57
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "sepa/payments_initiation/cash_account"
|
2
|
+
require "sepa/payments_initiation/party_identification"
|
1
3
|
require "sepa/payments_initiation/pain00800104/payment_identification"
|
2
4
|
require "sepa/payments_initiation/pain00800104/payment_type_information"
|
3
5
|
require "sepa/payments_initiation/pain00800104/direct_debit_transaction"
|
@@ -1,3 +1,7 @@
|
|
1
|
+
require 'sepa/payments_initiation/branch_and_financial_institution_identification'
|
2
|
+
require 'sepa/payments_initiation/authorisation'
|
3
|
+
require 'sepa/payments_initiation/party_identification'
|
4
|
+
|
1
5
|
class Sepa::PaymentsInitiation::Pain00800104::GroupHeader < Sepa::Base
|
2
6
|
definition "Set of characteristics shared by all individual transactions included in the message."
|
3
7
|
attribute :message_identification, "MsgId"
|
data/lib/sepa/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sepa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: builder
|