sepa 0.0.20 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d3b4d36cf0cb4dd7325c4363781cbd085db63f38
4
- data.tar.gz: 5ff46adc5b6cea34be5b5b828a3a9700dcf1792c
2
+ SHA256:
3
+ metadata.gz: a183c8a185ca6b9077d42eb3269bbb757e81809dec8607ef13bd0609a5da2027
4
+ data.tar.gz: 37e39aeb120fa65b65eff4355f4948e9a1182b75cf915ceef6f19b216f5a0560
5
5
  SHA512:
6
- metadata.gz: e297df97367f92c02a03239ed86fb1cd0b187b1dfb662e28b36e753e875aea72364802a820b52e874ecc0caa96d41bc52441bbda6fcd88d233408e246974a2eb
7
- data.tar.gz: ee644daba446041404f2d734dcdc9a33b569a7dc7684315d0d15d4f3ef3df4f8ab9ada386b14a3d3d81a01ea25647160151b293992467c30f7e60ad2a5edad5d
6
+ metadata.gz: f103db3c12ca1bf92df6482019c8b096120949a70554bb0aaef52c9c289098c8ca56c27ee5382333e5a2b402c9354dfffb1b1cdc05e51769d0f6a5962c30ed1a
7
+ data.tar.gz: 3a34cd26af6a2743351b9aa9d4dc1430f0413e7f085ea4e9c2112972091f68ac8907b8189e98b73c517662ddece1929d9489a237569a9818d7d371f617d58093
data/lib/sepa/base.rb CHANGED
@@ -16,9 +16,21 @@ module Sepa
16
16
  end
17
17
  end
18
18
 
19
+ class Max140Text < StringWithConstraint
20
+ def constrain s
21
+ s ? s.to_s.strip[0...140] : ''
22
+ end
23
+ end
24
+
19
25
  class Max70Text < StringWithConstraint
20
26
  def constrain s
21
- s ? s.to_s.strip[0..70] : ''
27
+ s ? s.to_s.strip[0...70] : ''
28
+ end
29
+ end
30
+
31
+ class Max35Text < StringWithConstraint
32
+ def constrain s
33
+ s ? s.to_s.strip[0...35] : ''
22
34
  end
23
35
  end
24
36
 
@@ -1,7 +1,7 @@
1
1
  require "sepa/payments_initiation/pain00800104/direct_debit_transaction_information"
2
2
 
3
3
  class Sepa::PaymentsInitiation::Pain00800104::PaymentInformation < Sepa::Base
4
- attribute :payment_information_identification , "PmtInfId"
4
+ attribute :payment_information_identification , "PmtInfId" , Sepa::Max35Text
5
5
  attribute :payment_method , "PmtMtd"
6
6
  attribute :batch_booking , "BtchBookg"
7
7
  attribute :number_of_transactions , "NbOfTxs"
@@ -1,9 +1,9 @@
1
1
  class Sepa::PaymentsInitiation::Pain00800104::RemittanceInformationChoice < Sepa::Base
2
- attribute :unstructured_remittance_information , "Ustrd"
2
+ attribute :unstructured_remittance_information , "Ustrd", Sepa::Max70Text
3
3
  # don't think this is commonly used; would probably need a class
4
4
  attribute :structured_remittance_information , "Strd"
5
5
 
6
6
  def empty?
7
- [unstructured_remittance_information, structured_remittance_information].compact == []
7
+ [unstructured_remittance_information, structured_remittance_information].compact.join.strip == ""
8
8
  end
9
- end
9
+ end
data/lib/sepa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sepa
2
- VERSION = "0.0.20"
2
+ VERSION = "0.0.21"
3
3
  end
@@ -83,7 +83,7 @@
83
83
  <PstCd>30005</PstCd>
84
84
  <TwnNm>RENNES</TwnNm>
85
85
  <Ctry>FR</Ctry>
86
- <AdrLine>64, Livva de Getamire 2345678 30 345678 40 345678 50 345678 60 345678 7</AdrLine>
86
+ <AdrLine>64, Livva de Getamire 345678 30 345678 40 345678 50 345678 60 345678 7</AdrLine>
87
87
  </PstlAdr>
88
88
  <CtctDtls>
89
89
  <Nm>Conan DALTON</Nm>
@@ -116,7 +116,7 @@
116
116
  </FinInstnId>
117
117
  </DbtrAgt>
118
118
  <Dbtr>
119
- <Nm>ADAMS/SAMUELMR567892_2345678_3_2345678_4_2345678_5_2345678_6_12345678_7</Nm>
119
+ <Nm>ADAMS/SAMUELMR567892_2345678_3_2345678_4_2345678_5_2345678_6_2345678_7</Nm>
120
120
  <PstlAdr>
121
121
  <PstCd>75048</PstCd>
122
122
  <TwnNm>PARIS</TwnNm>
@@ -41,7 +41,7 @@ describe Sepa::PaymentsInitiation::Pain00800104::CustomerDirectDebitInitiation d
41
41
  "payment_information[0].direct_debit_transaction_information[0].direct_debit_transaction.mandate_related_information.mandate_identification" => "mandate-id-0",
42
42
  "payment_information[0].direct_debit_transaction_information[0].debtor_agent.financial_institution_identification.bic_fi" => "FRZZPPKOOKOO",
43
43
  "payment_information[0].direct_debit_transaction_information[0].debtor.name" => "DALTON/CONANMR",
44
- "payment_information[0].direct_debit_transaction_information[0].debtor.postal_address.address_line[0]" => "64, Livva de Getamire 2345678 30 345678 40 345678 50 345678 60 345678 70 345678 80",
44
+ "payment_information[0].direct_debit_transaction_information[0].debtor.postal_address.address_line[0]" => "64, Livva de Getamire 345678 30 345678 40 345678 50 345678 60 345678 70 345678 80",
45
45
  "payment_information[0].direct_debit_transaction_information[0].debtor.postal_address.post_code" => "30005",
46
46
  "payment_information[0].direct_debit_transaction_information[0].debtor.postal_address.town_name" => "RENNES",
47
47
  "payment_information[0].direct_debit_transaction_information[0].debtor.postal_address.country" => "FR",
@@ -55,7 +55,7 @@ describe Sepa::PaymentsInitiation::Pain00800104::CustomerDirectDebitInitiation d
55
55
  "payment_information[0].direct_debit_transaction_information[1].instructed_amount_currency" => "EUR",
56
56
  "payment_information[0].direct_debit_transaction_information[1].direct_debit_transaction.mandate_related_information.mandate_identification" => "mandate-id-1",
57
57
  "payment_information[0].direct_debit_transaction_information[1].debtor_agent.financial_institution_identification.bic_fi" => "FRQQWIGGA",
58
- "payment_information[0].direct_debit_transaction_information[1].debtor.name" => " ADAMS/SAMUELMR567892_2345678_3_2345678_4_2345678_5_2345678_6_12345678_7_2345678_should-be-truncated-at-70-chars ",
58
+ "payment_information[0].direct_debit_transaction_information[1].debtor.name" => " ADAMS/SAMUELMR567892_2345678_3_2345678_4_2345678_5_2345678_6_2345678_7_2345678_should-be-truncated-at-70-chars ",
59
59
  "payment_information[0].direct_debit_transaction_information[1].debtor.postal_address.address_line[0]" => "256, Livva de Getamire",
60
60
  "payment_information[0].direct_debit_transaction_information[1].debtor.postal_address.post_code" => "75048",
61
61
  "payment_information[0].direct_debit_transaction_information[1].debtor.postal_address.town_name" => "PARIS",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sepa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Conan Dalton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-09 00:00:00.000000000 Z
11
+ date: 2022-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -159,8 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  - !ruby/object:Gem::Version
160
160
  version: '0'
161
161
  requirements: []
162
- rubyforge_project:
163
- rubygems_version: 2.5.2.3
162
+ rubygems_version: 3.0.3.1
164
163
  signing_key:
165
164
  specification_version: 4
166
165
  summary: 'pain.008.001.04 and pain.008.001.02 CustomerDirectDebitInitiation ISO20022