plaid 2.1.0 → 2.2.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/plaid/transaction.rb +5 -0
- data/lib/plaid/version.rb +1 -1
- data/lib/plaid/webhook.rb +27 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23f868bb29f987801f40bb8666471898caa9a51b
|
4
|
+
data.tar.gz: 2acc57e2e3f6e7df16b336078b26c0f85032f1c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76a97718db8ed7e5072c5ed55ccaf0bc9c281d412d6806b6f1da972bd0b3f46e86fde3fb62eebb6e511e568241f38d6b3fa0fc6ec488f0183cbc3688113439f1
|
7
|
+
data.tar.gz: 50a9f87dd4fb6f77cd6af0ebefaec70c20ef9d2d0b3266bb4e00da7f03a7b3e19d91b7e46fe98799fb22aab506d5f6e6307ec166369e150569c90721b10621aa
|
data/CHANGELOG.md
CHANGED
data/lib/plaid/transaction.rb
CHANGED
@@ -74,6 +74,10 @@ module Plaid
|
|
74
74
|
# E.g. "13005000".
|
75
75
|
attr_reader :category_id
|
76
76
|
|
77
|
+
# Public: A String attribute that is used by the bank/payment
|
78
|
+
# processor to identify transactions — where applicable.
|
79
|
+
attr_reader :reference_number
|
80
|
+
|
77
81
|
# Public: The String ID of a posted transaction's associated
|
78
82
|
# pending transaction - where applicable.
|
79
83
|
attr_reader :pending_transaction_id
|
@@ -91,6 +95,7 @@ module Plaid
|
|
91
95
|
@meta = Plaid.symbolize_hash(fields['meta'])
|
92
96
|
@location = (@meta && @meta[:location]) || {}
|
93
97
|
@pending = fields['pending']
|
98
|
+
@reference_number = fields['_reference_number']
|
94
99
|
@pending_transaction_id = fields['_pendingTransaction']
|
95
100
|
@score = Plaid.symbolize_hash(fields['score'])
|
96
101
|
|
data/lib/plaid/version.rb
CHANGED
data/lib/plaid/webhook.rb
CHANGED
@@ -78,6 +78,20 @@ module Plaid
|
|
78
78
|
code == Webhook::USER_WEBHOOK_UPDATED
|
79
79
|
end
|
80
80
|
|
81
|
+
# Public: Detect if the webhook is Income. Occurs when Income data is ready.
|
82
|
+
#
|
83
|
+
# Returns true if it is.
|
84
|
+
def income?
|
85
|
+
code == Webhook::INCOME
|
86
|
+
end
|
87
|
+
|
88
|
+
# Public: Detect if the webhook is Risk. Occurs when Risk data is ready.
|
89
|
+
#
|
90
|
+
# Returns true if it is.
|
91
|
+
def risk?
|
92
|
+
code == Webhook::RISK
|
93
|
+
end
|
94
|
+
|
81
95
|
# Public: Detect if the webhook is Error Response Webhook. Triggered when
|
82
96
|
# an error has occurred. Includes the relevant Plaid error code with
|
83
97
|
# details on both the error type and steps for error resolution.
|
@@ -118,12 +132,21 @@ module Plaid
|
|
118
132
|
|
119
133
|
private
|
120
134
|
|
121
|
-
|
135
|
+
ERROR_RESPONSE = -1
|
136
|
+
|
122
137
|
codex = {}
|
123
|
-
|
138
|
+
{
|
139
|
+
'initial transaction' => 0,
|
140
|
+
'historical transaction' => 1,
|
141
|
+
'normal transaction' => 2,
|
142
|
+
'removed transaction' => 3,
|
143
|
+
'user webhook updated' => 4,
|
144
|
+
'income' => 10,
|
145
|
+
'risk' => 20
|
146
|
+
}.each do |event, idx|
|
124
147
|
name = event.split.map(&:upcase).join('_')
|
125
|
-
codex[idx
|
126
|
-
const_set name, idx
|
148
|
+
codex[idx] = name
|
149
|
+
const_set name, idx
|
127
150
|
end
|
128
151
|
CODEX = codex.freeze
|
129
152
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plaid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Dashevskii
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|