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
@@ -1,77 +1,77 @@
1
- module ChargeBee
2
- class Order < Model
3
-
4
- class OrderLineItem < Model
5
- attr_accessor :id, :invoice_id, :invoice_line_item_id, :unit_price, :description, :amount, :fulfillment_quantity, :fulfillment_amount, :tax_amount, :amount_paid, :amount_adjusted, :refundable_credits_issued, :refundable_credits, :is_shippable, :sku, :status, :entity_type, :item_level_discount_amount, :discount_amount, :entity_id
6
- end
7
-
8
- class ShippingAddress < Model
9
- attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
10
- end
11
-
12
- class BillingAddress < Model
13
- attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
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 LinkedCreditNote < Model
25
- attr_accessor :amount, :type, :id, :status, :amount_adjusted, :amount_refunded
26
- end
27
-
28
- attr_accessor :id, :document_number, :invoice_id, :subscription_id, :customer_id, :status, :cancellation_reason,
29
- :payment_status, :order_type, :price_type, :reference_id, :fulfillment_status, :order_date,
30
- :shipping_date, :note, :tracking_id, :batch_id, :created_by, :shipment_carrier, :invoice_round_off_amount,
31
- :tax, :amount_paid, :amount_adjusted, :refundable_credits_issued, :refundable_credits, :rounding_adjustement,
32
- :paid_on, :shipping_cut_off_date, :created_at, :status_update_at, :delivered_at, :shipped_at,
33
- :resource_version, :updated_at, :cancelled_at, :order_line_items, :shipping_address, :billing_address,
34
- :discount, :sub_total, :total, :line_item_taxes, :line_item_discounts, :linked_credit_notes,
35
- :deleted, :currency_code, :is_gifted, :gift_note, :gift_id
36
-
37
- # OPERATIONS
38
- #-----------
39
-
40
- def self.create(params, env=nil, headers={})
41
- Request.send('post', uri_path("orders"), params, env, headers)
42
- end
43
-
44
- def self.update(id, params={}, env=nil, headers={})
45
- Request.send('post', uri_path("orders",id.to_s), params, env, headers)
46
- end
47
-
48
- def self.assign_order_number(id, env=nil, headers={})
49
- Request.send('post', uri_path("orders",id.to_s,"assign_order_number"), {}, env, headers)
50
- end
51
-
52
- def self.cancel(id, params, env=nil, headers={})
53
- Request.send('post', uri_path("orders",id.to_s,"cancel"), params, env, headers)
54
- end
55
-
56
- def self.create_refundable_credit_note(id, params, env=nil, headers={})
57
- Request.send('post', uri_path("orders",id.to_s,"create_refundable_credit_note"), params, env, headers)
58
- end
59
-
60
- def self.reopen(id, params={}, env=nil, headers={})
61
- Request.send('post', uri_path("orders",id.to_s,"reopen"), params, env, headers)
62
- end
63
-
64
- def self.retrieve(id, env=nil, headers={})
65
- Request.send('get', uri_path("orders",id.to_s), {}, env, headers)
66
- end
67
-
68
- def self.list(params={}, env=nil, headers={})
69
- Request.send_list_request('get', uri_path("orders"), params, env, headers)
70
- end
71
-
72
- def self.orders_for_invoice(id, params={}, env=nil, headers={})
73
- Request.send('get', uri_path("invoices",id.to_s,"orders"), params, env, headers)
74
- end
75
-
76
- end # ~Order
1
+ module ChargeBee
2
+ class Order < Model
3
+
4
+ class OrderLineItem < Model
5
+ attr_accessor :id, :invoice_id, :invoice_line_item_id, :unit_price, :description, :amount, :fulfillment_quantity, :fulfillment_amount, :tax_amount, :amount_paid, :amount_adjusted, :refundable_credits_issued, :refundable_credits, :is_shippable, :sku, :status, :entity_type, :item_level_discount_amount, :discount_amount, :entity_id
6
+ end
7
+
8
+ class ShippingAddress < Model
9
+ attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
10
+ end
11
+
12
+ class BillingAddress < Model
13
+ attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
14
+ end
15
+
16
+ class LineItemTax < Model
17
+ attr_accessor :line_item_id, :tax_name, :tax_rate, :is_partial_tax_applied, :is_non_compliance_tax, :taxable_amount, :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 LinkedCreditNote < Model
25
+ attr_accessor :amount, :type, :id, :status, :amount_adjusted, :amount_refunded
26
+ end
27
+
28
+ attr_accessor :id, :document_number, :invoice_id, :subscription_id, :customer_id, :status, :cancellation_reason,
29
+ :payment_status, :order_type, :price_type, :reference_id, :fulfillment_status, :order_date,
30
+ :shipping_date, :note, :tracking_id, :batch_id, :created_by, :shipment_carrier, :invoice_round_off_amount,
31
+ :tax, :amount_paid, :amount_adjusted, :refundable_credits_issued, :refundable_credits, :rounding_adjustement,
32
+ :paid_on, :shipping_cut_off_date, :created_at, :status_update_at, :delivered_at, :shipped_at,
33
+ :resource_version, :updated_at, :cancelled_at, :order_line_items, :shipping_address, :billing_address,
34
+ :discount, :sub_total, :total, :line_item_taxes, :line_item_discounts, :linked_credit_notes,
35
+ :deleted, :currency_code, :is_gifted, :gift_note, :gift_id
36
+
37
+ # OPERATIONS
38
+ #-----------
39
+
40
+ def self.create(params, env=nil, headers={})
41
+ Request.send('post', uri_path("orders"), params, env, headers)
42
+ end
43
+
44
+ def self.update(id, params={}, env=nil, headers={})
45
+ Request.send('post', uri_path("orders",id.to_s), params, env, headers)
46
+ end
47
+
48
+ def self.assign_order_number(id, env=nil, headers={})
49
+ Request.send('post', uri_path("orders",id.to_s,"assign_order_number"), {}, env, headers)
50
+ end
51
+
52
+ def self.cancel(id, params, env=nil, headers={})
53
+ Request.send('post', uri_path("orders",id.to_s,"cancel"), params, env, headers)
54
+ end
55
+
56
+ def self.create_refundable_credit_note(id, params, env=nil, headers={})
57
+ Request.send('post', uri_path("orders",id.to_s,"create_refundable_credit_note"), params, env, headers)
58
+ end
59
+
60
+ def self.reopen(id, params={}, env=nil, headers={})
61
+ Request.send('post', uri_path("orders",id.to_s,"reopen"), params, env, headers)
62
+ end
63
+
64
+ def self.retrieve(id, env=nil, headers={})
65
+ Request.send('get', uri_path("orders",id.to_s), {}, env, headers)
66
+ end
67
+
68
+ def self.list(params={}, env=nil, headers={})
69
+ Request.send_list_request('get', uri_path("orders"), params, env, headers)
70
+ end
71
+
72
+ def self.orders_for_invoice(id, params={}, env=nil, headers={})
73
+ Request.send('get', uri_path("invoices",id.to_s,"orders"), params, env, headers)
74
+ end
75
+
76
+ end # ~Order
77
77
  end # ~ChargeBee
@@ -1,72 +1,76 @@
1
- module ChargeBee
2
- class PaymentSource < Model
3
-
4
- class Card < Model
5
- attr_accessor :first_name, :last_name, :iin, :last4, :brand, :funding_type, :expiry_month, :expiry_year, :billing_addr1, :billing_addr2, :billing_city, :billing_state_code, :billing_state, :billing_country, :billing_zip, :masked_number
6
- end
7
-
8
- class BankAccount < Model
9
- attr_accessor :last4, :name_on_account, :bank_name, :mandate_id, :account_type, :echeck_type, :account_holder_type
10
- end
11
-
12
- class AmazonPayment < Model
13
- attr_accessor :email, :agreement_id
14
- end
15
-
16
- class Paypal < Model
17
- attr_accessor :email, :agreement_id
18
- end
19
-
20
- attr_accessor :id, :resource_version, :updated_at, :created_at, :customer_id, :type, :reference_id,
21
- :status, :gateway, :gateway_account_id, :ip_address, :issuing_country, :card, :bank_account,
22
- :amazon_payment, :paypal, :deleted
23
-
24
- # OPERATIONS
25
- #-----------
26
-
27
- def self.create_using_temp_token(params, env=nil, headers={})
28
- Request.send('post', uri_path("payment_sources","create_using_temp_token"), params, env, headers)
29
- end
30
-
31
- def self.create_using_permanent_token(params, env=nil, headers={})
32
- Request.send('post', uri_path("payment_sources","create_using_permanent_token"), params, env, headers)
33
- end
34
-
35
- def self.create_card(params, env=nil, headers={})
36
- Request.send('post', uri_path("payment_sources","create_card"), params, env, headers)
37
- end
38
-
39
- def self.create_bank_account(params, env=nil, headers={})
40
- Request.send('post', uri_path("payment_sources","create_bank_account"), params, env, headers)
41
- end
42
-
43
- def self.update_card(id, params={}, env=nil, headers={})
44
- Request.send('post', uri_path("payment_sources",id.to_s,"update_card"), params, env, headers)
45
- end
46
-
47
- def self.verify_bank_account(id, params, env=nil, headers={})
48
- Request.send('post', uri_path("payment_sources",id.to_s,"verify_bank_account"), params, env, headers)
49
- end
50
-
51
- def self.retrieve(id, env=nil, headers={})
52
- Request.send('get', uri_path("payment_sources",id.to_s), {}, env, headers)
53
- end
54
-
55
- def self.list(params={}, env=nil, headers={})
56
- Request.send_list_request('get', uri_path("payment_sources"), params, env, headers)
57
- end
58
-
59
- def self.switch_gateway_account(id, params, env=nil, headers={})
60
- Request.send('post', uri_path("payment_sources",id.to_s,"switch_gateway_account"), params, env, headers)
61
- end
62
-
63
- def self.export_payment_source(id, params, env=nil, headers={})
64
- Request.send('post', uri_path("payment_sources",id.to_s,"export_payment_source"), params, env, headers)
65
- end
66
-
67
- def self.delete(id, env=nil, headers={})
68
- Request.send('post', uri_path("payment_sources",id.to_s,"delete"), {}, env, headers)
69
- end
70
-
71
- end # ~PaymentSource
1
+ module ChargeBee
2
+ class PaymentSource < Model
3
+
4
+ class Card < Model
5
+ attr_accessor :first_name, :last_name, :iin, :last4, :brand, :funding_type, :expiry_month, :expiry_year, :billing_addr1, :billing_addr2, :billing_city, :billing_state_code, :billing_state, :billing_country, :billing_zip, :masked_number
6
+ end
7
+
8
+ class BankAccount < Model
9
+ attr_accessor :last4, :name_on_account, :bank_name, :mandate_id, :account_type, :echeck_type, :account_holder_type
10
+ end
11
+
12
+ class AmazonPayment < Model
13
+ attr_accessor :email, :agreement_id
14
+ end
15
+
16
+ class Paypal < Model
17
+ attr_accessor :email, :agreement_id
18
+ end
19
+
20
+ attr_accessor :id, :resource_version, :updated_at, :created_at, :customer_id, :type, :reference_id,
21
+ :status, :gateway, :gateway_account_id, :ip_address, :issuing_country, :card, :bank_account,
22
+ :amazon_payment, :paypal, :deleted
23
+
24
+ # OPERATIONS
25
+ #-----------
26
+
27
+ def self.create_using_temp_token(params, env=nil, headers={})
28
+ Request.send('post', uri_path("payment_sources","create_using_temp_token"), params, env, headers)
29
+ end
30
+
31
+ def self.create_using_permanent_token(params, env=nil, headers={})
32
+ Request.send('post', uri_path("payment_sources","create_using_permanent_token"), params, env, headers)
33
+ end
34
+
35
+ def self.create_card(params, env=nil, headers={})
36
+ Request.send('post', uri_path("payment_sources","create_card"), params, env, headers)
37
+ end
38
+
39
+ def self.create_bank_account(params, env=nil, headers={})
40
+ Request.send('post', uri_path("payment_sources","create_bank_account"), params, env, headers)
41
+ end
42
+
43
+ def self.update_card(id, params={}, env=nil, headers={})
44
+ Request.send('post', uri_path("payment_sources",id.to_s,"update_card"), params, env, headers)
45
+ end
46
+
47
+ def self.verify_bank_account(id, params, env=nil, headers={})
48
+ Request.send('post', uri_path("payment_sources",id.to_s,"verify_bank_account"), params, env, headers)
49
+ end
50
+
51
+ def self.retrieve(id, env=nil, headers={})
52
+ Request.send('get', uri_path("payment_sources",id.to_s), {}, env, headers)
53
+ end
54
+
55
+ def self.list(params={}, env=nil, headers={})
56
+ Request.send_list_request('get', uri_path("payment_sources"), params, env, headers)
57
+ end
58
+
59
+ def self.switch_gateway_account(id, params, env=nil, headers={})
60
+ Request.send('post', uri_path("payment_sources",id.to_s,"switch_gateway_account"), params, env, headers)
61
+ end
62
+
63
+ def self.export_payment_source(id, params, env=nil, headers={})
64
+ Request.send('post', uri_path("payment_sources",id.to_s,"export_payment_source"), params, env, headers)
65
+ end
66
+
67
+ def self.delete(id, env=nil, headers={})
68
+ Request.send('post', uri_path("payment_sources",id.to_s,"delete"), {}, env, headers)
69
+ end
70
+
71
+ def self.delete_local(id, env=nil, headers={})
72
+ Request.send('post', uri_path("payment_sources",id.to_s,"delete_local"), {}, env, headers)
73
+ end
74
+
75
+ end # ~PaymentSource
72
76
  end # ~ChargeBee
@@ -1,60 +1,61 @@
1
- module ChargeBee
2
- class Plan < Model
3
-
4
- class Tier < Model
5
- attr_accessor :starting_unit, :ending_unit, :price
6
- end
7
-
8
- class ApplicableAddon < Model
9
- attr_accessor :id
10
- end
11
-
12
- class AttachedAddon < Model
13
- attr_accessor :id, :quantity, :billing_cycles, :type
14
- end
15
-
16
- class EventBasedAddon < Model
17
- attr_accessor :id, :quantity, :on_event, :charge_once
18
- end
19
-
20
- attr_accessor :id, :name, :invoice_name, :description, :price, :currency_code, :period, :period_unit,
21
- :trial_period, :trial_period_unit, :pricing_model, :charge_model, :free_quantity, :setup_cost,
22
- :downgrade_penalty, :status, :archived_at, :billing_cycles, :redirect_url, :enabled_in_hosted_pages,
23
- :enabled_in_portal, :addon_applicability, :tax_code, :sku, :accounting_code, :accounting_category1,
24
- :accounting_category2, :is_shippable, :shipping_frequency_period, :shipping_frequency_period_unit,
25
- :resource_version, :updated_at, :giftable, :claim_url, :invoice_notes, :taxable, :tax_profile_id,
26
- :meta_data, :tiers, :applicable_addons, :attached_addons, :event_based_addons
27
-
28
- # OPERATIONS
29
- #-----------
30
-
31
- def self.create(params, env=nil, headers={})
32
- Request.send('post', uri_path("plans"), params, env, headers)
33
- end
34
-
35
- def self.update(id, params={}, env=nil, headers={})
36
- Request.send('post', uri_path("plans",id.to_s), params, env, headers)
37
- end
38
-
39
- def self.list(params={}, env=nil, headers={})
40
- Request.send_list_request('get', uri_path("plans"), params, env, headers)
41
- end
42
-
43
- def self.retrieve(id, env=nil, headers={})
44
- Request.send('get', uri_path("plans",id.to_s), {}, env, headers)
45
- end
46
-
47
- def self.delete(id, env=nil, headers={})
48
- Request.send('post', uri_path("plans",id.to_s,"delete"), {}, env, headers)
49
- end
50
-
51
- def self.copy(params, env=nil, headers={})
52
- Request.send('post', uri_path("plans","copy"), params, env, headers)
53
- end
54
-
55
- def self.unarchive(id, env=nil, headers={})
56
- Request.send('post', uri_path("plans",id.to_s,"unarchive"), {}, env, headers)
57
- end
58
-
59
- end # ~Plan
1
+ module ChargeBee
2
+ class Plan < Model
3
+
4
+ class Tier < Model
5
+ attr_accessor :starting_unit, :ending_unit, :price
6
+ end
7
+
8
+ class ApplicableAddon < Model
9
+ attr_accessor :id
10
+ end
11
+
12
+ class AttachedAddon < Model
13
+ attr_accessor :id, :quantity, :billing_cycles, :type
14
+ end
15
+
16
+ class EventBasedAddon < Model
17
+ attr_accessor :id, :quantity, :on_event, :charge_once
18
+ end
19
+
20
+ attr_accessor :id, :name, :invoice_name, :description, :price, :currency_code, :period, :period_unit,
21
+ :trial_period, :trial_period_unit, :pricing_model, :charge_model, :free_quantity, :setup_cost,
22
+ :downgrade_penalty, :status, :archived_at, :billing_cycles, :redirect_url, :enabled_in_hosted_pages,
23
+ :enabled_in_portal, :addon_applicability, :tax_code, :avalara_sale_type, :avalara_transaction_type,
24
+ :avalara_service_type, :sku, :accounting_code, :accounting_category1, :accounting_category2,
25
+ :is_shippable, :shipping_frequency_period, :shipping_frequency_period_unit, :resource_version,
26
+ :updated_at, :giftable, :claim_url, :invoice_notes, :taxable, :tax_profile_id, :meta_data, :tiers,
27
+ :applicable_addons, :attached_addons, :event_based_addons
28
+
29
+ # OPERATIONS
30
+ #-----------
31
+
32
+ def self.create(params, env=nil, headers={})
33
+ Request.send('post', uri_path("plans"), params, env, headers)
34
+ end
35
+
36
+ def self.update(id, params={}, env=nil, headers={})
37
+ Request.send('post', uri_path("plans",id.to_s), params, env, headers)
38
+ end
39
+
40
+ def self.list(params={}, env=nil, headers={})
41
+ Request.send_list_request('get', uri_path("plans"), params, env, headers)
42
+ end
43
+
44
+ def self.retrieve(id, env=nil, headers={})
45
+ Request.send('get', uri_path("plans",id.to_s), {}, env, headers)
46
+ end
47
+
48
+ def self.delete(id, env=nil, headers={})
49
+ Request.send('post', uri_path("plans",id.to_s,"delete"), {}, env, headers)
50
+ end
51
+
52
+ def self.copy(params, env=nil, headers={})
53
+ Request.send('post', uri_path("plans","copy"), params, env, headers)
54
+ end
55
+
56
+ def self.unarchive(id, env=nil, headers={})
57
+ Request.send('post', uri_path("plans",id.to_s,"unarchive"), {}, env, headers)
58
+ end
59
+
60
+ end # ~Plan
60
61
  end # ~ChargeBee
@@ -1,31 +1,31 @@
1
- module ChargeBee
2
- class PortalSession < Model
3
-
4
- class LinkedCustomer < Model
5
- attr_accessor :customer_id, :email, :has_billing_address, :has_payment_method, :has_active_subscription
6
- end
7
-
8
- attr_accessor :id, :token, :access_url, :redirect_url, :status, :created_at, :expires_at, :customer_id,
9
- :login_at, :logout_at, :login_ipaddress, :logout_ipaddress, :linked_customers
10
-
11
- # OPERATIONS
12
- #-----------
13
-
14
- def self.create(params, env=nil, headers={})
15
- Request.send('post', uri_path("portal_sessions"), params, env, headers)
16
- end
17
-
18
- def self.retrieve(id, env=nil, headers={})
19
- Request.send('get', uri_path("portal_sessions",id.to_s), {}, env, headers)
20
- end
21
-
22
- def self.logout(id, env=nil, headers={})
23
- Request.send('post', uri_path("portal_sessions",id.to_s,"logout"), {}, env, headers)
24
- end
25
-
26
- def self.activate(id, params, env=nil, headers={})
27
- Request.send('post', uri_path("portal_sessions",id.to_s,"activate"), params, env, headers)
28
- end
29
-
30
- end # ~PortalSession
1
+ module ChargeBee
2
+ class PortalSession < Model
3
+
4
+ class LinkedCustomer < Model
5
+ attr_accessor :customer_id, :email, :has_billing_address, :has_payment_method, :has_active_subscription
6
+ end
7
+
8
+ attr_accessor :id, :token, :access_url, :redirect_url, :status, :created_at, :expires_at, :customer_id,
9
+ :login_at, :logout_at, :login_ipaddress, :logout_ipaddress, :linked_customers
10
+
11
+ # OPERATIONS
12
+ #-----------
13
+
14
+ def self.create(params, env=nil, headers={})
15
+ Request.send('post', uri_path("portal_sessions"), params, env, headers)
16
+ end
17
+
18
+ def self.retrieve(id, env=nil, headers={})
19
+ Request.send('get', uri_path("portal_sessions",id.to_s), {}, env, headers)
20
+ end
21
+
22
+ def self.logout(id, env=nil, headers={})
23
+ Request.send('post', uri_path("portal_sessions",id.to_s,"logout"), {}, env, headers)
24
+ end
25
+
26
+ def self.activate(id, params, env=nil, headers={})
27
+ Request.send('post', uri_path("portal_sessions",id.to_s,"activate"), params, env, headers)
28
+ end
29
+
30
+ end # ~PortalSession
31
31
  end # ~ChargeBee
@@ -1,31 +1,31 @@
1
- module ChargeBee
2
- class PromotionalCredit < Model
3
-
4
- attr_accessor :id, :customer_id, :type, :amount, :currency_code, :description, :credit_type,
5
- :reference, :closing_balance, :done_by, :created_at
6
-
7
- # OPERATIONS
8
- #-----------
9
-
10
- def self.add(params, env=nil, headers={})
11
- Request.send('post', uri_path("promotional_credits","add"), params, env, headers)
12
- end
13
-
14
- def self.deduct(params, env=nil, headers={})
15
- Request.send('post', uri_path("promotional_credits","deduct"), params, env, headers)
16
- end
17
-
18
- def self.set(params, env=nil, headers={})
19
- Request.send('post', uri_path("promotional_credits","set"), params, env, headers)
20
- end
21
-
22
- def self.list(params={}, env=nil, headers={})
23
- Request.send_list_request('get', uri_path("promotional_credits"), params, env, headers)
24
- end
25
-
26
- def self.retrieve(id, env=nil, headers={})
27
- Request.send('get', uri_path("promotional_credits",id.to_s), {}, env, headers)
28
- end
29
-
30
- end # ~PromotionalCredit
1
+ module ChargeBee
2
+ class PromotionalCredit < Model
3
+
4
+ attr_accessor :id, :customer_id, :type, :amount, :currency_code, :description, :credit_type,
5
+ :reference, :closing_balance, :done_by, :created_at
6
+
7
+ # OPERATIONS
8
+ #-----------
9
+
10
+ def self.add(params, env=nil, headers={})
11
+ Request.send('post', uri_path("promotional_credits","add"), params, env, headers)
12
+ end
13
+
14
+ def self.deduct(params, env=nil, headers={})
15
+ Request.send('post', uri_path("promotional_credits","deduct"), params, env, headers)
16
+ end
17
+
18
+ def self.set(params, env=nil, headers={})
19
+ Request.send('post', uri_path("promotional_credits","set"), params, env, headers)
20
+ end
21
+
22
+ def self.list(params={}, env=nil, headers={})
23
+ Request.send_list_request('get', uri_path("promotional_credits"), params, env, headers)
24
+ end
25
+
26
+ def self.retrieve(id, env=nil, headers={})
27
+ Request.send('get', uri_path("promotional_credits",id.to_s), {}, env, headers)
28
+ end
29
+
30
+ end # ~PromotionalCredit
31
31
  end # ~ChargeBee