modulr-api 0.0.31 → 0.0.33

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: 3a04fe4ec976453a135e2388d53dd5dc143ff75236b1d2422d6c3f5890abcf34
4
- data.tar.gz: 38950add527426a6cbd2e70a6ceef4d47461742a6c43f72bed49b17b8787d9bb
3
+ metadata.gz: f18a9a4738ddda14b40cc77627da9f29e2a643f6dce53f0521d0dc3bdae126d4
4
+ data.tar.gz: d2b2f95e40bcd78b8092c9ac2e52df3711af21eec1998e8164ae9747467661b1
5
5
  SHA512:
6
- metadata.gz: 24e8fa1c452260a4ea01fdacd58798a3d117d2aaf90a00bbc9beb0ab5b7be9d17a51713be887f01c1f7d6544984a06b2324175728c6a4bbc1560249fa78e3744
7
- data.tar.gz: f4e31be0c3f3e7c83fccb9c97ba31d7c108da5c14a013a4a5729c42859721400e52f955f1fbf0105bb6b32f6a61b0801fec806cc1073f13da570ad34f44ab3e8
6
+ metadata.gz: efeddc4731f875ef59ce4694795dbcc2cf12af8875b02534a2e25b3926ce043830935e019fa23e3e2e774f53577de564fc9b996a9cda17d3a241d08274249d4e
7
+ data.tar.gz: 7838cc0b1a79731e40f4a73badb46559182d366ef1cd41c4013d4b9d4f86bcfa8d8915b5db0ac53bf9b6e153a0ad46b7e3970a33dfd9ea0d94f0fdbad5308049
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- modulr-api (0.0.31)
4
+ modulr-api (0.0.33)
5
5
  faraday (~> 1.0)
6
6
  faraday_middleware (~> 1.0)
7
7
 
@@ -47,6 +47,8 @@ module Modulr
47
47
  doc.dig(key, :document, :fitoFICstmrCdtTrf, :cdtTrfTxInf, :pmtId, :endToEndId)
48
48
  when "FFCCTRNS" # SEPA regular
49
49
  doc.dig(key, :document, :fitoFICstmrCdtTrf, :cdtTrfTxInf).first&.dig(:pmtId, :endToEndId)
50
+ when "PRTRN" # SEPA REVERSAL
51
+ nil
50
52
  end
51
53
  end
52
54
 
@@ -64,7 +66,7 @@ module Modulr
64
66
  detail_type = @attr_details&.dig(:type) || @attr_details&.dig(:destinationType)
65
67
 
66
68
  case detail_type
67
- when "PI_SECT", "PI_SEPA_INST", "PI_FAST", "PI_REV"
69
+ when "PI_SECT", "PI_SEPA_INST", "PI_FAST", "PI_REV", "PO_REV"
68
70
  incoming_detail
69
71
  when "ACCOUNT"
70
72
  incoming_internal_details
@@ -76,17 +78,17 @@ module Modulr
76
78
  private def payment_type
77
79
  @type = if incoming?
78
80
  @attr_details[:type]
81
+ elsif outgoing?
82
+ outgoing_type
79
83
  elsif internal?
80
84
  "INT_INTERC"
81
- else
82
- outgoing_type
83
85
  end
84
86
  @type
85
87
  end
86
88
 
87
89
  private def parse_scheme
88
90
  case payment_type
89
- when "PI_SECT", "PO_SECT"
91
+ when "PI_SECT", "PO_SECT", "PO_REV"
90
92
  sepa_regular
91
93
  when "PI_SEPA_INST", "PO_SEPA_INST"
92
94
  sepa_instant
@@ -94,8 +96,6 @@ module Modulr
94
96
  faster_payments
95
97
  when "INT_INTERC"
96
98
  internal
97
- else
98
- raise "Unable to find network and scheme for payment with ID: #{id} and Type: #{type}"
99
99
  end
100
100
  end
101
101
 
@@ -146,10 +146,13 @@ module Modulr
146
146
  !@attr_details.key?(:sourceAccountId)
147
147
  end
148
148
 
149
+ private def outgoing?
150
+ @attributes.key?(:schemeInfo) && !@attributes[:schemeInfo].empty?
151
+ end
152
+
149
153
  private def internal?
150
154
  (@attr_details[:sourceAccountId] && @attr_details.key?(:destinationId)) ||
151
- !@attributes.key?(:schemeInfo) ||
152
- @attributes[:schemeInfo].empty?
155
+ (@attributes.key?(:schemeInfo) && @attributes[:schemeInfo].empty?)
153
156
  end
154
157
  end
155
158
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Modulr
4
- VERSION = "0.0.31"
4
+ VERSION = "0.0.33"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modulr-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.31
4
+ version: 0.0.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aitor García Rey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-05 00:00:00.000000000 Z
11
+ date: 2023-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday