chargebee 2.6.2 → 2.6.3

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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1483 -1473
  3. data/LICENSE +24 -24
  4. data/README.rdoc +41 -41
  5. data/Rakefile +150 -150
  6. data/chargebee.gemspec +2 -2
  7. data/lib/.DS_Store +0 -0
  8. data/lib/chargebee.rb +85 -85
  9. data/lib/chargebee/environment.rb +28 -28
  10. data/lib/chargebee/errors.rb +43 -43
  11. data/lib/chargebee/list_result.rb +28 -28
  12. data/lib/chargebee/models/addon.rb +45 -45
  13. data/lib/chargebee/models/address.rb +18 -18
  14. data/lib/chargebee/models/card.rb +32 -32
  15. data/lib/chargebee/models/comment.rb +25 -25
  16. data/lib/chargebee/models/contact.rb +10 -10
  17. data/lib/chargebee/models/coupon.rb +40 -40
  18. data/lib/chargebee/models/coupon_code.rb +25 -25
  19. data/lib/chargebee/models/coupon_set.rb +37 -37
  20. data/lib/chargebee/models/credit_note.rb +77 -77
  21. data/lib/chargebee/models/credit_note_estimate.rb +35 -35
  22. data/lib/chargebee/models/customer.rb +120 -120
  23. data/lib/chargebee/models/download.rb +9 -9
  24. data/lib/chargebee/models/estimate.rb +46 -46
  25. data/lib/chargebee/models/event.rb +45 -45
  26. data/lib/chargebee/models/export.rb +86 -82
  27. data/lib/chargebee/models/gift.rb +42 -42
  28. data/lib/chargebee/models/hosted_page.rb +77 -73
  29. data/lib/chargebee/models/invoice.rb +172 -172
  30. data/lib/chargebee/models/invoice_estimate.rb +35 -35
  31. data/lib/chargebee/models/model.rb +101 -101
  32. data/lib/chargebee/models/order.rb +76 -76
  33. data/lib/chargebee/models/payment_source.rb +71 -70
  34. data/lib/chargebee/models/plan.rb +59 -59
  35. data/lib/chargebee/models/portal_session.rb +30 -30
  36. data/lib/chargebee/models/promotional_credit.rb +30 -30
  37. data/lib/chargebee/models/quote.rb +72 -72
  38. data/lib/chargebee/models/resource_migration.rb +13 -13
  39. data/lib/chargebee/models/site_migration_detail.rb +14 -14
  40. data/lib/chargebee/models/subscription.rb +137 -137
  41. data/lib/chargebee/models/subscription_estimate.rb +13 -13
  42. data/lib/chargebee/models/third_party_payment_method.rb +9 -9
  43. data/lib/chargebee/models/time_machine.rb +46 -46
  44. data/lib/chargebee/models/transaction.rb +62 -58
  45. data/lib/chargebee/models/unbilled_charge.rb +31 -31
  46. data/lib/chargebee/models/virtual_bank_account.rb +26 -26
  47. data/lib/chargebee/request.rb +27 -27
  48. data/lib/chargebee/rest.rb +92 -90
  49. data/lib/chargebee/result.rb +240 -240
  50. data/lib/chargebee/util.rb +56 -56
  51. data/lib/ssl/ca-certs.crt +3385 -3385
  52. data/spec/chargebee/list_result_spec.rb +53 -53
  53. data/spec/chargebee_spec.rb +99 -99
  54. data/spec/errors_spec.rb +23 -23
  55. data/spec/sample_response.rb +73 -73
  56. data/spec/spec_helper.rb +24 -24
  57. metadata +2 -2
@@ -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
@@ -1,26 +1,26 @@
1
- module ChargeBee
2
- class CouponCode < Model
3
-
4
- attr_accessor :code, :status, :coupon_id, :coupon_set_id, :coupon_set_name
5
-
6
- # OPERATIONS
7
- #-----------
8
-
9
- def self.create(params, env=nil, headers={})
10
- Request.send('post', uri_path("coupon_codes"), params, env, headers)
11
- end
12
-
13
- def self.retrieve(id, env=nil, headers={})
14
- Request.send('get', uri_path("coupon_codes",id.to_s), {}, env, headers)
15
- end
16
-
17
- def self.list(params={}, env=nil, headers={})
18
- Request.send_list_request('get', uri_path("coupon_codes"), params, env, headers)
19
- end
20
-
21
- def self.archive(id, env=nil, headers={})
22
- Request.send('post', uri_path("coupon_codes",id.to_s,"archive"), {}, env, headers)
23
- end
24
-
25
- end # ~CouponCode
1
+ module ChargeBee
2
+ class CouponCode < Model
3
+
4
+ attr_accessor :code, :status, :coupon_id, :coupon_set_id, :coupon_set_name
5
+
6
+ # OPERATIONS
7
+ #-----------
8
+
9
+ def self.create(params, env=nil, headers={})
10
+ Request.send('post', uri_path("coupon_codes"), params, env, headers)
11
+ end
12
+
13
+ def self.retrieve(id, env=nil, headers={})
14
+ Request.send('get', uri_path("coupon_codes",id.to_s), {}, env, headers)
15
+ end
16
+
17
+ def self.list(params={}, env=nil, headers={})
18
+ Request.send_list_request('get', uri_path("coupon_codes"), params, env, headers)
19
+ end
20
+
21
+ def self.archive(id, env=nil, headers={})
22
+ Request.send('post', uri_path("coupon_codes",id.to_s,"archive"), {}, env, headers)
23
+ end
24
+
25
+ end # ~CouponCode
26
26
  end # ~ChargeBee
@@ -1,38 +1,38 @@
1
- module ChargeBee
2
- class CouponSet < Model
3
-
4
- attr_accessor :id, :coupon_id, :name, :total_count, :redeemed_count, :archived_count, :meta_data
5
-
6
- # OPERATIONS
7
- #-----------
8
-
9
- def self.create(params, env=nil, headers={})
10
- Request.send('post', uri_path("coupon_sets"), params, env, headers)
11
- end
12
-
13
- def self.add_coupon_codes(id, params={}, env=nil, headers={})
14
- Request.send('post', uri_path("coupon_sets",id.to_s,"add_coupon_codes"), params, env, headers)
15
- end
16
-
17
- def self.list(params={}, env=nil, headers={})
18
- Request.send_list_request('get', uri_path("coupon_sets"), params, env, headers)
19
- end
20
-
21
- def self.retrieve(id, env=nil, headers={})
22
- Request.send('get', uri_path("coupon_sets",id.to_s), {}, env, headers)
23
- end
24
-
25
- def self.update(id, params={}, env=nil, headers={})
26
- Request.send('post', uri_path("coupon_sets",id.to_s,"update"), params, env, headers)
27
- end
28
-
29
- def self.delete(id, env=nil, headers={})
30
- Request.send('post', uri_path("coupon_sets",id.to_s,"delete"), {}, env, headers)
31
- end
32
-
33
- def self.delete_unused_coupon_codes(id, env=nil, headers={})
34
- Request.send('post', uri_path("coupon_sets",id.to_s,"delete_unused_coupon_codes"), {}, env, headers)
35
- end
36
-
37
- end # ~CouponSet
1
+ module ChargeBee
2
+ class CouponSet < Model
3
+
4
+ attr_accessor :id, :coupon_id, :name, :total_count, :redeemed_count, :archived_count, :meta_data
5
+
6
+ # OPERATIONS
7
+ #-----------
8
+
9
+ def self.create(params, env=nil, headers={})
10
+ Request.send('post', uri_path("coupon_sets"), params, env, headers)
11
+ end
12
+
13
+ def self.add_coupon_codes(id, params={}, env=nil, headers={})
14
+ Request.send('post', uri_path("coupon_sets",id.to_s,"add_coupon_codes"), params, env, headers)
15
+ end
16
+
17
+ def self.list(params={}, env=nil, headers={})
18
+ Request.send_list_request('get', uri_path("coupon_sets"), params, env, headers)
19
+ end
20
+
21
+ def self.retrieve(id, env=nil, headers={})
22
+ Request.send('get', uri_path("coupon_sets",id.to_s), {}, env, headers)
23
+ end
24
+
25
+ def self.update(id, params={}, env=nil, headers={})
26
+ Request.send('post', uri_path("coupon_sets",id.to_s,"update"), params, env, headers)
27
+ end
28
+
29
+ def self.delete(id, env=nil, headers={})
30
+ Request.send('post', uri_path("coupon_sets",id.to_s,"delete"), {}, env, headers)
31
+ end
32
+
33
+ def self.delete_unused_coupon_codes(id, env=nil, headers={})
34
+ Request.send('post', uri_path("coupon_sets",id.to_s,"delete_unused_coupon_codes"), {}, env, headers)
35
+ end
36
+
37
+ end # ~CouponSet
38
38
  end # ~ChargeBee
@@ -1,78 +1,78 @@
1
- module ChargeBee
2
- class CreditNote < Model
3
-
4
- class LineItem < Model
5
- attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :discount_amount, :item_level_discount_amount, :description, :entity_type, :tax_exempt_reason, :entity_id
6
- end
7
-
8
- class Discount < Model
9
- attr_accessor :amount, :description, :entity_type, :entity_id
10
- end
11
-
12
- class LineItemDiscount < Model
13
- attr_accessor :line_item_id, :discount_type, :coupon_id, :discount_amount
14
- end
15
-
16
- class LineItemTier < Model
17
- attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount
18
- end
19
-
20
- class Tax < Model
21
- attr_accessor :name, :amount, :description
22
- end
23
-
24
- class LineItemTax < Model
25
- attr_accessor :line_item_id, :tax_name, :tax_rate, :tax_amount, :tax_juris_type, :tax_juris_name, :tax_juris_code
26
- end
27
-
28
- class LinkedRefund < Model
29
- attr_accessor :txn_id, :applied_amount, :applied_at, :txn_status, :txn_date, :txn_amount
30
- end
31
-
32
- class Allocation < Model
33
- attr_accessor :invoice_id, :allocated_amount, :allocated_at, :invoice_date, :invoice_status
34
- end
35
-
36
- attr_accessor :id, :customer_id, :subscription_id, :reference_invoice_id, :type, :reason_code,
37
- :status, :vat_number, :date, :price_type, :currency_code, :total, :amount_allocated, :amount_refunded,
38
- :amount_available, :refunded_at, :voided_at, :resource_version, :updated_at, :sub_total, :round_off_amount,
39
- :line_items, :discounts, :line_item_discounts, :line_item_tiers, :taxes, :line_item_taxes, :linked_refunds,
40
- :allocations, :deleted
41
-
42
- # OPERATIONS
43
- #-----------
44
-
45
- def self.create(params, env=nil, headers={})
46
- Request.send('post', uri_path("credit_notes"), params, env, headers)
47
- end
48
-
49
- def self.retrieve(id, env=nil, headers={})
50
- Request.send('get', uri_path("credit_notes",id.to_s), {}, env, headers)
51
- end
52
-
53
- def self.pdf(id, params={}, env=nil, headers={})
54
- Request.send('post', uri_path("credit_notes",id.to_s,"pdf"), params, env, headers)
55
- end
56
-
57
- def self.record_refund(id, params, env=nil, headers={})
58
- Request.send('post', uri_path("credit_notes",id.to_s,"record_refund"), params, env, headers)
59
- end
60
-
61
- def self.void_credit_note(id, params={}, env=nil, headers={})
62
- Request.send('post', uri_path("credit_notes",id.to_s,"void"), params, env, headers)
63
- end
64
-
65
- def self.list(params={}, env=nil, headers={})
66
- Request.send_list_request('get', uri_path("credit_notes"), params, env, headers)
67
- end
68
-
69
- def self.credit_notes_for_customer(id, params={}, env=nil, headers={})
70
- Request.send('get', uri_path("customers",id.to_s,"credit_notes"), params, env, headers)
71
- end
72
-
73
- def self.delete(id, params={}, env=nil, headers={})
74
- Request.send('post', uri_path("credit_notes",id.to_s,"delete"), params, env, headers)
75
- end
76
-
77
- end # ~CreditNote
1
+ module ChargeBee
2
+ class CreditNote < Model
3
+
4
+ class LineItem < Model
5
+ attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :discount_amount, :item_level_discount_amount, :description, :entity_type, :tax_exempt_reason, :entity_id
6
+ end
7
+
8
+ class Discount < Model
9
+ attr_accessor :amount, :description, :entity_type, :entity_id
10
+ end
11
+
12
+ class LineItemDiscount < Model
13
+ attr_accessor :line_item_id, :discount_type, :coupon_id, :discount_amount
14
+ end
15
+
16
+ class LineItemTier < Model
17
+ attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount
18
+ end
19
+
20
+ class Tax < Model
21
+ attr_accessor :name, :amount, :description
22
+ end
23
+
24
+ class LineItemTax < Model
25
+ attr_accessor :line_item_id, :tax_name, :tax_rate, :tax_amount, :tax_juris_type, :tax_juris_name, :tax_juris_code
26
+ end
27
+
28
+ class LinkedRefund < Model
29
+ attr_accessor :txn_id, :applied_amount, :applied_at, :txn_status, :txn_date, :txn_amount
30
+ end
31
+
32
+ class Allocation < Model
33
+ attr_accessor :invoice_id, :allocated_amount, :allocated_at, :invoice_date, :invoice_status
34
+ end
35
+
36
+ attr_accessor :id, :customer_id, :subscription_id, :reference_invoice_id, :type, :reason_code,
37
+ :status, :vat_number, :date, :price_type, :currency_code, :total, :amount_allocated, :amount_refunded,
38
+ :amount_available, :refunded_at, :voided_at, :resource_version, :updated_at, :sub_total, :round_off_amount,
39
+ :line_items, :discounts, :line_item_discounts, :line_item_tiers, :taxes, :line_item_taxes, :linked_refunds,
40
+ :allocations, :deleted
41
+
42
+ # OPERATIONS
43
+ #-----------
44
+
45
+ def self.create(params, env=nil, headers={})
46
+ Request.send('post', uri_path("credit_notes"), params, env, headers)
47
+ end
48
+
49
+ def self.retrieve(id, env=nil, headers={})
50
+ Request.send('get', uri_path("credit_notes",id.to_s), {}, env, headers)
51
+ end
52
+
53
+ def self.pdf(id, params={}, env=nil, headers={})
54
+ Request.send('post', uri_path("credit_notes",id.to_s,"pdf"), params, env, headers)
55
+ end
56
+
57
+ def self.record_refund(id, params, env=nil, headers={})
58
+ Request.send('post', uri_path("credit_notes",id.to_s,"record_refund"), params, env, headers)
59
+ end
60
+
61
+ def self.void_credit_note(id, params={}, env=nil, headers={})
62
+ Request.send('post', uri_path("credit_notes",id.to_s,"void"), params, env, headers)
63
+ end
64
+
65
+ def self.list(params={}, env=nil, headers={})
66
+ Request.send_list_request('get', uri_path("credit_notes"), params, env, headers)
67
+ end
68
+
69
+ def self.credit_notes_for_customer(id, params={}, env=nil, headers={})
70
+ Request.send('get', uri_path("customers",id.to_s,"credit_notes"), params, env, headers)
71
+ end
72
+
73
+ def self.delete(id, params={}, env=nil, headers={})
74
+ Request.send('post', uri_path("credit_notes",id.to_s,"delete"), params, env, headers)
75
+ end
76
+
77
+ end # ~CreditNote
78
78
  end # ~ChargeBee
@@ -1,36 +1,36 @@
1
- module ChargeBee
2
- class CreditNoteEstimate < Model
3
-
4
- class LineItem < Model
5
- attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :discount_amount, :item_level_discount_amount, :description, :entity_type, :tax_exempt_reason, :entity_id
6
- end
7
-
8
- class Discount < Model
9
- attr_accessor :amount, :description, :entity_type, :entity_id
10
- end
11
-
12
- class Tax < Model
13
- attr_accessor :name, :amount, :description
14
- end
15
-
16
- class LineItemTax < Model
17
- attr_accessor :line_item_id, :tax_name, :tax_rate, :tax_amount, :tax_juris_type, :tax_juris_name, :tax_juris_code
18
- end
19
-
20
- class LineItemDiscount < Model
21
- attr_accessor :line_item_id, :discount_type, :coupon_id, :discount_amount
22
- end
23
-
24
- class LineItemTier < Model
25
- attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount
26
- end
27
-
28
- attr_accessor :reference_invoice_id, :type, :price_type, :currency_code, :sub_total, :total,
29
- :amount_allocated, :amount_available, :line_items, :discounts, :taxes, :line_item_taxes, :line_item_discounts,
30
- :line_item_tiers, :round_off_amount
31
-
32
- # OPERATIONS
33
- #-----------
34
-
35
- end # ~CreditNoteEstimate
1
+ module ChargeBee
2
+ class CreditNoteEstimate < Model
3
+
4
+ class LineItem < Model
5
+ attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :discount_amount, :item_level_discount_amount, :description, :entity_type, :tax_exempt_reason, :entity_id
6
+ end
7
+
8
+ class Discount < Model
9
+ attr_accessor :amount, :description, :entity_type, :entity_id
10
+ end
11
+
12
+ class Tax < Model
13
+ attr_accessor :name, :amount, :description
14
+ end
15
+
16
+ class LineItemTax < Model
17
+ attr_accessor :line_item_id, :tax_name, :tax_rate, :tax_amount, :tax_juris_type, :tax_juris_name, :tax_juris_code
18
+ end
19
+
20
+ class LineItemDiscount < Model
21
+ attr_accessor :line_item_id, :discount_type, :coupon_id, :discount_amount
22
+ end
23
+
24
+ class LineItemTier < Model
25
+ attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount
26
+ end
27
+
28
+ attr_accessor :reference_invoice_id, :type, :price_type, :currency_code, :sub_total, :total,
29
+ :amount_allocated, :amount_available, :line_items, :discounts, :taxes, :line_item_taxes, :line_item_discounts,
30
+ :line_item_tiers, :round_off_amount
31
+
32
+ # OPERATIONS
33
+ #-----------
34
+
35
+ end # ~CreditNoteEstimate
36
36
  end # ~ChargeBee