sps_king 0.7.0 → 0.8.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31b32c348bef762b07d56477514a4a2bfd8e8f0e3747efc868dfc87c5c2d2611
4
- data.tar.gz: a35d23dcca002639fe9fd1f81ef31c9da0fdb1211b5c3486f6d563451ad10fb9
3
+ metadata.gz: 40a4c8071cb8bcda13c6ac4e7195dbbd838ad297ce4c5ea908dd377d68613c3e
4
+ data.tar.gz: c0dd7c10e1349329763a6780fcb32f081858a0332dc63b6bb09b90bf7c7dfb28
5
5
  SHA512:
6
- metadata.gz: b1945d74086db0e92cb5ad8dae6e091d40df533fa77cc44c8e58057f1c9ccb1b48bc153cccde657de747ef882b4f886aa1d5c994c2f90022a4b340ba20a1c70d
7
- data.tar.gz: 336173dab180c320bb5bb201ed7ef06463c2cd1a1bf09fb7b4b84947a33def1190432c5d6bc1d5951b4e0956fdc1f4b455c7ad59d880928905e48e6f3c7cb710
6
+ metadata.gz: 127713638985e72a657d2db062e9eabce93dc04e5b358fb1e33f1b08ba2feaa9a9c89bebb977bee66b14b3e51ee088557f0dabd3810effcc7665cfba74bab159
7
+ data.tar.gz: 4d1b2f43c5f272923f955617e8255d82d77f602092781368819bf47d3ae9528b48477295d57f019103bf4929c15435d1ec1190f68897af0838cd5554a841e6b7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## What's Changed in in v0.8.0
2
+
3
+ * Add support for validating debitor account proprietary field by @Nymuxyzo in [#23](https://github.com/viafintech/sps_king/pull/23)
4
+ * Fix missing schema version in `schema_compatible?` in [#24](https://github.com/viafintech/sps_king/pull/24)
5
+
6
+ **Full Changelog**: https://github.com/viafintech/sps_king/compare/v0.7.0...v0.8.0
7
+
1
8
  ## What's Changed in v0.7.0
2
9
 
3
10
  * Add support for pain.001.001.09.ch.03 in [#20](https://github.com/viafintech/sps_king/pull/20)
@@ -2,5 +2,20 @@
2
2
 
3
3
  module SPS
4
4
  class DebtorAccount < Account
5
+
6
+ extend Converter
7
+
8
+ attr_accessor :proprietary
9
+
10
+ ### Proprietary values
11
+ # NOA No Advice
12
+ # SIA Single Advice
13
+ # CND Collective Advice No Details
14
+ # CWD Collective Advice With Details
15
+ PROPRIETARY_VALUES = %w[NOA SIA CND CWD].freeze
16
+
17
+ validates :proprietary, inclusion: PROPRIETARY_VALUES, allow_nil: true
18
+
19
+ convert :proprietary, to: :text
5
20
  end
6
21
  end
@@ -60,6 +60,11 @@ module SPS
60
60
  builder.Id do
61
61
  builder.IBAN(account.iban)
62
62
  end
63
+ if account.proprietary.present?
64
+ builder.Tp do
65
+ builder.Prtry(account.proprietary)
66
+ end
67
+ end
63
68
  end
64
69
  builder.DbtrAgt do
65
70
  builder.FinInstnId do
@@ -62,7 +62,7 @@ module SPS
62
62
  raise ArgumentError.new("Schema #{schema_name} is unknown!") unless self.known_schemas.include?(schema_name)
63
63
 
64
64
  case schema_name
65
- when PAIN_001_001_03_CH_02
65
+ when PAIN_001_001_03_CH_02, PAIN_001_001_09_CH_03
66
66
  transactions.all? { |t| t.schema_compatible?(schema_name) }
67
67
  when PAIN_008_001_02_CH_03
68
68
  transactions.all? { |t| t.schema_compatible?(schema_name) } &&
@@ -4,6 +4,7 @@ module SPS
4
4
  class CreditTransferTransaction < Transaction
5
5
 
6
6
  attr_accessor :service_level,
7
+ :local_instrument,
7
8
  :creditor_address,
8
9
  :category_purpose,
9
10
  :charge_bearer
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SPS
4
4
 
5
- VERSION = '0.7.0'
5
+ VERSION = '0.8.0'
6
6
 
7
7
  end
@@ -8,7 +8,8 @@ describe SPS::DebtorAccount do
8
8
  SPS::DebtorAccount.new(
9
9
  name: 'Gläubiger GmbH',
10
10
  bic: 'BANKDEFFXXX',
11
- iban: 'DE87200500001234567890'
11
+ iban: 'DE87200500001234567890',
12
+ proprietary: 'CWD'
12
13
  )
13
14
  ).to be_valid
14
15
  end
@@ -78,6 +78,12 @@ describe SPS::CreditTransfer do
78
78
  subject.to_xml(SPS::PAIN_001_001_03_CH_02)
79
79
  ).to validate_against('pain.001.001.03.ch.02.xsd')
80
80
  end
81
+
82
+ it 'should validate against pain.001.001.09.ch.03' do
83
+ expect(
84
+ subject.to_xml(SPS::PAIN_001_001_09_CH_03)
85
+ ).to validate_against('pain.001.001.09.ch.03.xsd')
86
+ end
81
87
  end
82
88
 
83
89
  context 'setting creditor address with structured fields' do
@@ -136,6 +142,10 @@ describe SPS::CreditTransfer do
136
142
  it 'should validate against pain.001.001.03.ch.02' do
137
143
  expect(subject.to_xml('pain.001.001.03.ch.02')).to validate_against('pain.001.001.03.ch.02.xsd')
138
144
  end
145
+
146
+ it 'should validate against pain.001.001.09.ch.03' do
147
+ expect(subject.to_xml('pain.001.001.09.ch.03')).to validate_against('pain.001.001.09.ch.03.xsd')
148
+ end
139
149
  end
140
150
 
141
151
  context 'without requested_date given' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sps_king
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schoknecht
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
231
  - !ruby/object:Gem::Version
232
232
  version: '0'
233
233
  requirements: []
234
- rubygems_version: 4.0.3
234
+ rubygems_version: 4.0.6
235
235
  specification_version: 4
236
236
  summary: Ruby gem for creating SPS XML files
237
237
  test_files: