plaid_rails 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/plaid_rails/accounts_controller.rb +4 -3
- data/app/controllers/plaid_rails/link_controller.rb +2 -2
- data/app/models/plaid_rails/account.rb +2 -1
- data/app/services/plaid_rails/create_account_service.rb +4 -2
- data/lib/plaid_rails/version.rb +1 -1
- data/spec/controllers/plaid_rails/accounts_controller_spec.rb +1 -1
- data/spec/controllers/plaid_rails/link_controller_spec.rb +1 -1
- data/spec/dummy/log/test.log +3899 -0
- data/spec/models/plaid_rails/account_spec.rb +5 -6
- data/spec/services/plaid_rails/create_account_service_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d20288ae52a3c55735e45555b58da6ef3086e1f
|
4
|
+
data.tar.gz: e8b1a5ea03b763be1a188c9be56a42a724d2f7a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6081b6bf3de23372e2988b1de4e9580477d13c5cf3b7fd06c5062a9b56eeb93db642f6747bece54ceb28ffd6d668d37ae375deb92b8251654eda09935fbee4f9
|
7
|
+
data.tar.gz: 8c23aee3dbbc54619f470d3231203d23069450dba0a7806e748b5645a816db4e344ab14360ea244b5e4a07594db042218ec4da1ca52eb00993a0cf89e3c71a76
|
@@ -9,9 +9,10 @@ module PlaidRails
|
|
9
9
|
|
10
10
|
# display list of accounts for authenticated user
|
11
11
|
def new
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
account_params["access_token"]
|
13
|
+
@user = Plaid::User.load(:connect, account_params["access_token"])
|
14
|
+
@user.transactions
|
15
|
+
puts "@user #{@user.inspect}"
|
15
16
|
@accounts = @user.accounts
|
16
17
|
end
|
17
18
|
|
@@ -5,7 +5,7 @@ module PlaidRails
|
|
5
5
|
|
6
6
|
def authenticate
|
7
7
|
begin
|
8
|
-
@exchange_token = Plaid.exchange_token(link_params[:public_token])
|
8
|
+
@exchange_token = Plaid::User.exchange_token(link_params[:public_token])
|
9
9
|
|
10
10
|
@params = link_params.merge!(token: link_params[:public_token])
|
11
11
|
|
@@ -18,7 +18,7 @@ module PlaidRails
|
|
18
18
|
|
19
19
|
def update
|
20
20
|
begin
|
21
|
-
exchange_token = Plaid.exchange_token(link_params[:public_token])
|
21
|
+
exchange_token = Plaid::User.exchange_token(link_params[:public_token])
|
22
22
|
|
23
23
|
@accounts =PlaidRails::Account.where(owner_type: link_params[:owner_type],
|
24
24
|
owner_id: link_params[:owner_id])
|
@@ -16,7 +16,8 @@ module PlaidRails
|
|
16
16
|
token = self.access_token
|
17
17
|
begin
|
18
18
|
if PlaidRails::Account.where(access_token: token).size == 1
|
19
|
-
Plaid::
|
19
|
+
user = Plaid::User.load(:connect, token)
|
20
|
+
user.delete
|
20
21
|
end
|
21
22
|
rescue => e
|
22
23
|
message = "Unable to delete token #{token}"
|
@@ -5,7 +5,9 @@ module PlaidRails
|
|
5
5
|
def self.call(account_params)
|
6
6
|
account_params["account_ids"].each do |id|
|
7
7
|
# set Plaid::User
|
8
|
-
user = Plaid.
|
8
|
+
user = Plaid::User.load(:connect, account_params["access_token"])
|
9
|
+
# get all the info, make plaid /connect/get call
|
10
|
+
user.transactions
|
9
11
|
#find the account by account_id
|
10
12
|
account = user.accounts.find{|a| a.id==id}
|
11
13
|
PlaidRails::Account.create!(
|
@@ -13,7 +15,7 @@ module PlaidRails
|
|
13
15
|
token: account_params["token"],
|
14
16
|
plaid_type: account_params["type"],
|
15
17
|
name: account.name,
|
16
|
-
bank_name: Plaid.
|
18
|
+
bank_name: Plaid::LongTailInstitution.get(account_params["type"]).name,
|
17
19
|
number: account.meta["number"],
|
18
20
|
owner_id: account_params["owner_id"],
|
19
21
|
owner_type: account_params["owner_type"],
|
data/lib/plaid_rails/version.rb
CHANGED
@@ -5,7 +5,7 @@ module PlaidRails
|
|
5
5
|
routes { PlaidRails::Engine.routes }
|
6
6
|
let(:account){create(:account)}
|
7
7
|
let(:public_token){'test,wells,connected'}
|
8
|
-
let(:user){Plaid.
|
8
|
+
let(:user){Plaid::User.load(:connect, 'test_wells').upgrade(:info)}
|
9
9
|
|
10
10
|
it "get index" do
|
11
11
|
get :index, account:{owner_id: 1}
|
@@ -16,7 +16,7 @@ module PlaidRails
|
|
16
16
|
owner_id: "1", owner_type: "User"
|
17
17
|
expect(response).to_not be_success
|
18
18
|
expect(response.status).to eq 500
|
19
|
-
expect(response.body).to
|
19
|
+
expect(response.body).to include "unauthorized product"
|
20
20
|
end
|
21
21
|
|
22
22
|
it "update with public token" do
|