paidy 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60b7d42b64dfcec3324ca3cafadc777d1e74182d54ae8569cfb59c3eca7ddedc
4
- data.tar.gz: 1f0e3bcccbb0057c8bb9b2f964a0a44306850d205391d9e0766e44c327eaf0b8
3
+ metadata.gz: ccaa567a87ad47723bc91dff6d84fd4b7ea4485da9eaa2f760c2389d3198c5a1
4
+ data.tar.gz: 4421097c1ade907c9e9dbd5df8da87b57f123bbcddaabc96179415c648bc5190
5
5
  SHA512:
6
- metadata.gz: cce61e83e5a263a032b8c09464c2a0e6a9b938d2f7e6081a8310acea635d86404130d0c58f321fd3ea16f4daa984aba15f7b5f8a0d052d931d2dc40c3bfd00d8
7
- data.tar.gz: c652a90eb5301997e503bbe6435aa275c7219cc9da2bc2fc0966e6f79f5beec0713796829910b78504ffba8d3721ae9ecbad0df90d98bc01acfa8c2ad97437cc
6
+ metadata.gz: bf34a7aceef972e2dce2317ac35f377489df385998c75c7247da5157989f618e722cd22e61376c993675fffeffb35e430c4c792f9c1b9603e0e642ed66d4ebcb
7
+ data.tar.gz: 496383e260ffb909976cc18ad33357e46f9f8f66be03d5580e2ca1b990e620cd52b5e513c9a62d56c1e309c350b66b9edc740e2d722d97f7e7c633fa5eed9097
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paidy (0.0.3)
4
+ paidy (0.0.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -20,7 +20,7 @@ module Paidy
20
20
  @capture_id = nil
21
21
  end
22
22
 
23
- attr_reader :id, :capture_id, :status
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
- res = Paidy.request(:post, "#{base_path}/refund", { capture_id: capture_id }, {})
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
 
@@ -1,3 +1,3 @@
1
1
  module Paidy
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
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.3
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-15 00:00:00.000000000 Z
11
+ date: 2020-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler