pin_up 1.4.2 → 1.4.3

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: b9d8c52115e2b37980524773fe44a0ccbffd91ecb3b5a033ac60f49fd1cc17c4
4
- data.tar.gz: d1b6259a2b5f15478731d1068cd2983b4f5e306c8fab2bf7a6bac2d62357bb1c
3
+ metadata.gz: e164965651e50f81fdc85cb4b21a4f4717428244c72f868cbdeda2b971841312
4
+ data.tar.gz: 4c5b20e30b65d3eafe442a71a53705ec5163c13571cc872564047da2abe956f9
5
5
  SHA512:
6
- metadata.gz: d83a6f44dc31bab5c5140a0d3047e4fb8ea4827d0f94ae4a17573406f712f3a40ac514e634e2e2143afef6f9e89f1cfbefd32e0682d8fc0b44ffe7d27c1fa508
7
- data.tar.gz: a2eb58981ca0ef056654bed2c86abadcf60c57de40be630b65bbc99e7a72a94a322e0815f5c794a8394dd83206df86c6408d027d194209deb402eeaf018b2db4
6
+ metadata.gz: 5db2600657d67aa262c3aef1ee3715ad3d6c3c75029ff7ac75ec0058384728a6e046233cbbef7b37cc8dfd08db7d53dabfd9a4c90a1735600fdf2589cc4ed08b
7
+ data.tar.gz: fb81889c9bfd3de39550f85a9fe1954e73ef5cc17d80bcccdf9ba2fbcfafe80dfd4b73861e0b47bbc1be1a28ad525bf857b9ff5b21794879b600abbe1e34fa48
@@ -2,7 +2,7 @@
2
2
  script: bundle exec rspec spec
3
3
  language: ruby
4
4
  sudo: false
5
- before_install: gem update bundler
5
+ before_install: gem install bundler:1.17.2
6
6
  rvm:
7
7
  - 2.3.0
8
8
  - 2.4.0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pin_up (1.4.2)
4
+ pin_up (1.4.3)
5
5
  httparty (= 0.17.0)
6
6
 
7
7
  GEM
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.2
1
+ 1.4.3
@@ -36,6 +36,8 @@ module Pin
36
36
  when 422
37
37
  message = handle_bad_response(response)
38
38
  raise Pin::InvalidResource.new(response, message)
39
+ else
40
+ raise Pin::Unknown.new(response, "Unknown error with status code #{http_status}")
39
41
  end
40
42
  end
41
43
 
@@ -72,6 +74,9 @@ module Pin
72
74
  end
73
75
  end
74
76
 
77
+ class Unknown < SimpleError
78
+ end
79
+
75
80
  class Unauthorized < SimpleError
76
81
  end
77
82
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "pin_up".freeze
9
- s.version = "1.4.2"
9
+ s.version = "1.4.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
@@ -6,7 +6,7 @@ describe Pin::BankAccounts, :vcr do
6
6
  end
7
7
 
8
8
  it 'creates a bank account token and returns its details' do
9
- options = { name: 'Roland Robot', bsb: '123456', number: '987654321' }
9
+ options = { name: 'Roland Robot', bsb: '012984', number: '987654321' }
10
10
  expect(Pin::BankAccounts.create(options)['token']).to match(/^[a-z]{2}[_]/)
11
11
  end
12
12
  end
@@ -339,7 +339,7 @@ describe 'Errors', :vcr, class: Pin::PinError do
339
339
  deleted_subscription_token = Pin::Subscription.delete(subscription_1_token)['token']
340
340
  expect { Pin::Subscription.delete(deleted_subscription_token) }.to raise_error do |error|
341
341
  expect(error).to be_a Pin::InvalidResource
342
- expect(error.message).to eq 'Cannot cancel subscription when state is trial_cancelling'
342
+ expect(error.message).to eq 'Cannot cancel subscription when state is cancelling'
343
343
  expect(error.response).to be_a Hash
344
344
  end
345
345
  end
@@ -114,8 +114,12 @@ describe 'Plan', :vcr, class: Pin::Plan do
114
114
  "created_at"=>match(/\d/),
115
115
  "customer_permissions"=>["cancel"],
116
116
  "token"=>match(/(plan)[_]([\w-]{22})/),
117
- "active_subscriptions"=>0,
118
- "trial_subscriptions"=>0)
117
+ "subscription_counts" => {
118
+ "trial"=>0,
119
+ "active"=>0,
120
+ "cancelling"=>0,
121
+ "cancelled"=>0
122
+ })
119
123
  end
120
124
 
121
125
  it 'should return a paginated list of all plans' do
@@ -6,7 +6,7 @@ describe Pin::Recipient, :vcr do
6
6
  name: 'Roland Robot',
7
7
  bank_account: {
8
8
  name: 'Roland Robot',
9
- bsb: '123456',
9
+ bsb: '012984',
10
10
  number: 987654321
11
11
  } }
12
12
  }
@@ -173,27 +173,30 @@ describe 'Subscription', :vcr, class: Pin::Subscription do
173
173
  expect(Pin::Subscription.reactivate(deactivated['token'])['state']).to eq('active')
174
174
  end
175
175
 
176
- it 'should fetch history for a subscription given a token' do
177
- expect(Pin::Subscription.history(subscription_2_token)).to_not eq []
178
- end
179
-
180
- it 'should go to a specific page when page parameter is passed' do
181
- request = Pin::Subscription.history(subscription_2_token, 20, true)
182
- expect(request[:pagination]['current']).to eq 20
183
- end
184
-
185
- it 'should list subscriptions on a page given a page' do
186
- request = Pin::Subscription.history(subscription_2_token, 1, true)
187
- expect(request[:response]).to_not eq []
188
- end
189
-
190
- it 'should return pagination if true is passed for pagination' do
191
- request = Pin::Subscription.history(subscription_2_token, 1, true)
192
- request[:pagination].key?(%W('current previous next per_page pages count))
193
- end
194
-
195
- it 'should not list subscriptions for a given page if there are no subscriptions' do
196
- request = Pin::Subscription.history(subscription_2_token, 25, true)
197
- expect(request[:response]).to eq []
198
- end
176
+ ## History no longer exists as an endpoint
177
+ ## Leaving this in for reference
178
+
179
+ # it 'should fetch history for a subscription given a token' do
180
+ # expect(Pin::Subscription.history(subscription_2_token)).to_not eq []
181
+ # end
182
+
183
+ # it 'should go to a specific page when page parameter is passed' do
184
+ # request = Pin::Subscription.history(subscription_2_token, 20, true)
185
+ # expect(request[:pagination]['current']).to eq 20
186
+ # end
187
+
188
+ # it 'should list subscriptions on a page given a page' do
189
+ # request = Pin::Subscription.history(subscription_2_token, 1, true)
190
+ # expect(request[:response]).to_not eq []
191
+ # end
192
+
193
+ # it 'should return pagination if true is passed for pagination' do
194
+ # request = Pin::Subscription.history(subscription_2_token, 1, true)
195
+ # request[:pagination].key?(%W('current previous next per_page pages count))
196
+ # end
197
+
198
+ # it 'should not list subscriptions for a given page if there are no subscriptions' do
199
+ # request = Pin::Subscription.history(subscription_2_token, 25, true)
200
+ # expect(request[:response]).to eq []
201
+ # end
199
202
  end
@@ -5,7 +5,7 @@ describe Pin::Transfer, :vcr do
5
5
  { email: 'test@example.com',
6
6
  name: 'Roland Robot',
7
7
  bank_account: { name: 'Roland Robot',
8
- bsb: '123456',
8
+ bsb: '012984',
9
9
  number: 987654321 } }
10
10
  }
11
11
 
@@ -55,5 +55,5 @@ describe Pin::Transfer, :vcr do
55
55
 
56
56
  it 'should list transfers for search on a page given a page' do
57
57
  expect(Pin::Transfer.search(1, query: 'Pay day')).to_not eq []
58
- end
58
+ end
59
59
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pin_up
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Nitsikopoulos