paidy 0.0.3 → 0.0.4
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/paidy/charge.rb +9 -5
- data/lib/paidy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccaa567a87ad47723bc91dff6d84fd4b7ea4485da9eaa2f760c2389d3198c5a1
|
4
|
+
data.tar.gz: 4421097c1ade907c9e9dbd5df8da87b57f123bbcddaabc96179415c648bc5190
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf34a7aceef972e2dce2317ac35f377489df385998c75c7247da5157989f618e722cd22e61376c993675fffeffb35e430c4c792f9c1b9603e0e642ed66d4ebcb
|
7
|
+
data.tar.gz: 496383e260ffb909976cc18ad33357e46f9f8f66be03d5580e2ca1b990e620cd52b5e513c9a62d56c1e309c350b66b9edc740e2d722d97f7e7c633fa5eed9097
|
data/Gemfile.lock
CHANGED
data/lib/paidy/charge.rb
CHANGED
@@ -20,7 +20,7 @@ module Paidy
|
|
20
20
|
@capture_id = nil
|
21
21
|
end
|
22
22
|
|
23
|
-
attr_reader :id, :capture_id
|
23
|
+
attr_reader :id, :capture_id
|
24
24
|
|
25
25
|
def capture
|
26
26
|
res = Paidy.request(:post, "#{base_path}/captures", {}, {})
|
@@ -35,17 +35,21 @@ module Paidy
|
|
35
35
|
self
|
36
36
|
end
|
37
37
|
|
38
|
-
def refund
|
39
|
-
|
38
|
+
def refund(amount: nil, refund_reason: nil)
|
39
|
+
params = { capture_id: capture_id }
|
40
|
+
params[:amount] = amount if amount.present?
|
41
|
+
params[:reason] = refund_reason if refund_reason.present?
|
42
|
+
|
43
|
+
res = Paidy.request(:post, "#{base_path}/refunds", params, {})
|
40
44
|
|
41
45
|
self
|
42
46
|
end
|
43
47
|
|
44
|
-
def refund_or_close
|
48
|
+
def refund_or_close(amount: nil, refund_reason: nil)
|
45
49
|
if capture_id.nil?
|
46
50
|
close
|
47
51
|
else
|
48
|
-
refund
|
52
|
+
refund(amount: amount, refund_reason: refund_reason)
|
49
53
|
end
|
50
54
|
end
|
51
55
|
|
data/lib/paidy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paidy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rn0rno
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|