synapse_client 0.0.1 → 0.1.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
  SHA1:
3
- metadata.gz: 1c31d65fc404f16de0c7758b1006ad8eda2a3037
4
- data.tar.gz: 025e61fa99b415922116894a44bb2b5a37c7defa
3
+ metadata.gz: c7a33c25316f01091839470f1539e0f81bda0010
4
+ data.tar.gz: 537f9cf4da451dd4a73fb5058aeb586197acde13
5
5
  SHA512:
6
- metadata.gz: dd5ea5ccec30485c2db93c12f7a4bd4482cd45b344991d77c2e1e41f11cb75975f1199505102b355ddd16fdcb1a408d8b4806a9c6e4b649f9389e0c1d64d1708
7
- data.tar.gz: f1820556c5b92b014be2152f6a29ebe719676be918ece522d0d4facdc2e2983133b12e6c56734420c45bf3650cfd2f987e2618168fa54ccf782a2a9fd641e643
6
+ metadata.gz: a0065a10870245fbb2ecf035f8727c700f91b27f98f9bef7e77276ba253a82acae374d5bd37d174dffc863d5d203beda35e610c6fa43e859501f3c7fd023b7ed
7
+ data.tar.gz: 66b600e2af43be9b0f9f29affd252dd26607ee56a4e48aeaa3d27d21ad515d0949234c1aca87e4035d426472af6a821bc50a933566ded2f11fc5c734f87eebf0
data/README.md CHANGED
@@ -14,6 +14,19 @@ I ripped originally wrote this in a rails app of mine and stripped this out. The
14
14
  * all orders are bank pay orders
15
15
  * customers do not have passwords
16
16
 
17
+ ## Installation
18
+
19
+ Include the following in your `Gemfile`
20
+
21
+ ```ruby
22
+ gem "syanpse_client"
23
+ ```
24
+
25
+ and then run `bundle install`.
26
+
27
+ You can also simply run `gem install synapse_client`.
28
+
29
+
17
30
  ## Usage
18
31
 
19
32
  _See the specs for the most up to date usage demo._
@@ -96,16 +109,14 @@ _See the specs for the most up to date usage demo._
96
109
 
97
110
  ## TODO (in order of priority)
98
111
 
99
- * MFAs
112
+ * Better synapse error handling
113
+ * HTTP Error handling
114
+ * Logging
100
115
  * MassPay
101
- * View bank account
102
116
  * Refresh access tokens
103
117
  * Security Questions
104
118
  * Deposits
105
119
  * Withdrawals
106
- * Better synapse error handling
107
- * HTTP Error handling
108
- * Logging
109
120
  * Callbacks?
110
121
 
111
122
 
@@ -46,5 +46,10 @@ module SynapseClient
46
46
  instance
47
47
  end
48
48
 
49
+ #
50
+ def successful?
51
+ true
52
+ end
53
+
49
54
  end
50
55
  end
@@ -37,11 +37,14 @@ module SynapseClient
37
37
  update_attributes(response.data)
38
38
  end
39
39
 
40
- def self.retrieve(access_token)
40
+ def self.retrieve(access_token, refresh_token)
41
41
  response = SynapseClient.request(:post, url + "show", {:access_token => access_token})
42
42
 
43
43
  return response unless response.successful?
44
- Customer.new(response.data.user)
44
+ Customer.new(response.data.user.merge({
45
+ :access_token => access_token,
46
+ :refresh_token => refresh_token
47
+ }))
45
48
  end
46
49
 
47
50
  # TODO
@@ -1,3 +1,3 @@
1
1
  module SynapseClient
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -110,10 +110,13 @@ module SynapseClient
110
110
  end
111
111
 
112
112
  def self.execute_request(opts)
113
- puts "\n"
114
- puts "SynapseClient: About to send a request with the following opts:"
115
- puts opts
116
- puts "\n"
113
+ if dev?
114
+ puts "\n"
115
+ puts "SynapseClient: About to send a request with the following opts:"
116
+ puts opts
117
+ puts "\n"
118
+ end
119
+
117
120
  RestClient::Request.execute(opts)
118
121
  end
119
122
 
data/spec/spec_helper.rb CHANGED
@@ -71,7 +71,6 @@ require 'synapse_client'
71
71
  end
72
72
 
73
73
  def get_dummy_bank
74
-
75
74
  SynapseClient::Customer.create(dummy_customer_data)
76
75
  end
77
76
 
@@ -24,6 +24,7 @@ describe SynapseClient::BankAccount do
24
24
  expect(bank_account.id).to be_a Fixnum
25
25
  expect(bank_account.account_number_string).to be_a String
26
26
  expect(bank_account.routing_number_string).to be_a String
27
+ #expect(bank_account.bank_name).to be_a String
27
28
  expect(bank_account.nickname).to be_a String
28
29
  expect(bank_account.account_type).to be_a Fixnum
29
30
  expect(bank_account.account_class).to be_a Fixnum
@@ -12,6 +12,8 @@ describe SynapseClient::Customer do
12
12
  it "should successfully return a customer object with tokens and other info." do
13
13
  expect(@customer).to be_a SynapseClient::Customer
14
14
 
15
+ expect(@customer.successful?).to be true
16
+
15
17
  expect(@customer.email).to be @dummy_customer_data.email
16
18
  expect(@customer.fullname).to be @dummy_customer_data.fullname
17
19
  expect(@customer.phonenumber).to be @dummy_customer_data.phonenumber
@@ -26,7 +28,7 @@ describe SynapseClient::Customer do
26
28
 
27
29
  describe "retrieving a customer" do
28
30
  it "should successfully return a customer object with tokens and other info." do
29
- customer = SynapseClient::Customer.retrieve(@customer.access_token)
31
+ customer = SynapseClient::Customer.retrieve(@customer.access_token, @customer.refresh_token)
30
32
 
31
33
  expect(customer).to be_a SynapseClient::Customer
32
34
 
@@ -35,6 +37,9 @@ describe SynapseClient::Customer do
35
37
  expect(customer.fullname).to eq @dummy_customer_data.fullname
36
38
  expect(customer.phonenumber).to eq @dummy_customer_data.phonenumber
37
39
  expect(customer.username).to be_a String
40
+
41
+ expect(customer.access_token).to be_a String
42
+ expect(customer.refresh_token).to be_a String
38
43
  end
39
44
  end
40
45
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synapse_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Matthias
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-23 00:00:00.000000000 Z
11
+ date: 2015-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client