pin_up 1.4.1 → 1.4.2

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: 8cd621a87b31feec9398239fb846abf0bc7117d72aac49d9c68d6d7d279fe7c4
4
- data.tar.gz: 3e5a01721cb0a881664e7643f9295f2bf1a8e1ca0e5344af4cab6ac4c8e50b65
3
+ metadata.gz: b9d8c52115e2b37980524773fe44a0ccbffd91ecb3b5a033ac60f49fd1cc17c4
4
+ data.tar.gz: d1b6259a2b5f15478731d1068cd2983b4f5e306c8fab2bf7a6bac2d62357bb1c
5
5
  SHA512:
6
- metadata.gz: 7ea5de17437a508844cc3989a7203f33c4c29885cc9faab46627c9432e1b67927c2384334a95e9281e986746c554029868c54562e55a33340631034f3cd77a55
7
- data.tar.gz: 145598a3fef5ce8f34b681443d7eb7ce20a8f9b3f9712aa4733c68473c97cd3e12ed25af85ffb56f30078319c368428194ee7ac054807a21e0d54f9a6656aa79
6
+ metadata.gz: d83a6f44dc31bab5c5140a0d3047e4fb8ea4827d0f94ae4a17573406f712f3a40ac514e634e2e2143afef6f9e89f1cfbefd32e0682d8fc0b44ffe7d27c1fa508
7
+ data.tar.gz: a2eb58981ca0ef056654bed2c86abadcf60c57de40be630b65bbc99e7a72a94a322e0815f5c794a8394dd83206df86c6408d027d194209deb402eeaf018b2db4
@@ -2,6 +2,7 @@
2
2
  script: bundle exec rspec spec
3
3
  language: ruby
4
4
  sudo: false
5
+ before_install: gem update bundler
5
6
  rvm:
6
7
  - 2.3.0
7
8
  - 2.4.0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pin_up (1.4.0)
4
+ pin_up (1.4.2)
5
5
  httparty (= 0.17.0)
6
6
 
7
7
  GEM
@@ -61,4 +61,4 @@ DEPENDENCIES
61
61
  webmock (~> 3.6.0)
62
62
 
63
63
  BUNDLED WITH
64
- 1.17.3
64
+ 1.17.2
data/README.md CHANGED
@@ -166,6 +166,12 @@ This method will raise an exception if attempting to remove the user's primary c
166
166
 
167
167
  This will list all refunds for a particular charge (will return an empty hash if nothing is found)
168
168
 
169
+ ##### Get A Refund
170
+
171
+ Pin::Refund.get('refund_token')
172
+
173
+ This will return the details of the specified refund ( will throw a `Pin::ResourceNotFound` if nothing is found)
174
+
169
175
  ##### Create A Refund Specifying An Amount
170
176
 
171
177
  Pin::Refund.create('charge_token', '400')
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.1
1
+ 1.4.2
@@ -15,6 +15,16 @@ module Pin
15
15
  build_collection_response(make_request(:get, { url: "charges/#{token}/refunds?page=#{page}" } ), pagination)
16
16
  end
17
17
 
18
+ ##
19
+ # Returns the details of the specified refund.
20
+ # returns: a refund object
21
+ # args: token (String)
22
+ #
23
+ # https://pinpayments.com/docs/api/refunds#get-refund
24
+ def self.get(token)
25
+ build_response(make_request(:get, { url: "refunds/#{token}" } ))
26
+ end
27
+
18
28
  ##
19
29
  # Create a refund for a charge
20
30
  # args: token (String), amount (String - optional)
@@ -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.1"
9
+ s.version = "1.4.2"
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]
@@ -58,4 +58,9 @@ describe 'Refund', :vcr, class: Pin::Refund do
58
58
  it 'should create a refund for a given amount and charge' do
59
59
  expect(Pin::Refund.find(charge['token'])[0]['amount']).to eq 400
60
60
  end
61
+
62
+ it 'should return details of specified refund' do
63
+ refund_token = Pin::Refund.find(charge['token'])[0]['token']
64
+ expect(Pin::Refund.get(refund_token)['amount']).to eq 400
65
+ end
61
66
  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.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Nitsikopoulos