sepa 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -104,10 +104,10 @@ class Sepa::DirectDebitOrder
104
104
  end
105
105
 
106
106
  class DirectDebit
107
- attr_accessor :debtor, :debtor_account, :end_to_end_id, :amount, :currency, :sequence_type
107
+ attr_accessor :debtor, :debtor_account, :end_to_end_id, :amount, :currency, :sequence_type, :mandate_identification
108
108
 
109
- def initialize debtor, debtor_account, end_to_end_id, amount, currency, sequence_type
110
- @debtor, @debtor_account, @end_to_end_id, @amount, @currency, @sequence_type = debtor, debtor_account, end_to_end_id, amount, currency, sequence_type
109
+ def initialize debtor, debtor_account, end_to_end_id, amount, currency, sequence_type, mandate_identification
110
+ @debtor, @debtor_account, @end_to_end_id, @amount, @currency, @sequence_type, @mandate_identification = debtor, debtor_account, end_to_end_id, amount, currency, sequence_type, mandate_identification
111
111
  end
112
112
 
113
113
  def to_properties prefix
@@ -121,6 +121,9 @@ class Sepa::DirectDebitOrder
121
121
  unless sequence_type == nil || sequence_type == ""
122
122
  hsh = hsh.merge({ "#{prefix}.payment_type_information.sequence_type" => sequence_type })
123
123
  end
124
+ unless mandate_identification == nil || mandate_identification == ""
125
+ hsh = hsh.merge({ "#{prefix}.direct_debit_transaction.mandate_related_information.mandate_identification" => mandate_identification })
126
+ end
124
127
  hsh
125
128
  end
126
129
  end
@@ -1,4 +1,7 @@
1
+ require 'sepa/payments_initiation/pain00800104/mandate_related_information'
2
+
1
3
  class Sepa::PaymentsInitiation::Pain00800104::DirectDebitTransaction < Sepa::Base
2
4
  definition "Provides information specific to the direct debit mandate."
3
5
 
6
+ attribute :mandate_related_information , "MndtRltdInf" , Sepa::PaymentsInitiation::Pain00800104::MandateRelatedInformation
4
7
  end
@@ -12,7 +12,7 @@ class Sepa::PaymentsInitiation::Pain00800104::DirectDebitTransactionInformation
12
12
  attribute :payment_type_information , "PmtTpInf" , Sepa::PaymentsInitiation::Pain00800104::PaymentTypeInformation
13
13
  attribute :instructed_amount , "InstdAmt" , :string, nil, :attributes => { :Ccy => :instructed_amount_currency }
14
14
  attribute :charge_bearer , "ChrgBr"
15
- attribute :direct_debit_transation , "DrctDbtTx" , Sepa::PaymentsInitiation::Pain00800104::DirectDebitTransaction
15
+ attribute :direct_debit_transaction , "DrctDbtTx" , Sepa::PaymentsInitiation::Pain00800104::DirectDebitTransaction
16
16
  attribute :ultimate_creditor , "UltmtCdtr" , Sepa::PaymentsInitiation::PartyIdentification
17
17
  attribute :debtor_agent , "DbtrAgt" , Sepa::PaymentsInitiation::BranchAndFinancialInstitutionIdentification
18
18
  attribute :debtor_agent_account , "DbtrAgtAcct" , Sepa::PaymentsInitiation::CashAccount
@@ -0,0 +1,6 @@
1
+ class Sepa::PaymentsInitiation::Pain00800104::MandateRelatedInformation < Sepa::Base
2
+ definition "Provides further details of the direct debit mandate signed between the creditor and the debtor."
3
+
4
+ attribute :mandate_identification, "MndtId" , :string
5
+ attribute :date_of_signature , "DtOfSgntr", Date
6
+ end
data/lib/sepa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sepa
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -8,11 +8,11 @@ describe Sepa::DirectDebitOrder do
8
8
  it "should produce xml corresponding to the given inputs" do
9
9
  bank_account0 = Sepa::DirectDebitOrder::BankAccount.new "FRZIZIPAPARAZZI345789", "FRZZPPKOOKOO"
10
10
  debtor0 = Sepa::DirectDebitOrder::Party.new "DALTON/CONANMR", "64, Livva de Getamire", nil, "30005", "RENNES", "FR", "Conan DALTON", "01234567890", "conan@dalton.sepa.i.hope.this.works"
11
- dd0 = Sepa::DirectDebitOrder::DirectDebit.new debtor0, bank_account0, "MONECOLE REG F13789 PVT 3", 1231.31, "EUR", nil
11
+ dd0 = Sepa::DirectDebitOrder::DirectDebit.new debtor0, bank_account0, "MONECOLE REG F13789 PVT 3", 1231.31, "EUR", nil, "mandate-id-0"
12
12
 
13
13
  bank_account1 = Sepa::DirectDebitOrder::BankAccount.new "FRQUIQUIWIGWAM947551", "FRQQWIGGA"
14
14
  debtor1 = Sepa::DirectDebitOrder::Party.new "ADAMS/SAMUELMR", "256, Livva de Getamire", nil, "75048", "PARIS", "FR", "Samuel ADAMS", "09876543210", "samuel@adams.sepa.i.hope.this.works"
15
- dd1 = Sepa::DirectDebitOrder::DirectDebit.new debtor1, bank_account1, "MONECOLE REG F13790 PVT 3", 1732.32, "EUR", "FRST"
15
+ dd1 = Sepa::DirectDebitOrder::DirectDebit.new debtor1, bank_account1, "MONECOLE REG F13790 PVT 3", 1732.32, "EUR", "FRST", "mandate-id-1"
16
16
 
17
17
  sepa_now = Time.strptime "1992-02-28T18:30:00", "%Y-%m-%dT%H:%M:%S"
18
18
  Time.stub(:now).and_return sepa_now
@@ -53,6 +53,11 @@
53
53
  <EndToEndId>MONECOLE REG F13789 PVT 3</EndToEndId>
54
54
  </PmtId>
55
55
  <InstdAmt Ccy="EUR">1231.31</InstdAmt>
56
+ <DrctDbtTx>
57
+ <MndtRltdInf>
58
+ <MndtId>mandate-id-0</MndtId>
59
+ </MndtRltdInf>
60
+ </DrctDbtTx>
56
61
  <DbtrAgt>
57
62
  <FinInstnId>
58
63
  <BICFI>FRZZPPKOOKOO</BICFI>
@@ -86,6 +91,11 @@
86
91
  <SeqTp>FRST</SeqTp>
87
92
  </PmtTpInf>
88
93
  <InstdAmt Ccy="EUR">1732.32</InstdAmt>
94
+ <DrctDbtTx>
95
+ <MndtRltdInf>
96
+ <MndtId>mandate-id-1</MndtId>
97
+ </MndtRltdInf>
98
+ </DrctDbtTx>
89
99
  <DbtrAgt>
90
100
  <FinInstnId>
91
101
  <BICFI>FRQQWIGGA</BICFI>
@@ -29,34 +29,36 @@ describe Sepa::PaymentsInitiation::Pain00800104::CustomerDirectDebitInitiation d
29
29
  "payment_information[0].creditor.contact_details.phone_number" => "+33 999 999 999",
30
30
  "payment_information[0].creditor.contact_details.email_address" => "directeur@monecole.softify.com",
31
31
  "payment_information[0].creditor_account.identification.iban" => "FRGOOGOOYADDA9999999",
32
- "payment_information[0].creditor_agent.financial_institution_identification.bic_fi" => "FRGGYELLOW99",
33
- "payment_information[0].direct_debit_transaction_information[0].payment_identification.end_to_end_identification" => "MONECOLE REG F13789 PVT 3",
34
- "payment_information[0].direct_debit_transaction_information[0].instructed_amount" => "1231.31",
35
- "payment_information[0].direct_debit_transaction_information[0].instructed_amount_currency" => "EUR",
36
- "payment_information[0].direct_debit_transaction_information[0].debtor_agent.financial_institution_identification.bic_fi" => "FRZZPPKOOKOO",
37
- "payment_information[0].direct_debit_transaction_information[0].debtor.name" => "DALTON/CONANMR",
38
- "payment_information[0].direct_debit_transaction_information[0].debtor.postal_address.address_line[0]" => "64, Livva de Getamire",
39
- "payment_information[0].direct_debit_transaction_information[0].debtor.postal_address.post_code" => "30005",
40
- "payment_information[0].direct_debit_transaction_information[0].debtor.postal_address.town_name" => "RENNES",
41
- "payment_information[0].direct_debit_transaction_information[0].debtor.postal_address.country" => "FR",
42
- "payment_information[0].direct_debit_transaction_information[0].debtor.contact_details.name" => "Conan DALTON",
43
- "payment_information[0].direct_debit_transaction_information[0].debtor.contact_details.phone_number" => "01234567890",
44
- "payment_information[0].direct_debit_transaction_information[0].debtor.contact_details.email_address" => "conan@dalton.sepa.i.hope.this.works",
45
- "payment_information[0].direct_debit_transaction_information[0].debtor_account.identification.iban" => "FRZIZIPAPARAZZI345789",
46
- "payment_information[0].direct_debit_transaction_information[1].payment_identification.end_to_end_identification" => "MONECOLE REG F13790 PVT 3",
47
- "payment_information[0].direct_debit_transaction_information[1].payment_type_information.sequence_type" => "FRST",
48
- "payment_information[0].direct_debit_transaction_information[1].instructed_amount" => "1732.32",
49
- "payment_information[0].direct_debit_transaction_information[1].instructed_amount_currency" => "EUR",
50
- "payment_information[0].direct_debit_transaction_information[1].debtor_agent.financial_institution_identification.bic_fi" => "FRQQWIGGA",
51
- "payment_information[0].direct_debit_transaction_information[1].debtor.name" => "ADAMS/SAMUELMR",
52
- "payment_information[0].direct_debit_transaction_information[1].debtor.postal_address.address_line[0]" => "256, Livva de Getamire",
53
- "payment_information[0].direct_debit_transaction_information[1].debtor.postal_address.post_code" => "75048",
54
- "payment_information[0].direct_debit_transaction_information[1].debtor.postal_address.town_name" => "PARIS",
55
- "payment_information[0].direct_debit_transaction_information[1].debtor.postal_address.country" => "FR",
56
- "payment_information[0].direct_debit_transaction_information[1].debtor_account.identification.iban" => "FRQUIQUIWIGWAM947551",
57
- "payment_information[0].direct_debit_transaction_information[1].debtor.contact_details.name" => "Samuel ADAMS",
58
- "payment_information[0].direct_debit_transaction_information[1].debtor.contact_details.phone_number" => "09876543210",
59
- "payment_information[0].direct_debit_transaction_information[1].debtor.contact_details.email_address" => "samuel@adams.sepa.i.hope.this.works"
32
+ "payment_information[0].creditor_agent.financial_institution_identification.bic_fi" => "FRGGYELLOW99",
33
+ "payment_information[0].direct_debit_transaction_information[0].payment_identification.end_to_end_identification" => "MONECOLE REG F13789 PVT 3",
34
+ "payment_information[0].direct_debit_transaction_information[0].instructed_amount" => "1231.31",
35
+ "payment_information[0].direct_debit_transaction_information[0].instructed_amount_currency" => "EUR",
36
+ "payment_information[0].direct_debit_transaction_information[0].direct_debit_transaction.mandate_related_information.mandate_identification" => "mandate-id-0",
37
+ "payment_information[0].direct_debit_transaction_information[0].debtor_agent.financial_institution_identification.bic_fi" => "FRZZPPKOOKOO",
38
+ "payment_information[0].direct_debit_transaction_information[0].debtor.name" => "DALTON/CONANMR",
39
+ "payment_information[0].direct_debit_transaction_information[0].debtor.postal_address.address_line[0]" => "64, Livva de Getamire",
40
+ "payment_information[0].direct_debit_transaction_information[0].debtor.postal_address.post_code" => "30005",
41
+ "payment_information[0].direct_debit_transaction_information[0].debtor.postal_address.town_name" => "RENNES",
42
+ "payment_information[0].direct_debit_transaction_information[0].debtor.postal_address.country" => "FR",
43
+ "payment_information[0].direct_debit_transaction_information[0].debtor.contact_details.name" => "Conan DALTON",
44
+ "payment_information[0].direct_debit_transaction_information[0].debtor.contact_details.phone_number" => "01234567890",
45
+ "payment_information[0].direct_debit_transaction_information[0].debtor.contact_details.email_address" => "conan@dalton.sepa.i.hope.this.works",
46
+ "payment_information[0].direct_debit_transaction_information[0].debtor_account.identification.iban" => "FRZIZIPAPARAZZI345789",
47
+ "payment_information[0].direct_debit_transaction_information[1].payment_identification.end_to_end_identification" => "MONECOLE REG F13790 PVT 3",
48
+ "payment_information[0].direct_debit_transaction_information[1].payment_type_information.sequence_type" => "FRST",
49
+ "payment_information[0].direct_debit_transaction_information[1].instructed_amount" => "1732.32",
50
+ "payment_information[0].direct_debit_transaction_information[1].instructed_amount_currency" => "EUR",
51
+ "payment_information[0].direct_debit_transaction_information[1].direct_debit_transaction.mandate_related_information.mandate_identification" => "mandate-id-1",
52
+ "payment_information[0].direct_debit_transaction_information[1].debtor_agent.financial_institution_identification.bic_fi" => "FRQQWIGGA",
53
+ "payment_information[0].direct_debit_transaction_information[1].debtor.name" => "ADAMS/SAMUELMR",
54
+ "payment_information[0].direct_debit_transaction_information[1].debtor.postal_address.address_line[0]" => "256, Livva de Getamire",
55
+ "payment_information[0].direct_debit_transaction_information[1].debtor.postal_address.post_code" => "75048",
56
+ "payment_information[0].direct_debit_transaction_information[1].debtor.postal_address.town_name" => "PARIS",
57
+ "payment_information[0].direct_debit_transaction_information[1].debtor.postal_address.country" => "FR",
58
+ "payment_information[0].direct_debit_transaction_information[1].debtor_account.identification.iban" => "FRQUIQUIWIGWAM947551",
59
+ "payment_information[0].direct_debit_transaction_information[1].debtor.contact_details.name" => "Samuel ADAMS",
60
+ "payment_information[0].direct_debit_transaction_information[1].debtor.contact_details.phone_number" => "09876543210",
61
+ "payment_information[0].direct_debit_transaction_information[1].debtor.contact_details.email_address" => "samuel@adams.sepa.i.hope.this.works"
60
62
  }
61
63
 
62
64
  xml = Sepa::PaymentsInitiation::Pain00800104::CustomerDirectDebitInitiation.new(props).generate_xml
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.5
4
+ version: 0.0.6
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-09-24 00:00:00.000000000 Z
12
+ date: 2013-10-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder
@@ -92,6 +92,7 @@ files:
92
92
  - lib/sepa/payments_initiation/pain00800104/direct_debit_transaction.rb
93
93
  - lib/sepa/payments_initiation/pain00800104/direct_debit_transaction_information.rb
94
94
  - lib/sepa/payments_initiation/pain00800104/group_header.rb
95
+ - lib/sepa/payments_initiation/pain00800104/mandate_related_information.rb
95
96
  - lib/sepa/payments_initiation/pain00800104/payment_identification.rb
96
97
  - lib/sepa/payments_initiation/pain00800104/payment_information.rb
97
98
  - lib/sepa/payments_initiation/pain00800104/payment_type_information.rb