chargebee 2.6.4 → 2.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1501 -1488
  3. data/LICENSE +24 -24
  4. data/README.rdoc +41 -41
  5. data/chargebee.gemspec +2 -3
  6. data/lib/chargebee/environment.rb +28 -28
  7. data/lib/chargebee/errors.rb +43 -43
  8. data/lib/chargebee/models/addon.rb +45 -45
  9. data/lib/chargebee/models/address.rb +18 -18
  10. data/lib/chargebee/models/card.rb +32 -32
  11. data/lib/chargebee/models/comment.rb +25 -25
  12. data/lib/chargebee/models/contact.rb +10 -10
  13. data/lib/chargebee/models/coupon.rb +40 -40
  14. data/lib/chargebee/models/coupon_code.rb +25 -25
  15. data/lib/chargebee/models/coupon_set.rb +37 -37
  16. data/lib/chargebee/models/credit_note.rb +77 -77
  17. data/lib/chargebee/models/credit_note_estimate.rb +35 -35
  18. data/lib/chargebee/models/customer.rb +120 -120
  19. data/lib/chargebee/models/download.rb +9 -9
  20. data/lib/chargebee/models/estimate.rb +46 -46
  21. data/lib/chargebee/models/event.rb +45 -45
  22. data/lib/chargebee/models/export.rb +86 -86
  23. data/lib/chargebee/models/gift.rb +42 -42
  24. data/lib/chargebee/models/hosted_page.rb +77 -77
  25. data/lib/chargebee/models/invoice.rb +172 -172
  26. data/lib/chargebee/models/invoice_estimate.rb +35 -35
  27. data/lib/chargebee/models/model.rb +101 -101
  28. data/lib/chargebee/models/order.rb +76 -76
  29. data/lib/chargebee/models/payment_source.rb +75 -71
  30. data/lib/chargebee/models/plan.rb +60 -59
  31. data/lib/chargebee/models/portal_session.rb +30 -30
  32. data/lib/chargebee/models/promotional_credit.rb +30 -30
  33. data/lib/chargebee/models/quote.rb +72 -72
  34. data/lib/chargebee/models/resource_migration.rb +13 -13
  35. data/lib/chargebee/models/site_migration_detail.rb +14 -14
  36. data/lib/chargebee/models/subscription.rb +137 -137
  37. data/lib/chargebee/models/subscription_estimate.rb +13 -13
  38. data/lib/chargebee/models/third_party_payment_method.rb +9 -9
  39. data/lib/chargebee/models/time_machine.rb +46 -46
  40. data/lib/chargebee/models/transaction.rb +62 -62
  41. data/lib/chargebee/models/unbilled_charge.rb +31 -31
  42. data/lib/chargebee/models/virtual_bank_account.rb +30 -26
  43. data/lib/chargebee/request.rb +27 -27
  44. data/lib/chargebee/rest.rb +92 -92
  45. data/lib/chargebee/result.rb +240 -240
  46. data/lib/chargebee.rb +85 -85
  47. data/spec/errors_spec.rb +23 -23
  48. data/spec/sample_response.rb +73 -73
  49. metadata +3 -4
  50. data/lib/chargebee/.DS_Store +0 -0
data/LICENSE CHANGED
@@ -1,24 +1,24 @@
1
- The MIT License
2
-
3
- Copyright (c) 2011-2019 ChargeBee, Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person
6
- obtaining a copy of this software and associated documentation
7
- files (the "Software"), to deal in the Software without
8
- restriction, including without limitation the rights to use,
9
- copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the
11
- Software is furnished to do so, subject to the following
12
- conditions:
13
-
14
- The above copyright notice and this permission notice shall be
15
- included in all copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
- OTHER DEALINGS IN THE SOFTWARE.
1
+ The MIT License
2
+
3
+ Copyright (c) 2011-2019 ChargeBee, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person
6
+ obtaining a copy of this software and associated documentation
7
+ files (the "Software"), to deal in the Software without
8
+ restriction, including without limitation the rights to use,
9
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the
11
+ Software is furnished to do so, subject to the following
12
+ conditions:
13
+
14
+ The above copyright notice and this permission notice shall be
15
+ included in all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
+ OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc CHANGED
@@ -1,41 +1,41 @@
1
- = Chargebee Ruby Client Library - API V2
2
-
3
- {<img src="https://img.shields.io/gem/v/chargebee.svg?maxAge=2592000"/>}[https://rubygems.org/gems/chargebee]
4
- {<img src="https://img.shields.io/gem/dtv/chargebee.svg?maxAge=2592000"/>}[https://rubygems.org/gems/chargebee]
5
-
6
- This is the Ruby Library for integrating with Chargebee. Sign up for a Chargebee account {here}[https://www.chargebee.com].
7
-
8
- Chargebee now supports two API versions - {V1}[https://apidocs.chargebee.com/docs/api/v1] and {V2}[https://apidocs.chargebee.com/docs/api], of which V2 is the latest release and all future developments will happen in V2. This library is for <b>API version V2</b>. If you’re looking for V1, head to {chargebee-v1 branch}[https://github.com/chargebee/chargebee-ruby/tree/chargebee-v1].
9
-
10
- == Installation
11
-
12
- Install the latest version of the gem with the following command...
13
-
14
- $ sudo gem install chargebee -v '~>2'
15
-
16
-
17
- == Requirements
18
-
19
- * Ruby 1.9.3 or above.
20
- * rest-client
21
-
22
- == Documentation
23
-
24
- For API reference see {here}[https://apidocs.chargebee.com/docs/api?lang=ruby]
25
-
26
- == Usage
27
-
28
- To create a new subscription:
29
-
30
- ChargeBee.configure({:api_key => "your_api_key" , :site => "your_site"})
31
- result = ChargeBee::Subscription.create({
32
- :id => "sub_KyVqDh__dev__NTn4VZZ1",
33
- :plan_id => "basic",
34
- })
35
- subscription = result.subscription
36
- puts "created subscription is #{subscription}"
37
-
38
- == License
39
-
40
- See the LICENSE file.
41
-
1
+ = Chargebee Ruby Client Library - API V2
2
+
3
+ {<img src="https://img.shields.io/gem/v/chargebee.svg?maxAge=2592000"/>}[https://rubygems.org/gems/chargebee]
4
+ {<img src="https://img.shields.io/gem/dtv/chargebee.svg?maxAge=2592000"/>}[https://rubygems.org/gems/chargebee]
5
+
6
+ This is the Ruby Library for integrating with Chargebee. Sign up for a Chargebee account {here}[https://www.chargebee.com].
7
+
8
+ Chargebee now supports two API versions - {V1}[https://apidocs.chargebee.com/docs/api/v1] and {V2}[https://apidocs.chargebee.com/docs/api], of which V2 is the latest release and all future developments will happen in V2. This library is for <b>API version V2</b>. If you’re looking for V1, head to {chargebee-v1 branch}[https://github.com/chargebee/chargebee-ruby/tree/chargebee-v1].
9
+
10
+ == Installation
11
+
12
+ Install the latest version of the gem with the following command...
13
+
14
+ $ sudo gem install chargebee -v '~>2'
15
+
16
+
17
+ == Requirements
18
+
19
+ * Ruby 1.9.3 or above.
20
+ * rest-client
21
+
22
+ == Documentation
23
+
24
+ For API reference see {here}[https://apidocs.chargebee.com/docs/api?lang=ruby]
25
+
26
+ == Usage
27
+
28
+ To create a new subscription:
29
+
30
+ ChargeBee.configure({:api_key => "your_api_key" , :site => "your_site"})
31
+ result = ChargeBee::Subscription.create({
32
+ :id => "sub_KyVqDh__dev__NTn4VZZ1",
33
+ :plan_id => "basic",
34
+ })
35
+ subscription = result.subscription
36
+ puts "created subscription is #{subscription}"
37
+
38
+ == License
39
+
40
+ See the LICENSE file.
41
+
data/chargebee.gemspec CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.5'
5
5
  s.required_ruby_version = '>= 1.9.3'
6
6
  s.name = 'chargebee'
7
- s.version = '2.6.4'
8
- s.date = '2019-03-22'
7
+ s.version = '2.6.5'
8
+ s.date = '2019-04-11'
9
9
 
10
10
  s.summary = "Ruby client for Chargebee API."
11
11
  s.description = "Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com."
@@ -35,7 +35,6 @@ Gem::Specification.new do |s|
35
35
  chargebee.gemspec
36
36
  lib/.DS_Store
37
37
  lib/chargebee.rb
38
- lib/chargebee/.DS_Store
39
38
  lib/chargebee/environment.rb
40
39
  lib/chargebee/errors.rb
41
40
  lib/chargebee/list_result.rb
@@ -1,28 +1,28 @@
1
- module ChargeBee
2
- class Environment
3
- API_VERSION = "v2"
4
- # in seconds
5
- TIME_MACHINE_TIMEOUT = 3
6
- EXPORT_TIMEOUT = 10
7
-
8
- attr_accessor :api_key, :site, :time_machine_sleeptime, :export_sleeptime
9
- attr_reader :api_endpoint
10
-
11
- def initialize(options)
12
- options[:time_machine_sleeptime] ||= TIME_MACHINE_TIMEOUT
13
- options[:export_sleeptime] ||= EXPORT_TIMEOUT
14
- [:api_key, :site, :time_machine_sleeptime, :export_sleeptime].each do |attr|
15
- instance_variable_set "@#{attr}", options[attr]
16
- end
17
- if($CHARGEBEE_DOMAIN == nil)
18
- @api_endpoint = "https://#{@site}.chargebee.com/api/#{API_VERSION}"
19
- else
20
- @api_endpoint = "#{$ENV_PROTOCOL == nil ? "http": "https"}://#{@site}.#{$CHARGEBEE_DOMAIN}/api/#{API_VERSION}"
21
- end
22
- end
23
-
24
- def api_url(url)
25
- url = @api_endpoint + url
26
- end
27
- end
28
- end
1
+ module ChargeBee
2
+ class Environment
3
+ API_VERSION = "v2"
4
+ # in seconds
5
+ TIME_MACHINE_TIMEOUT = 3
6
+ EXPORT_TIMEOUT = 10
7
+
8
+ attr_accessor :api_key, :site, :time_machine_sleeptime, :export_sleeptime
9
+ attr_reader :api_endpoint
10
+
11
+ def initialize(options)
12
+ options[:time_machine_sleeptime] ||= TIME_MACHINE_TIMEOUT
13
+ options[:export_sleeptime] ||= EXPORT_TIMEOUT
14
+ [:api_key, :site, :time_machine_sleeptime, :export_sleeptime].each do |attr|
15
+ instance_variable_set "@#{attr}", options[attr]
16
+ end
17
+ if($CHARGEBEE_DOMAIN == nil)
18
+ @api_endpoint = "https://#{@site}.chargebee.com/api/#{API_VERSION}"
19
+ else
20
+ @api_endpoint = "#{$ENV_PROTOCOL == nil ? "http": "https"}://#{@site}.#{$CHARGEBEE_DOMAIN}/api/#{API_VERSION}"
21
+ end
22
+ end
23
+
24
+ def api_url(url)
25
+ url = @api_endpoint + url
26
+ end
27
+ end
28
+ end
@@ -1,43 +1,43 @@
1
- module ChargeBee
2
-
3
- class Error < StandardError
4
- attr_reader :original_error
5
-
6
- def initialize(message=nil,original_error = nil)
7
- super message
8
- @original_error = original_error
9
- end
10
- end
11
-
12
- class IOError < Error; end
13
-
14
- class APIError < Error
15
-
16
- attr_reader :http_status_code, :type, :api_error_code, :param, :json_obj,
17
- #Deprecated attributes
18
- :http_code, :http_body, :error_code
19
-
20
- def initialize(http_code=nil, json_obj = nil)
21
- super json_obj[:message]
22
- @json_obj = json_obj
23
- @http_status_code = http_code
24
- @type = json_obj[:type]
25
- @api_error_code = json_obj[:api_error_code]
26
- @param = json_obj[:param]
27
-
28
- #Deprecated attributes
29
- @error_code = json_obj[:error_code]
30
- @http_code = http_code
31
- @http_body = json_obj.to_s
32
- end
33
-
34
- end
35
-
36
-
37
- class OperationFailedError < APIError; end
38
-
39
- class InvalidRequestError < APIError; end
40
-
41
- class PaymentError < APIError; end
42
-
43
- end
1
+ module ChargeBee
2
+
3
+ class Error < StandardError
4
+ attr_reader :original_error
5
+
6
+ def initialize(message=nil,original_error = nil)
7
+ super message
8
+ @original_error = original_error
9
+ end
10
+ end
11
+
12
+ class IOError < Error; end
13
+
14
+ class APIError < Error
15
+
16
+ attr_reader :http_status_code, :type, :api_error_code, :param, :json_obj,
17
+ #Deprecated attributes
18
+ :http_code, :http_body, :error_code
19
+
20
+ def initialize(http_code=nil, json_obj = nil)
21
+ super json_obj[:message]
22
+ @json_obj = json_obj
23
+ @http_status_code = http_code
24
+ @type = json_obj[:type]
25
+ @api_error_code = json_obj[:api_error_code]
26
+ @param = json_obj[:param]
27
+
28
+ #Deprecated attributes
29
+ @error_code = json_obj[:error_code]
30
+ @http_code = http_code
31
+ @http_body = json_obj.to_s
32
+ end
33
+
34
+ end
35
+
36
+
37
+ class OperationFailedError < APIError; end
38
+
39
+ class InvalidRequestError < APIError; end
40
+
41
+ class PaymentError < APIError; end
42
+
43
+ end
@@ -1,46 +1,46 @@
1
- module ChargeBee
2
- class Addon < Model
3
-
4
- class Tier < Model
5
- attr_accessor :starting_unit, :ending_unit, :price
6
- end
7
-
8
- attr_accessor :id, :name, :invoice_name, :description, :pricing_model, :type, :charge_type,
9
- :price, :currency_code, :period, :period_unit, :unit, :status, :archived_at, :enabled_in_portal,
10
- :tax_code, :sku, :accounting_code, :accounting_category1, :accounting_category2, :is_shippable,
11
- :shipping_frequency_period, :shipping_frequency_period_unit, :resource_version, :updated_at,
12
- :invoice_notes, :taxable, :tax_profile_id, :meta_data, :tiers
13
-
14
- # OPERATIONS
15
- #-----------
16
-
17
- def self.create(params, env=nil, headers={})
18
- Request.send('post', uri_path("addons"), params, env, headers)
19
- end
20
-
21
- def self.update(id, params={}, env=nil, headers={})
22
- Request.send('post', uri_path("addons",id.to_s), params, env, headers)
23
- end
24
-
25
- def self.list(params={}, env=nil, headers={})
26
- Request.send_list_request('get', uri_path("addons"), params, env, headers)
27
- end
28
-
29
- def self.retrieve(id, env=nil, headers={})
30
- Request.send('get', uri_path("addons",id.to_s), {}, env, headers)
31
- end
32
-
33
- def self.delete(id, env=nil, headers={})
34
- Request.send('post', uri_path("addons",id.to_s,"delete"), {}, env, headers)
35
- end
36
-
37
- def self.copy(params, env=nil, headers={})
38
- Request.send('post', uri_path("addons","copy"), params, env, headers)
39
- end
40
-
41
- def self.unarchive(id, env=nil, headers={})
42
- Request.send('post', uri_path("addons",id.to_s,"unarchive"), {}, env, headers)
43
- end
44
-
45
- end # ~Addon
1
+ module ChargeBee
2
+ class Addon < Model
3
+
4
+ class Tier < Model
5
+ attr_accessor :starting_unit, :ending_unit, :price
6
+ end
7
+
8
+ attr_accessor :id, :name, :invoice_name, :description, :pricing_model, :type, :charge_type,
9
+ :price, :currency_code, :period, :period_unit, :unit, :status, :archived_at, :enabled_in_portal,
10
+ :tax_code, :avalara_sale_type, :avalara_transaction_type, :avalara_service_type, :sku, :accounting_code,
11
+ :accounting_category1, :accounting_category2, :is_shippable, :shipping_frequency_period, :shipping_frequency_period_unit,
12
+ :resource_version, :updated_at, :invoice_notes, :taxable, :tax_profile_id, :meta_data, :tiers
13
+
14
+ # OPERATIONS
15
+ #-----------
16
+
17
+ def self.create(params, env=nil, headers={})
18
+ Request.send('post', uri_path("addons"), params, env, headers)
19
+ end
20
+
21
+ def self.update(id, params={}, env=nil, headers={})
22
+ Request.send('post', uri_path("addons",id.to_s), params, env, headers)
23
+ end
24
+
25
+ def self.list(params={}, env=nil, headers={})
26
+ Request.send_list_request('get', uri_path("addons"), params, env, headers)
27
+ end
28
+
29
+ def self.retrieve(id, env=nil, headers={})
30
+ Request.send('get', uri_path("addons",id.to_s), {}, env, headers)
31
+ end
32
+
33
+ def self.delete(id, env=nil, headers={})
34
+ Request.send('post', uri_path("addons",id.to_s,"delete"), {}, env, headers)
35
+ end
36
+
37
+ def self.copy(params, env=nil, headers={})
38
+ Request.send('post', uri_path("addons","copy"), params, env, headers)
39
+ end
40
+
41
+ def self.unarchive(id, env=nil, headers={})
42
+ Request.send('post', uri_path("addons",id.to_s,"unarchive"), {}, env, headers)
43
+ end
44
+
45
+ end # ~Addon
46
46
  end # ~ChargeBee
@@ -1,19 +1,19 @@
1
- module ChargeBee
2
- class Address < Model
3
-
4
- attr_accessor :label, :first_name, :last_name, :email, :company, :phone, :addr, :extended_addr,
5
- :extended_addr2, :city, :state_code, :state, :country, :zip, :validation_status, :subscription_id
6
-
7
- # OPERATIONS
8
- #-----------
9
-
10
- def self.retrieve(params, env=nil, headers={})
11
- Request.send('get', uri_path("addresses"), params, env, headers)
12
- end
13
-
14
- def self.update(params, env=nil, headers={})
15
- Request.send('post', uri_path("addresses"), params, env, headers)
16
- end
17
-
18
- end # ~Address
1
+ module ChargeBee
2
+ class Address < Model
3
+
4
+ attr_accessor :label, :first_name, :last_name, :email, :company, :phone, :addr, :extended_addr,
5
+ :extended_addr2, :city, :state_code, :state, :country, :zip, :validation_status, :subscription_id
6
+
7
+ # OPERATIONS
8
+ #-----------
9
+
10
+ def self.retrieve(params, env=nil, headers={})
11
+ Request.send('get', uri_path("addresses"), params, env, headers)
12
+ end
13
+
14
+ def self.update(params, env=nil, headers={})
15
+ Request.send('post', uri_path("addresses"), params, env, headers)
16
+ end
17
+
18
+ end # ~Address
19
19
  end # ~ChargeBee
@@ -1,33 +1,33 @@
1
- module ChargeBee
2
- class Card < Model
3
-
4
- attr_accessor :payment_source_id, :status, :gateway, :gateway_account_id, :first_name, :last_name,
5
- :iin, :last4, :card_type, :funding_type, :expiry_month, :expiry_year, :issuing_country, :billing_addr1,
6
- :billing_addr2, :billing_city, :billing_state_code, :billing_state, :billing_country, :billing_zip,
7
- :created_at, :resource_version, :updated_at, :ip_address, :customer_id, :masked_number
8
-
9
- # OPERATIONS
10
- #-----------
11
-
12
- def self.retrieve(id, env=nil, headers={})
13
- Request.send('get', uri_path("cards",id.to_s), {}, env, headers)
14
- end
15
-
16
- def self.update_card_for_customer(id, params, env=nil, headers={})
17
- Request.send('post', uri_path("customers",id.to_s,"credit_card"), params, env, headers)
18
- end
19
-
20
- def self.switch_gateway_for_customer(id, params, env=nil, headers={})
21
- Request.send('post', uri_path("customers",id.to_s,"switch_gateway"), params, env, headers)
22
- end
23
-
24
- def self.copy_card_for_customer(id, params, env=nil, headers={})
25
- Request.send('post', uri_path("customers",id.to_s,"copy_card"), params, env, headers)
26
- end
27
-
28
- def self.delete_card_for_customer(id, env=nil, headers={})
29
- Request.send('post', uri_path("customers",id.to_s,"delete_card"), {}, env, headers)
30
- end
31
-
32
- end # ~Card
1
+ module ChargeBee
2
+ class Card < Model
3
+
4
+ attr_accessor :payment_source_id, :status, :gateway, :gateway_account_id, :first_name, :last_name,
5
+ :iin, :last4, :card_type, :funding_type, :expiry_month, :expiry_year, :issuing_country, :billing_addr1,
6
+ :billing_addr2, :billing_city, :billing_state_code, :billing_state, :billing_country, :billing_zip,
7
+ :created_at, :resource_version, :updated_at, :ip_address, :customer_id, :masked_number
8
+
9
+ # OPERATIONS
10
+ #-----------
11
+
12
+ def self.retrieve(id, env=nil, headers={})
13
+ Request.send('get', uri_path("cards",id.to_s), {}, env, headers)
14
+ end
15
+
16
+ def self.update_card_for_customer(id, params, env=nil, headers={})
17
+ Request.send('post', uri_path("customers",id.to_s,"credit_card"), params, env, headers)
18
+ end
19
+
20
+ def self.switch_gateway_for_customer(id, params, env=nil, headers={})
21
+ Request.send('post', uri_path("customers",id.to_s,"switch_gateway"), params, env, headers)
22
+ end
23
+
24
+ def self.copy_card_for_customer(id, params, env=nil, headers={})
25
+ Request.send('post', uri_path("customers",id.to_s,"copy_card"), params, env, headers)
26
+ end
27
+
28
+ def self.delete_card_for_customer(id, env=nil, headers={})
29
+ Request.send('post', uri_path("customers",id.to_s,"delete_card"), {}, env, headers)
30
+ end
31
+
32
+ end # ~Card
33
33
  end # ~ChargeBee
@@ -1,26 +1,26 @@
1
- module ChargeBee
2
- class Comment < Model
3
-
4
- attr_accessor :id, :entity_type, :added_by, :notes, :created_at, :type, :entity_id
5
-
6
- # OPERATIONS
7
- #-----------
8
-
9
- def self.create(params, env=nil, headers={})
10
- Request.send('post', uri_path("comments"), params, env, headers)
11
- end
12
-
13
- def self.retrieve(id, env=nil, headers={})
14
- Request.send('get', uri_path("comments",id.to_s), {}, env, headers)
15
- end
16
-
17
- def self.list(params={}, env=nil, headers={})
18
- Request.send_list_request('get', uri_path("comments"), params, env, headers)
19
- end
20
-
21
- def self.delete(id, env=nil, headers={})
22
- Request.send('post', uri_path("comments",id.to_s,"delete"), {}, env, headers)
23
- end
24
-
25
- end # ~Comment
1
+ module ChargeBee
2
+ class Comment < Model
3
+
4
+ attr_accessor :id, :entity_type, :added_by, :notes, :created_at, :type, :entity_id
5
+
6
+ # OPERATIONS
7
+ #-----------
8
+
9
+ def self.create(params, env=nil, headers={})
10
+ Request.send('post', uri_path("comments"), params, env, headers)
11
+ end
12
+
13
+ def self.retrieve(id, env=nil, headers={})
14
+ Request.send('get', uri_path("comments",id.to_s), {}, env, headers)
15
+ end
16
+
17
+ def self.list(params={}, env=nil, headers={})
18
+ Request.send_list_request('get', uri_path("comments"), params, env, headers)
19
+ end
20
+
21
+ def self.delete(id, env=nil, headers={})
22
+ Request.send('post', uri_path("comments",id.to_s,"delete"), {}, env, headers)
23
+ end
24
+
25
+ end # ~Comment
26
26
  end # ~ChargeBee
@@ -1,11 +1,11 @@
1
- module ChargeBee
2
- class Contact < Model
3
-
4
- attr_accessor :id, :first_name, :last_name, :email, :phone, :label, :enabled, :send_account_email,
5
- :send_billing_email
6
-
7
- # OPERATIONS
8
- #-----------
9
-
10
- end # ~Contact
1
+ module ChargeBee
2
+ class Contact < Model
3
+
4
+ attr_accessor :id, :first_name, :last_name, :email, :phone, :label, :enabled, :send_account_email,
5
+ :send_billing_email
6
+
7
+ # OPERATIONS
8
+ #-----------
9
+
10
+ end # ~Contact
11
11
  end # ~ChargeBee
@@ -1,41 +1,41 @@
1
- module ChargeBee
2
- class Coupon < Model
3
-
4
- attr_accessor :id, :name, :invoice_name, :discount_type, :discount_percentage, :discount_amount,
5
- :discount_quantity, :currency_code, :duration_type, :duration_month, :valid_till, :max_redemptions,
6
- :status, :apply_discount_on, :apply_on, :plan_constraint, :addon_constraint, :created_at, :archived_at,
7
- :resource_version, :updated_at, :plan_ids, :addon_ids, :redemptions, :invoice_notes, :meta_data
8
-
9
- # OPERATIONS
10
- #-----------
11
-
12
- def self.create(params, env=nil, headers={})
13
- Request.send('post', uri_path("coupons"), params, env, headers)
14
- end
15
-
16
- def self.list(params={}, env=nil, headers={})
17
- Request.send_list_request('get', uri_path("coupons"), params, env, headers)
18
- end
19
-
20
- def self.retrieve(id, env=nil, headers={})
21
- Request.send('get', uri_path("coupons",id.to_s), {}, env, headers)
22
- end
23
-
24
- def self.update(id, params={}, env=nil, headers={})
25
- Request.send('post', uri_path("coupons",id.to_s), params, env, headers)
26
- end
27
-
28
- def self.delete(id, env=nil, headers={})
29
- Request.send('post', uri_path("coupons",id.to_s,"delete"), {}, env, headers)
30
- end
31
-
32
- def self.copy(params, env=nil, headers={})
33
- Request.send('post', uri_path("coupons","copy"), params, env, headers)
34
- end
35
-
36
- def self.unarchive(id, env=nil, headers={})
37
- Request.send('post', uri_path("coupons",id.to_s,"unarchive"), {}, env, headers)
38
- end
39
-
40
- end # ~Coupon
1
+ module ChargeBee
2
+ class Coupon < Model
3
+
4
+ attr_accessor :id, :name, :invoice_name, :discount_type, :discount_percentage, :discount_amount,
5
+ :discount_quantity, :currency_code, :duration_type, :duration_month, :valid_till, :max_redemptions,
6
+ :status, :apply_discount_on, :apply_on, :plan_constraint, :addon_constraint, :created_at, :archived_at,
7
+ :resource_version, :updated_at, :plan_ids, :addon_ids, :redemptions, :invoice_notes, :meta_data
8
+
9
+ # OPERATIONS
10
+ #-----------
11
+
12
+ def self.create(params, env=nil, headers={})
13
+ Request.send('post', uri_path("coupons"), params, env, headers)
14
+ end
15
+
16
+ def self.list(params={}, env=nil, headers={})
17
+ Request.send_list_request('get', uri_path("coupons"), params, env, headers)
18
+ end
19
+
20
+ def self.retrieve(id, env=nil, headers={})
21
+ Request.send('get', uri_path("coupons",id.to_s), {}, env, headers)
22
+ end
23
+
24
+ def self.update(id, params={}, env=nil, headers={})
25
+ Request.send('post', uri_path("coupons",id.to_s), params, env, headers)
26
+ end
27
+
28
+ def self.delete(id, env=nil, headers={})
29
+ Request.send('post', uri_path("coupons",id.to_s,"delete"), {}, env, headers)
30
+ end
31
+
32
+ def self.copy(params, env=nil, headers={})
33
+ Request.send('post', uri_path("coupons","copy"), params, env, headers)
34
+ end
35
+
36
+ def self.unarchive(id, env=nil, headers={})
37
+ Request.send('post', uri_path("coupons",id.to_s,"unarchive"), {}, env, headers)
38
+ end
39
+
40
+ end # ~Coupon
41
41
  end # ~ChargeBee