synapse_client 0.1.0 → 0.1.1

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: c7a33c25316f01091839470f1539e0f81bda0010
4
- data.tar.gz: 537f9cf4da451dd4a73fb5058aeb586197acde13
3
+ metadata.gz: 9c9f0bea2033ceea2abbafe7c0eebb468d000c57
4
+ data.tar.gz: 5fa8315789897737790b98970aaebbefd80f4e96
5
5
  SHA512:
6
- metadata.gz: a0065a10870245fbb2ecf035f8727c700f91b27f98f9bef7e77276ba253a82acae374d5bd37d174dffc863d5d203beda35e610c6fa43e859501f3c7fd023b7ed
7
- data.tar.gz: 66b600e2af43be9b0f9f29affd252dd26607ee56a4e48aeaa3d27d21ad515d0949234c1aca87e4035d426472af6a821bc50a933566ded2f11fc5c734f87eebf0
6
+ metadata.gz: 309d3a9bc001263191bb9d0779ecc875d96e90eb4d90f0bfd3e40f13c37bb8c81d34392c2d7a7920e5853d62ed551e5f66eb929e2a8ddba664f7720aefc43701
7
+ data.tar.gz: 2f346d79be366b16a98bb1bd61f8f7f80d15333d361318d889f23b7cdced0df3a3c83827efcff23b1c9860423530809601b2e8ed233f9a3c6f94fc89b6703569
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  A ruby client for the SynapsePay.com API.
6
6
 
7
- I ripped originally wrote this in a rails app of mine and stripped this out. There's some work left to do to really make it a true ruby gem. See that in the todo section.
7
+ I originally wrote this in a rails app of mine and stripped this out. There's some work left to do to really make it a true ruby gem. See that in the todo section.
8
8
 
9
9
  ## Notes
10
10
 
@@ -19,7 +19,7 @@ I ripped originally wrote this in a rails app of mine and stripped this out. The
19
19
  Include the following in your `Gemfile`
20
20
 
21
21
  ```ruby
22
- gem "syanpse_client"
22
+ gem "synapse_client"
23
23
  ```
24
24
 
25
25
  and then run `bundle install`.
@@ -125,3 +125,13 @@ _See the specs for the most up to date usage demo._
125
125
  * [dev.synapsepay.com](http://dev.synapsepay.com)
126
126
  * [rubygems.org/gems/synapse_client](https://rubygems.org/gems/synapse_client)
127
127
 
128
+
129
+ ## Want to show your appreciation?
130
+
131
+ If this gem has helped you and you'd like to show your appreciation, feel free to use one of the methods below to buy me coffee:
132
+
133
+ [SquareCash](https://cash.me/$milesm)
134
+
135
+ [![Support via Gratipay](https://cdn.rawgit.com/gratipay/gratipay-badge/2.3.0/dist/gratipay.svg)](https://gratipay.com/milesmatthias/)
136
+
137
+
@@ -28,7 +28,7 @@ module SynapseClient
28
28
  def self.ensure_trailing_slash(url='')
29
29
  return url if url.empty?
30
30
  return url if url[-1] == "/"
31
- return url + "/"
31
+ "#{ url }/"
32
32
  end
33
33
 
34
34
  def self.api_url(url='')
@@ -5,7 +5,7 @@ module SynapseClient
5
5
  attr_accessor :id
6
6
 
7
7
  def self.class_name
8
- self.name.split('::')[-1]
8
+ self.name.split('::').last
9
9
  end
10
10
 
11
11
  def self.api_resource_name
@@ -5,6 +5,7 @@ module SynapseClient
5
5
  attr_accessor :email, :fullname, :phonenumber, :ip_address
6
6
  attr_accessor :access_token, :refresh_token, :expires_in
7
7
  attr_accessor :username
8
+ attr_accessor :force_create
8
9
 
9
10
  def initialize(options = {})
10
11
  options = Map.new(options)
@@ -19,6 +20,8 @@ module SynapseClient
19
20
  @refresh_token = options[:refresh_token]
20
21
  @expires_in = options[:expires_in]
21
22
  @username = options[:username]
23
+
24
+ @force_create = options[:force_create]
22
25
  end
23
26
 
24
27
  def self.api_resource_name
@@ -132,6 +135,7 @@ module SynapseClient
132
135
 
133
136
  private
134
137
  def update_attributes(data)
138
+ @id = data.user_id
135
139
  @access_token = data.access_token
136
140
  @refresh_token = data.refresh_token
137
141
  @expires_in = data.expires_in
@@ -1,3 +1,3 @@
1
1
  module SynapseClient
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -19,11 +19,32 @@ describe SynapseClient::Customer do
19
19
  expect(@customer.phonenumber).to be @dummy_customer_data.phonenumber
20
20
  expect(@customer.ip_address).to be @dummy_customer_data.ip_address
21
21
 
22
+ expect(@customer.id).to be_a Fixnum
22
23
  expect(@customer.access_token).to be_a String
23
24
  expect(@customer.refresh_token).to be_a String
24
25
  expect(@customer.expires_in).to be_a Fixnum
25
26
  expect(@customer.username).to be_a String
26
27
  end
28
+
29
+ it "should successfully return a customer when a dup user is created and force_create is used" do
30
+ @dup_data = @dummy_customer_data.merge(:force_create => true)
31
+ @customer_dup = SynapseClient::Customer.create(@dup_data)
32
+
33
+ expect(@customer_dup).to be_a SynapseClient::Customer
34
+
35
+ expect(@customer_dup.successful?).to be true
36
+
37
+ expect(@customer_dup.email).to be @dup_data.email
38
+ expect(@customer_dup.fullname).to be @dup_data.fullname
39
+ expect(@customer_dup.phonenumber).to be @dup_data.phonenumber
40
+ expect(@customer_dup.ip_address).to be @dup_data.ip_address
41
+
42
+ expect(@customer.id).to be_a Fixnum
43
+ expect(@customer_dup.access_token).to be_a String
44
+ expect(@customer_dup.refresh_token).to be_a String
45
+ expect(@customer_dup.expires_in).to be_a Fixnum
46
+ expect(@customer_dup.username).to be_a String
47
+ end
27
48
  end
28
49
 
29
50
  describe "retrieving a customer" do
@@ -32,12 +53,12 @@ describe SynapseClient::Customer do
32
53
 
33
54
  expect(customer).to be_a SynapseClient::Customer
34
55
 
35
- expect(customer.id).to be_a Fixnum
36
56
  expect(customer.email).to eq @dummy_customer_data.email
37
57
  expect(customer.fullname).to eq @dummy_customer_data.fullname
38
58
  expect(customer.phonenumber).to eq @dummy_customer_data.phonenumber
39
59
  expect(customer.username).to be_a String
40
60
 
61
+ expect(customer.id).to be_a Fixnum
41
62
  expect(customer.access_token).to be_a String
42
63
  expect(customer.refresh_token).to be_a String
43
64
  end
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.1.0
4
+ version: 0.1.1
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-04-03 00:00:00.000000000 Z
11
+ date: 2015-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client