killbill-client 0.19.0 → 0.20.0

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
  SHA1:
3
- metadata.gz: bf57aa5775c4415be5e62cc63b60827b9fe4bb67
4
- data.tar.gz: 49a3f91bfaa3bcb203803f839e71c7d687079b23
3
+ metadata.gz: 24a9cefd8fc392a9c9873bb18d836780e610b473
4
+ data.tar.gz: 16b90d26bc0be07caf516fd5f4e9c98671234a58
5
5
  SHA512:
6
- metadata.gz: 6c96c331f759ddf337eefab322770ca178a6ec5c9d44ce7f595a421170b55653c6e66a6369a625cc97eb07910561bd24168c10f7d5addf0c1e30ac6c3e410c84
7
- data.tar.gz: 184ed291a2b810942ba1e555aed2c96c6f380f95b443ce089f958ca6e0ce2a7f0e045371b159cfe3514b1a27576f0668fbcc24402ca4eb6a136cbb1f2f1a5767
6
+ metadata.gz: 15c6ca721a7a034f2779e0236fa501ffbd0f5fc89a1f5f2124ec1b764aa130774b4a6cc8d4b73d09493dc61b3c9e5b62fe0ade3e445c2aa49652a2e1d825d1ab
7
+ data.tar.gz: 6805b2984556a842ee0848121103453e6a94f64b2643996f556961db8c1741ebd9f18aad0212bf4d028b012daac51d0a31ac6ed14fd43cd5cd867264e22b65e2
@@ -87,6 +87,7 @@ module KillBillClient
87
87
  if options[:accept]
88
88
  request['Accept'] = options[:accept]
89
89
  end
90
+
90
91
  if options[:body]
91
92
  request['Content-Type'] = options[:content_type] || content_type
92
93
  request.body = options[:body]
@@ -155,8 +156,7 @@ module KillBillClient
155
156
  end
156
157
  cur_thread_profiling_data[key] << jaxrs_profiling_header['durationUsec']
157
158
  end
158
-
159
-
159
+
160
160
  if KillBillClient.logger
161
161
  #noinspection RubyScope
162
162
  latency = (Time.now - start_time) * 1_000
@@ -28,6 +28,7 @@
28
28
  module KillBillClient
29
29
  module Model
30
30
  class InvoiceDryRunAttributes < Resource
31
+ attribute :dry_run_type
31
32
  attribute :dry_run_action
32
33
  attribute :phase_type
33
34
  attribute :product_name
@@ -74,16 +74,16 @@ module KillBillClient
74
74
  end
75
75
 
76
76
  def trigger_invoice_dry_run(account_id, target_date, upcoming_invoice_target_date, options = {})
77
+
78
+ dry_run = InvoiceDryRunAttributes.new
79
+ dry_run.dry_run_type = upcoming_invoice_target_date ? 'UPCOMING_INVOICE' : 'TARGET_DATE'
80
+
77
81
  query_map = {:accountId => account_id}
78
- if upcoming_invoice_target_date
79
- query_map[:targetDate] = "upcomingInvoiceTargetDate"
80
- elsif target_date != nil
81
- query_map[:targetDate] = target_date
82
- end
82
+ query_map[:targetDate] = target_date if target_date != nil
83
83
 
84
84
  begin
85
85
  res = post "#{KILLBILL_API_DRY_RUN_INVOICES_PREFIX}",
86
- {},
86
+ dry_run.to_json,
87
87
  query_map,
88
88
  {
89
89
  :user => 'trigger_invoice_dry_run',
@@ -106,6 +106,7 @@ module KillBillClient
106
106
  query_map[:targetDate] = target_date if !target_date.nil?
107
107
 
108
108
  dry_run = InvoiceDryRunAttributes.new
109
+ dry_run.dry_run_type = 'SUBSCRIPTION_ACTION'
109
110
  dry_run.dry_run_action = 'START_BILLING'
110
111
  dry_run.product_name = product_name
111
112
  dry_run.product_category = product_category
@@ -136,6 +137,7 @@ module KillBillClient
136
137
  query_map[:targetDate] = target_date if !target_date.nil?
137
138
 
138
139
  dry_run = InvoiceDryRunAttributes.new
140
+ dry_run.dry_run_type = 'SUBSCRIPTION_ACTION'
139
141
  dry_run.dry_run_action = 'CHANGE'
140
142
  dry_run.product_name = product_name
141
143
  dry_run.product_category = product_category
@@ -170,6 +172,7 @@ module KillBillClient
170
172
  query_map[:targetDate] = target_date if !target_date.nil?
171
173
 
172
174
  dry_run = InvoiceDryRunAttributes.new
175
+ dry_run.dry_run_type = 'SUBSCRIPTION_ACTION'
173
176
  dry_run.dry_run_action = 'STOP_BILLING'
174
177
  dry_run.effective_date = effective_date
175
178
  dry_run.billing_policy = billing_policy
@@ -1,7 +1,7 @@
1
1
  module KillBillClient
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 19
4
+ MINOR = 20
5
5
  PATCH = 0
6
6
  PRE = nil
7
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Killbill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-19 00:00:00.000000000 Z
11
+ date: 2015-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json