cashbox 0.0.17 → 0.0.18

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
  SHA1:
3
- metadata.gz: dc1d49367ad6fd40dddd67b498273feb8df9cb42
4
- data.tar.gz: 6c3a3737e193c477b230f4461b7df222c453b2ef
3
+ metadata.gz: 47a735087da637425a37c57f9388e45cd746a103
4
+ data.tar.gz: 3103c5ca7d9f5f796a6d1ac02809002704cd7761
5
5
  SHA512:
6
- metadata.gz: ce9fa7492dab6deb7621bbf18768d9a51087c5dde64fdfe58b3682a0e5fb7935fef9ade81ea9e4c45305981d2c0d7771494dec067f58a9eae6489874fc7aacf6
7
- data.tar.gz: c5c9321d6845f2ed0721e3acd6a96247a7712c02037e088a60e75c088aa64cf3bcf9cab3a0f95a954d346b0fd7ffefc8ad1656773b27c58fd1eea2315f8b5245
6
+ metadata.gz: c7d3cc94cc631fd4b2257a5f33d7f76b4b56afc935584f1fe9fde098b2812a213e1a42d2a4f819fcb93950458c54a98191d7b2a4ee2103c49c5a83bb6ab45395
7
+ data.tar.gz: 31abd4be4c2fc8b3d908d692718af698975050ada11a69c84016117515cfc5740b95730b0937add2bfa689c08a28a3d5981b19a154d1e2280360ab896b600843
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cashbox (0.0.17)
4
+ cashbox (0.0.18)
5
5
  activesupport
6
6
  addressable
7
7
  hashie
@@ -66,6 +66,7 @@ module Cashbox
66
66
  autoload :Product
67
67
  autoload :ProductDescription
68
68
  autoload :ProductPrice
69
+ autoload :Refund
69
70
  autoload :Subscription
70
71
  autoload :SubscriptionItem
71
72
  autoload :Transaction
@@ -0,0 +1,18 @@
1
+ module Cashbox
2
+ class Refund < Model
3
+ include Concern::Objectable
4
+ include Rest::ReadWrite
5
+ include Rest::Refund
6
+
7
+ property :id
8
+ property :vid
9
+ property :created, coerce: Cashbox::Type.DateTime
10
+ property :transaction, coerce: Cashbox::Transaction
11
+ property :refund_distribution_strategy
12
+ property :amount
13
+ property :amount_includes_tax, coerce: Cashbox::Type.Boolean
14
+ property :currency
15
+ property :token_action
16
+ property :status
17
+ end
18
+ end
@@ -3,6 +3,7 @@ module Cashbox
3
3
  include Concern::Objectable
4
4
  include Rest::ReadWrite
5
5
  include Rest::Cancel
6
+ include Rest::Refund
6
7
 
7
8
  property :id
8
9
  property :vid
@@ -17,7 +17,7 @@ module Cashbox
17
17
  private
18
18
 
19
19
  def default_options
20
- { basic_auth: { username: Cashbox.username, password: Cashbox.password }}
20
+ { basic_auth: { username: Cashbox.username, password: Cashbox.password }, timeout: 100 }
21
21
  end
22
22
  end
23
23
  end
@@ -9,5 +9,6 @@ module Cashbox::Rest
9
9
  autoload :Disentitle
10
10
  autoload :Helpers
11
11
  autoload :ReadWrite
12
+ autoload :Refund
12
13
  end
13
14
  end
@@ -0,0 +1,16 @@
1
+ require 'active_support/concern'
2
+
3
+ module Cashbox::Rest
4
+ module Refund
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ include Cashbox::Rest::Helpers
9
+
10
+ def refund
11
+ request = Cashbox::Request.new(:post, "#{route(self.vid)}/refunds")
12
+ self.class.cast(Cashbox::Refund.new, request.response)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Cashbox
2
- VERSION = "0.0.17"
2
+ VERSION = "0.0.18"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cashbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathon Storer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-22 00:00:00.000000000 Z
11
+ date: 2018-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -191,6 +191,7 @@ files:
191
191
  - lib/cashbox/model/product.rb
192
192
  - lib/cashbox/model/product_description.rb
193
193
  - lib/cashbox/model/product_price.rb
194
+ - lib/cashbox/model/refund.rb
194
195
  - lib/cashbox/model/subscription.rb
195
196
  - lib/cashbox/model/subscription_item.rb
196
197
  - lib/cashbox/model/transaction.rb
@@ -204,6 +205,7 @@ files:
204
205
  - lib/cashbox/rest/disentitle.rb
205
206
  - lib/cashbox/rest/helpers.rb
206
207
  - lib/cashbox/rest/read_write.rb
208
+ - lib/cashbox/rest/refund.rb
207
209
  - lib/cashbox/type.rb
208
210
  - lib/cashbox/version.rb
209
211
  homepage: https://github.com/legalshield/cashbox