killbill-client 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -48,7 +48,7 @@ module KillBillClient
48
48
  tag_definition = TagDefinition.new
49
49
  tag_definition.name = tag_name
50
50
  tag_definition.description = "Tag created for account #{@account_id}"
51
- tag_definition = TagDefinition.create(user)
51
+ tag_definition = TagDefinition.create(user, options)
52
52
  end
53
53
 
54
54
  created_tag = self.class.post "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/tags",
@@ -0,0 +1,78 @@
1
+ module KillBillClient
2
+ module Model
3
+ class EntitlementNoEvents < EntitlementAttributesNoEvents
4
+
5
+ KILLBILL_API_ENTITLEMENT_PREFIX = "#{KILLBILL_API_PREFIX}/entitlements"
6
+
7
+ class << self
8
+ def find_by_id(entitlement_id, options = {})
9
+ get "#{KILLBILL_API_ENTITLEMENT_PREFIX}/#{entitlement_id}",
10
+ {},
11
+ options
12
+ end
13
+ end
14
+
15
+ #
16
+ # Create a new entitlement
17
+ #
18
+ def create(user = nil, reason = nil, comment = nil, options = {})
19
+ created_entitlement = self.class.post KILLBILL_API_ENTITLEMENT_PREFIX,
20
+ to_json,
21
+ {},
22
+ {
23
+ :user => user,
24
+ :reason => reason,
25
+ :comment => comment,
26
+ }.merge(options)
27
+ created_entitlement.refresh(options)
28
+ end
29
+
30
+ #
31
+ # Change the plan of the existing Entitlement
32
+ #
33
+ # @input : the hash with the new product info { product_name, billing_period, price_list}
34
+ # @requested_date : the date when that change should occur
35
+ # @billing_policy : the override for the billing policy {END_OF_TERM, IMMEDIATE}
36
+ # @ call_completion : whether the call should wait for invoice/payment to be completed before calls return
37
+ #
38
+ def change_plan(input, user = nil, reason = nil, comment = nil,
39
+ requested_date = nil, billing_policy = nil, call_completion = false,options = {})
40
+
41
+ params = {}
42
+ params[:callCompletion] = call_completion
43
+ params[:requestedDate] = requested_date unless requested_date.nil?
44
+ params[:policy] = billing_policy unless billing_policy.nil?
45
+
46
+ return self.class.put "#{KILLBILL_API_ENTITLEMENT_PREFIX}/#{@subscription_id}",
47
+ input.to_json,
48
+ params,
49
+ {
50
+ :user => user,
51
+ :reason => reason,
52
+ :comment => comment,
53
+ }.merge(options)
54
+ end
55
+
56
+ #
57
+ # Cancel the entitlement at the requested date
58
+ #
59
+ # @requested_date : the date when that change should occur
60
+ # @billing_policy : the override for the billing policy {END_OF_TERM, IMMEDIATE}
61
+ #
62
+ def cancel(user = nil, reason = nil, comment = nil, requested_date = nil, billing_policy = nil, options = {})
63
+
64
+ params = {}
65
+ params[:requestedDate] = requested_date unless requested_date.nil?
66
+ params[:policy] = billing_policy unless billing_policy.nil?
67
+
68
+ return self.class.delete "#{KILLBILL_API_ENTITLEMENT_PREFIX}/#{@subscription_id}",
69
+ params,
70
+ {
71
+ :user => user,
72
+ :reason => reason,
73
+ :comment => comment,
74
+ }.merge(options)
75
+ end
76
+ end
77
+ end
78
+ end
@@ -11,6 +11,7 @@ require 'killbill_client/models/subscription_deleted_event'
11
11
  require 'killbill_client/models/subscription_new_event'
12
12
  require 'killbill_client/models/chargeback'
13
13
  require 'killbill_client/models/subscription_event'
14
+ require 'killbill_client/models/entitlement_no_events'
14
15
  require 'killbill_client/models/bundle'
15
16
  require 'killbill_client/models/refund'
16
17
  require 'killbill_client/models/account'
@@ -2,7 +2,7 @@ module KillBillClient
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
- PATCH = 1
5
+ PATCH = 2
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-23 00:00:00.000000000 Z
12
+ date: 2013-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -65,6 +65,7 @@ files:
65
65
  - lib/killbill_client/models/bundle.rb
66
66
  - lib/killbill_client/models/chargeback.rb
67
67
  - lib/killbill_client/models/credit.rb
68
+ - lib/killbill_client/models/entitlement_no_events.rb
68
69
  - lib/killbill_client/models/event.rb
69
70
  - lib/killbill_client/models/gen/account_attributes.rb
70
71
  - lib/killbill_client/models/gen/account_attributes_simple.rb
@@ -162,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
163
  version: '0'
163
164
  segments:
164
165
  - 0
165
- hash: 180782920600309884
166
+ hash: 2953616694403421406
166
167
  requirements: []
167
168
  rubyforge_project:
168
169
  rubygems_version: 1.8.25