sepa_clearer 0.1.0 → 0.2.0

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
2
  SHA1:
3
- metadata.gz: cbd32af62350c9dfef2b8ff7cd7a694d1619716b
4
- data.tar.gz: 5e93b7e97b94e34c3c45e7ae66b250e860676f29
3
+ metadata.gz: 413006f84bc2ab4314fc14110961a13175420a85
4
+ data.tar.gz: 74ed4dc8432d40a3bda042940ff4cd2beb86f6e2
5
5
  SHA512:
6
- metadata.gz: bd98140704cdd382443eaec4db7c95003b1ed393a12a137eff2eae2ea377be2fbe05de044af4b50da20750da36a75969b6e1b4bd22342849202490ff719a0fd4
7
- data.tar.gz: 0dc263db105322307eeac665494ad5ebab9ca8a20b8e3fd105122f626d63833eefcc77e9c1102e292cce4caffcc5fcdc7c96d517e69714973ef6c202a4a82b3e
6
+ metadata.gz: 2c0779942ec709f3b0b2a780cdb1576dc765471610d1bb625b0d5bc6092a7b5e337278f9be7d4b6061cdc475a2f8a5858c1a0f6f8ec0fbf61c1b6821232a9146
7
+ data.tar.gz: 50dcdc203febae34a787065610f4e0f48cc69fef14389a72f666288aa282337b968e92201ed3553743f8720353dff0218d96d01a17756cfa5de610477e3b2bc0
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ v0.2.0
5
+ ------
6
+
7
+ * Return list of provided direct debit instruments via PaymentProvider#direct_debit_instruments. The returned list is
8
+ sorted by the speed of the instrument. This way it is possible to select the fastest istrument by calling .first on it
9
+
4
10
  v0.1.0
5
11
  ------
6
12
 
@@ -17,6 +17,13 @@ module SepaClearer
17
17
  SERVICES.map { |s| [s, send(s)] }.select { |_,v| v }.map { |k,v| k }
18
18
  end
19
19
 
20
+ # Returns a list of provided direct debit methods sorted by there speed
21
+ # :cor1 => 2 business days
22
+ # :core => 3 business days (recurring) & 6 business days for first
23
+ def direct_debit_instruments
24
+ (capabilities & [:core, :cor1]).sort
25
+ end
26
+
20
27
  def to_hash
21
28
  {
22
29
  name: name,
@@ -1,3 +1,3 @@
1
1
  module SepaClearer
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
@@ -25,6 +25,23 @@ describe SepaClearer::PaymentProvider do
25
25
  end
26
26
  end
27
27
 
28
+ describe '#direct_debit_instruments' do
29
+ it 'returns only DD instruments' do
30
+ allow(subject).to receive(:capabilities).and_return([:b2b, :cor1, :core, :sct])
31
+ expect(subject.direct_debit_instruments).to eq([:cor1, :core])
32
+ end
33
+
34
+ it 'returns faster cor1 first if order last' do
35
+ allow(subject).to receive(:capabilities).and_return([:core, :cor1])
36
+ expect(subject.direct_debit_instruments.first).to eq(:cor1)
37
+ end
38
+
39
+ it 'returns faster cor1 first if order properly' do
40
+ allow(subject).to receive(:capabilities).and_return([:cor1, :core])
41
+ expect(subject.direct_debit_instruments.first).to eq(:cor1)
42
+ end
43
+ end
44
+
28
45
  describe '#to_hash' do
29
46
  subject(:provider) { described_class.new(name: 'test', bic: 'bic', sct: true, core: false, cor1: true, b2b: true) }
30
47
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sepa_clearer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maximilian Schulz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-21 00:00:00.000000000 Z
11
+ date: 2014-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3