pin_up 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Gemfile.lock +2 -2
- data/README.md +6 -0
- data/VERSION +1 -1
- data/lib/pin_up/refund.rb +10 -0
- data/pin_up.gemspec +1 -1
- data/spec/refund_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9d8c52115e2b37980524773fe44a0ccbffd91ecb3b5a033ac60f49fd1cc17c4
|
4
|
+
data.tar.gz: d1b6259a2b5f15478731d1068cd2983b4f5e306c8fab2bf7a6bac2d62357bb1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d83a6f44dc31bab5c5140a0d3047e4fb8ea4827d0f94ae4a17573406f712f3a40ac514e634e2e2143afef6f9e89f1cfbefd32e0682d8fc0b44ffe7d27c1fa508
|
7
|
+
data.tar.gz: a2eb58981ca0ef056654bed2c86abadcf60c57de40be630b65bbc99e7a72a94a322e0815f5c794a8394dd83206df86c6408d027d194209deb402eeaf018b2db4
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
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.4.2
|
data/lib/pin_up/refund.rb
CHANGED
@@ -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)
|
data/pin_up.gemspec
CHANGED
data/spec/refund_spec.rb
CHANGED
@@ -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
|