cashbox 0.0.36 → 0.0.37

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: d062a27e08c981cb998cce61a3dc02713a942d2f
4
- data.tar.gz: 140c71eea4451f8e2a8a4ab36f5b071f0451291b
3
+ metadata.gz: 2e8c90c985e2903b78aac8740875c83e34e2807f
4
+ data.tar.gz: 6ce13a773b53e115d6997f5f201e19c24ae959de
5
5
  SHA512:
6
- metadata.gz: 0ca49e3c61b12e40fbcb8285234e353ad1764cff66a455e08bc79d0996f8826e4deb8db90c09a5c1a2998bbf486f004463b6f9d999ee26124a6f52b2842e1e9f
7
- data.tar.gz: a34fb319076ce2724863d3c0bc8fbee4451cc98693e3224f360fba7b40ff3f26f1545a7847b741ba9d36a88acc0ef43f9b06b4528232e531beaee81094dc7b6a
6
+ metadata.gz: 016afcbef564c0dc62adae7a43dd333f37efd67794e442e8406ee8fb1614594285e4b8fd0f6205a53a990c27ed7669b218c8e31a2863819f36f2fd6f791c0eba
7
+ data.tar.gz: 4a8a7d55a37c06ee9e76fd61321556321c30d41c403a920016738dc09f1b1e2db9f10c90cca6ca340a677790352f5e2118cb46c98b16a36101b97709e03e57ea
data/Dockerfile CHANGED
@@ -1,12 +1,15 @@
1
1
  FROM paasmule/rbenv
2
2
 
3
3
  RUN mkdir /app
4
- ADD . /app
5
4
  WORKDIR /app
6
5
 
6
+ ADD .ruby-version ./
7
7
  RUN rbenv install $(cat .ruby-version)
8
+ RUN gem install bundler
8
9
 
9
- COPY Gemfile Gemfile.lock ./
10
- RUN gem install bundler && bundle install -j20
10
+ ADD Gemfile Gemfile.lock cashbox.gemspec ./
11
+ RUN mkdir -p ./lib/cashbox/
12
+ ADD lib/cashbox/version.rb ./lib/cashbox/
13
+ RUN bundle install
11
14
 
12
- COPY . ./
15
+ ADD . ./
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cashbox (0.0.36)
4
+ cashbox (0.0.37)
5
5
  activesupport
6
6
  addressable
7
7
  hashie
@@ -47,28 +47,19 @@ module Cashbox
47
47
  billing_state == GRACE_PERIOD
48
48
  end
49
49
 
50
- def add_subscription_item(product_to_add)
51
- subscription_item_to_add = Cashbox::SubscriptionItem.new({
52
- product: product_to_add
53
- })
54
-
55
- items.push(subscription_item_to_add)
56
- end
57
-
58
- def remove_subscription_item(product_to_remove)
59
- index = (items || []).index {|subscription_item| subscription_item.product.id == product_to_remove.id }
60
- items.delete_at(index) if index
61
- end
62
-
63
- def replace_subscription_item(product_to_add, product_to_remove)
64
- subscription_item_to_remove = remove_subscription_item(product_to_remove)
65
-
66
- add_subscription_item(product_to_add)
67
- items.last.replaces = subscription_item_to_remove.product.id if subscription_item_to_remove
68
- end
69
-
70
- def update_subscription_items
71
- Cashbox::Request.new(:post, "#{route(id)}?effective_date=today&bill_prorated_period=true", { body: self.to_json })
50
+ def add_subscription_items(subscription_items, bill_prorated)
51
+ request = Cashbox::Request.new(:post, route(vid),
52
+ {
53
+ query: {
54
+ effective_date: 'today',
55
+ bill_prorated_period: bill_prorated
56
+ },
57
+ body: {
58
+ id: id,
59
+ items: subscription_items
60
+ }.to_json
61
+ })
62
+ self.class.cast(self, request.response)
72
63
  end
73
64
  end
74
65
  end
@@ -1,3 +1,3 @@
1
1
  module Cashbox
2
- VERSION = "0.0.36"
2
+ VERSION = "0.0.37"
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.36
4
+ version: 0.0.37
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-11-04 00:00:00.000000000 Z
11
+ date: 2018-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  version: '0'
231
231
  requirements: []
232
232
  rubyforge_project:
233
- rubygems_version: 2.6.8
233
+ rubygems_version: 2.5.2
234
234
  signing_key:
235
235
  specification_version: 4
236
236
  summary: Cashbox Rest Client