killbill-client 0.6.1 → 0.7.1

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.
Files changed (48) hide show
  1. checksums.yaml +13 -5
  2. data/gen_config/model.conf +1 -1
  3. data/lib/killbill_client/models/account.rb +45 -0
  4. data/lib/killbill_client/models/chargeback.rb +10 -10
  5. data/lib/killbill_client/models/gen/account_attributes.rb +1 -0
  6. data/lib/killbill_client/models/gen/account_email_attributes.rb +1 -0
  7. data/lib/killbill_client/models/gen/account_timeline_attributes.rb +1 -0
  8. data/lib/killbill_client/models/gen/audit_log_attributes.rb +1 -0
  9. data/lib/killbill_client/models/gen/billing_exception_attributes.rb +1 -0
  10. data/lib/killbill_client/models/gen/bundle_attributes.rb +1 -0
  11. data/lib/killbill_client/models/gen/bundle_timeline_attributes.rb +1 -0
  12. data/lib/killbill_client/models/gen/catalog_attributes_simple.rb +1 -0
  13. data/lib/killbill_client/models/gen/chargeback_attributes.rb +1 -0
  14. data/lib/killbill_client/models/gen/credit_attributes.rb +1 -0
  15. data/lib/killbill_client/models/gen/custom_field_attributes.rb +4 -0
  16. data/lib/killbill_client/models/gen/deleted_event_subscription_attributes.rb +1 -0
  17. data/lib/killbill_client/models/gen/event_subscription_attributes.rb +1 -0
  18. data/lib/killbill_client/models/gen/invoice_attributes.rb +1 -0
  19. data/lib/killbill_client/models/gen/invoice_email_attributes.rb +1 -0
  20. data/lib/killbill_client/models/gen/invoice_item_attributes.rb +2 -0
  21. data/lib/killbill_client/models/gen/new_event_subscription_attributes.rb +1 -0
  22. data/lib/killbill_client/models/gen/notification_attributes.rb +1 -0
  23. data/lib/killbill_client/models/gen/overdue_state_attributes.rb +1 -0
  24. data/lib/killbill_client/models/gen/payment_attributes.rb +1 -0
  25. data/lib/killbill_client/models/gen/payment_method_attributes.rb +1 -0
  26. data/lib/killbill_client/models/gen/payment_method_plugin_detail_attributes.rb +1 -0
  27. data/lib/killbill_client/models/gen/payment_method_properties.rb +1 -0
  28. data/lib/killbill_client/models/gen/phase_attributes.rb +1 -0
  29. data/lib/killbill_client/models/gen/plan_attributes.rb +1 -0
  30. data/lib/killbill_client/models/gen/plan_detail_attributes.rb +1 -0
  31. data/lib/killbill_client/models/gen/price_attributes.rb +1 -0
  32. data/lib/killbill_client/models/gen/product_attributes.rb +1 -0
  33. data/lib/killbill_client/models/gen/refund_attributes.rb +1 -0
  34. data/lib/killbill_client/models/gen/require_gen.rb +2 -0
  35. data/lib/killbill_client/models/gen/session_attributes.rb +1 -0
  36. data/lib/killbill_client/models/gen/stack_trace_element_attributes.rb +1 -0
  37. data/lib/killbill_client/models/gen/subject_attributes.rb +1 -0
  38. data/lib/killbill_client/models/gen/subscription_attributes.rb +1 -0
  39. data/lib/killbill_client/models/gen/tag_attributes.rb +1 -0
  40. data/lib/killbill_client/models/gen/tag_definition_attributes.rb +2 -0
  41. data/lib/killbill_client/models/gen/tenant_attributes.rb +1 -0
  42. data/lib/killbill_client/models/gen/tenant_key_attributes.rb +1 -0
  43. data/lib/killbill_client/models/gen/usage_attributes.rb +37 -0
  44. data/lib/killbill_client/models/payment.rb +8 -0
  45. data/lib/killbill_client/models/resource.rb +3 -3
  46. data/lib/killbill_client/version.rb +1 -1
  47. data/spec/killbill_client/remote/model_spec.rb +23 -0
  48. metadata +16 -15
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8a1ba7df0c11d58bae87d25376041a527fcc6330
4
- data.tar.gz: 532f2b61c9e642c351291cde91bdf971ad01d289
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YmM1ZjRkNzgyZTcwMmYyYmZkM2Q0NWI4YjRlZjg4OGIzNjZkNDBhYg==
5
+ data.tar.gz: !binary |-
6
+ ZjM2M2Q1YWRjMmMxN2ZkMTY0N2RhNzUzMmZjNTBkMmY3M2I2Yjk2Nw==
5
7
  SHA512:
6
- metadata.gz: 60498ebffd8895c1ef9a8033b9094769b0f08c5c38b542c8a94e6ceffd73f4713cc463af4f75d894667aedd21254f0d50189987eca435a702655fb41ec2cbf41
7
- data.tar.gz: a08247a3e8bea8880ebda71650088ccaf38414bc88688730b4d58e8b4751764bf44653e3667fb37910fda91a6f0ee6096d1d9f03fe738a6a9f10f6d201a2d30c
8
+ metadata.gz: !binary |-
9
+ MjMxZDk5NjY3OWM1OTNmOGU1YmI2MzBkODk2ZDM5NWNkNDJkY2I4ZmNkMThl
10
+ NGZkN2E2OTIyYWExNWU4NDMxYjQ1OGM1MWQ5OWMxMGVhOThiMTIxYTMzYWE5
11
+ ZDA4OTk2ODkzMjI4Mzg2OWE0YjMwYzNkZDY2MzUyNWRkYTM1NGM=
12
+ data.tar.gz: !binary |-
13
+ Y2NkNTgxNGM2NDg0MWNkZTQ3NzQzNzdjNDM5ZTY3NDc5MGFkOGJiYmFkZjFk
14
+ MDViODA4ODYxZTA1NTQ3ZWUyZjBjZjNjOGVjMThhM2MzZGRiNDYwMDUwY2U3
15
+ OTc0YTg2ZTFiZjkzNmIxOGY3YTU4YTdmODA0MDcwN2U3NjFlM2Y=
@@ -1 +1 @@
1
- java -cp target/killbill-java-parser-0.0.1-SNAPSHOT.jar com.ning.killbill.KillbillParser -i file:///<KILLBILL_REPO>/jaxrs/src/main/java/com/ -o /tmp/output -t RUBY_CLIENT_API -p com.ning.billing.jaxrs.json
1
+ java -cp target/killbill-java-parser-0.0.1-SNAPSHOT.jar com.ning.killbill.KillbillParser -i file:///<KILLBILL_REPO>/jaxrs/src/main/java/ -o /tmp/output -t RUBY_CLIENT_API -p org.killbill.billing.jaxrs.json
@@ -34,6 +34,16 @@ module KillBillClient
34
34
  options
35
35
  end
36
36
 
37
+ def find_by_external_key(external_key, with_balance = false, with_balance_and_cba = false, options = {})
38
+ get "#{KILLBILL_API_ACCOUNTS_PREFIX}",
39
+ {
40
+ :externalKey => external_key,
41
+ :accountWithBalance => with_balance,
42
+ :accountWithBalanceAndCBA => with_balance_and_cba
43
+ },
44
+ options
45
+ end
46
+
37
47
  def find_in_batches_by_search_key(search_key, offset = 0, limit = 100, with_balance = false, with_balance_and_cba = false, options = {})
38
48
  get "#{KILLBILL_API_ACCOUNTS_PREFIX}/search/#{search_key}",
39
49
  {
@@ -124,6 +134,41 @@ module KillBillClient
124
134
  }.merge(options)
125
135
  end
126
136
 
137
+ def custom_fields(audit = 'NONE', options = {})
138
+ self.class.get "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/customFields",
139
+ {
140
+ :audit => audit
141
+ },
142
+ options,
143
+ CustomField
144
+ end
145
+
146
+ def add_custom_field(custom_fields, user = nil, reason = nil, comment = nil, options = {})
147
+ body = custom_fields.is_a?(Enumerable) ? custom_fields : [custom_fields]
148
+ custom_field = self.class.post "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/customFields",
149
+ body.to_json,
150
+ {},
151
+ {
152
+ :user => user,
153
+ :reason => reason,
154
+ :comment => comment,
155
+ }.merge(options),
156
+ CustomField
157
+ custom_field.refresh(options)
158
+ end
159
+
160
+ def remove_custom_field(custom_fields, user = nil, reason = nil, comment = nil, options = {})
161
+ custom_fields_param = custom_fields.is_a?(Enumerable) ? custom_fields.join(",") : custom_fields
162
+ self.class.delete "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/customFields",
163
+ {
164
+ :customFieldList => custom_fields_param
165
+ },
166
+ {
167
+ :user => user,
168
+ :reason => reason,
169
+ :comment => comment,
170
+ }.merge(options)
171
+ end
127
172
 
128
173
  def auto_pay_off?(options = {})
129
174
  control_tag_off?(AUTO_PAY_OFF_ID, options)
@@ -4,21 +4,21 @@ module KillBillClient
4
4
  has_many :audit_logs, KillBillClient::Model::AuditLog
5
5
 
6
6
  KILLBILL_API_CHARGEBACKS_PREFIX = "#{KILLBILL_API_PREFIX}/chargebacks"
7
- =begin
8
-
9
- Missing id in the Kill Bill server Refund resource
10
7
 
11
8
  class << self
12
- def find_by_id(account_id, with_balance = false, with_balance_and_cba = false, options = {})
13
- get "#{KILLBILL_API_CHARGEBACKS_PREFIX}/#{account_id}",
14
- {
15
- :accountWithBalance => with_balance,
16
- :accountWithBalanceAndCBA => with_balance_and_cba
17
- },
9
+ def find_by_id(chargeback_id, options = {})
10
+ get "#{KILLBILL_API_CHARGEBACKS_PREFIX}/#{chargeback_id}",
11
+ {},
12
+ options
13
+ end
14
+
15
+ def find_all_by_payment_id(payment_id, options = {})
16
+ get "#{Payment::KILLBILL_API_PAYMENTS_PREFIX}/#{payment_id}/chargebacks",
17
+ {},
18
18
  options
19
19
  end
20
20
  end
21
- =end
21
+
22
22
  def create(user = nil, reason = nil, comment = nil, options = {})
23
23
  created_chargeback = self.class.post KILLBILL_API_CHARGEBACKS_PREFIX,
24
24
  to_json,
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -26,6 +27,9 @@
26
27
  module KillBillClient
27
28
  module Model
28
29
  class CustomFieldAttributes < Resource
30
+ attribute :custom_field_id
31
+ attribute :object_id
32
+ attribute :object_type
29
33
  attribute :name
30
34
  attribute :value
31
35
  attribute :audit_logs
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -34,6 +35,7 @@ module KillBillClient
34
35
  attribute :subscription_id
35
36
  attribute :plan_name
36
37
  attribute :phase_name
38
+ attribute :usage_name
37
39
  attribute :item_type
38
40
  attribute :description
39
41
  attribute :start_date
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -60,3 +61,4 @@ require 'killbill_client/models/gen/tag_definition_attributes'
60
61
  require 'killbill_client/models/gen/tag_attributes'
61
62
  require 'killbill_client/models/gen/tenant_attributes'
62
63
  require 'killbill_client/models/gen/tenant_key_attributes'
64
+ require 'killbill_client/models/gen/usage_attributes'
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -31,6 +32,7 @@ module KillBillClient
31
32
  attribute :name
32
33
  attribute :description
33
34
  attribute :applicable_object_types
35
+ attribute :audit_logs
34
36
  end
35
37
  end
36
38
  end
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -1,6 +1,7 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
5
6
  # Ning licenses this file to you under the Apache License, version 2.0 #
6
7
  # (the "License"); you may not use this file except in compliance with the #
@@ -0,0 +1,37 @@
1
+ ###################################################################################
2
+ # #
3
+ # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
5
+ # #
6
+ # Ning licenses this file to you under the Apache License, version 2.0 #
7
+ # (the "License"); you may not use this file except in compliance with the #
8
+ # License. You may obtain a copy of the License at: #
9
+ # #
10
+ # http://www.apache.org/licenses/LICENSE-2.0 #
11
+ # #
12
+ # Unless required by applicable law or agreed to in writing, software #
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
15
+ # License for the specific language governing permissions and limitations #
16
+ # under the License. #
17
+ # #
18
+ ###################################################################################
19
+
20
+
21
+ #
22
+ # DO NOT EDIT!!!
23
+ # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
24
+ #
25
+
26
+
27
+ module KillBillClient
28
+ module Model
29
+ class UsageAttributes < Resource
30
+ attribute :subscription_id
31
+ attribute :unit_type
32
+ attribute :start_time
33
+ attribute :end_time
34
+ attribute :amount
35
+ end
36
+ end
37
+ end
@@ -18,6 +18,14 @@ module KillBillClient
18
18
  options
19
19
  end
20
20
 
21
+ def find_all_by_invoice_id(invoice_id, with_refunds_and_chargebacks = false, options = {})
22
+ get "#{Invoice::KILLBILL_API_INVOICES_PREFIX}/#{invoice_id}/payments",
23
+ {
24
+ :withRefundsAndChargebacks => with_refunds_and_chargebacks
25
+ },
26
+ options
27
+ end
28
+
21
29
  def find_in_batches(offset = 0, limit = 100, options = {})
22
30
  get "#{KILLBILL_API_PAYMENTS_PREFIX}/#{Resource::KILLBILL_API_PAGINATION_PREFIX}",
23
31
  {
@@ -210,8 +210,8 @@ module KillBillClient
210
210
  end
211
211
  end
212
212
 
213
- def to_json
214
- to_hash.to_json
213
+ def to_json(*args)
214
+ to_hash.to_json(*args)
215
215
  end
216
216
 
217
217
  def refresh(options = {}, clazz=self.class)
@@ -223,7 +223,7 @@ module KillBillClient
223
223
  end
224
224
 
225
225
  def ==(o)
226
- o.class == self.class && o.to_hash == to_hash
226
+ o.class == self.class && o.hash == hash
227
227
  end
228
228
  alias_method :eql?, :==
229
229
 
@@ -1,7 +1,7 @@
1
1
  module KillBillClient
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 6
4
+ MINOR = 7
5
5
  PATCH = 1
6
6
  PRE = nil
7
7
 
@@ -34,6 +34,11 @@ describe KillBillClient::Model do
34
34
  account.external_key.should == external_key
35
35
  account.payment_method_id.should be_nil
36
36
 
37
+ # Try to retrieve it
38
+ account = KillBillClient::Model::Account.find_by_external_key external_key
39
+ account.account_id.should == account_id
40
+ account.payment_method_id.should be_nil
41
+
37
42
  # Try to retrieve it (bis repetita placent)
38
43
  accounts = KillBillClient::Model::Account.find_in_batches(0, search_limit)
39
44
  # Can't test equality if the remote server has extra data
@@ -71,6 +76,19 @@ describe KillBillClient::Model do
71
76
  account.remove_tag('TEST', 'KillBill Spec test')
72
77
  account.tags.size.should == 0
73
78
 
79
+ # Add/Remove a custom field
80
+ account.custom_fields.size.should == 0
81
+ custom_field = KillBillClient::Model::CustomField.new
82
+ custom_field.name = Time.now.to_i.to_s
83
+ custom_field.value = Time.now.to_i.to_s
84
+ account.add_custom_field(custom_field, 'KillBill Spec test')
85
+ custom_fields = account.custom_fields
86
+ custom_fields.size.should == 1
87
+ custom_fields.first.name.should == custom_field.name
88
+ custom_fields.first.value.should == custom_field.value
89
+ account.remove_custom_field(custom_fields.first.custom_field_id, 'KillBill Spec test')
90
+ account.custom_fields.size.should == 0
91
+
74
92
  # Add a payment method
75
93
  pm = KillBillClient::Model::PaymentMethod.new
76
94
  pm.account_id = account.account_id
@@ -173,6 +191,11 @@ describe KillBillClient::Model do
173
191
  payment = KillBillClient::Model::Payment.find_by_id found.payment_id
174
192
  payment.account_id.should == account.account_id
175
193
 
194
+ # Try to retrieve it
195
+ payments = KillBillClient::Model::Payment.find_all_by_invoice_id found.invoice_id
196
+ payments.size.should == 1
197
+ payments.first.account_id.should == account.account_id
198
+
176
199
  # Check the account balance
177
200
  account = KillBillClient::Model::Account.find_by_id account.account_id, true
178
201
  account.account_balance.should == 0
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.1
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: 2014-02-03 00:00:00.000000000 Z
11
+ date: 2014-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.8.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.8.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: 10.0.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 10.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.12.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.12.0
55
55
  description: An API client library for Kill Bill.
@@ -58,8 +58,8 @@ executables: []
58
58
  extensions: []
59
59
  extra_rdoc_files: []
60
60
  files:
61
- - ".gitignore"
62
- - ".travis.yml"
61
+ - .gitignore
62
+ - .travis.yml
63
63
  - Gemfile
64
64
  - README.md
65
65
  - Rakefile
@@ -115,6 +115,7 @@ files:
115
115
  - lib/killbill_client/models/gen/tag_definition_attributes.rb
116
116
  - lib/killbill_client/models/gen/tenant_attributes.rb
117
117
  - lib/killbill_client/models/gen/tenant_key_attributes.rb
118
+ - lib/killbill_client/models/gen/usage_attributes.rb
118
119
  - lib/killbill_client/models/invoice.rb
119
120
  - lib/killbill_client/models/invoice_item.rb
120
121
  - lib/killbill_client/models/models.rb
@@ -143,23 +144,23 @@ licenses:
143
144
  metadata: {}
144
145
  post_install_message:
145
146
  rdoc_options:
146
- - "--exclude"
147
- - "."
147
+ - --exclude
148
+ - .
148
149
  require_paths:
149
150
  - lib
150
151
  required_ruby_version: !ruby/object:Gem::Requirement
151
152
  requirements:
152
- - - ">="
153
+ - - ! '>='
153
154
  - !ruby/object:Gem::Version
154
155
  version: 1.8.6
155
156
  required_rubygems_version: !ruby/object:Gem::Requirement
156
157
  requirements:
157
- - - ">="
158
+ - - ! '>='
158
159
  - !ruby/object:Gem::Version
159
160
  version: '0'
160
161
  requirements: []
161
162
  rubyforge_project:
162
- rubygems_version: 2.2.0
163
+ rubygems_version: 2.2.2
163
164
  signing_key:
164
165
  specification_version: 4
165
166
  summary: Kill Bill client library.