chargebee 2.6.4 → 2.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1524 -1488
- data/LICENSE +24 -24
- data/README.rdoc +41 -41
- data/chargebee.gemspec +4 -3
- data/lib/chargebee.rb +85 -85
- data/lib/chargebee/environment.rb +28 -28
- data/lib/chargebee/errors.rb +43 -43
- data/lib/chargebee/models/addon.rb +45 -45
- data/lib/chargebee/models/address.rb +18 -18
- data/lib/chargebee/models/card.rb +32 -32
- data/lib/chargebee/models/comment.rb +25 -25
- data/lib/chargebee/models/contact.rb +10 -10
- data/lib/chargebee/models/coupon.rb +40 -40
- data/lib/chargebee/models/coupon_code.rb +25 -25
- data/lib/chargebee/models/coupon_set.rb +37 -37
- data/lib/chargebee/models/credit_note.rb +77 -77
- data/lib/chargebee/models/credit_note_estimate.rb +35 -35
- data/lib/chargebee/models/customer.rb +137 -120
- data/lib/chargebee/models/download.rb +9 -9
- data/lib/chargebee/models/estimate.rb +46 -46
- data/lib/chargebee/models/event.rb +45 -45
- data/lib/chargebee/models/export.rb +86 -86
- data/lib/chargebee/models/gift.rb +42 -42
- data/lib/chargebee/models/hierarchy.rb +10 -0
- data/lib/chargebee/models/hosted_page.rb +77 -77
- data/lib/chargebee/models/invoice.rb +172 -172
- data/lib/chargebee/models/invoice_estimate.rb +35 -35
- data/lib/chargebee/models/model.rb +101 -101
- data/lib/chargebee/models/order.rb +76 -76
- data/lib/chargebee/models/payment_source.rb +79 -71
- data/lib/chargebee/models/plan.rb +60 -59
- data/lib/chargebee/models/portal_session.rb +30 -30
- data/lib/chargebee/models/promotional_credit.rb +30 -30
- data/lib/chargebee/models/quote.rb +72 -72
- data/lib/chargebee/models/resource_migration.rb +13 -13
- data/lib/chargebee/models/site_migration_detail.rb +14 -14
- data/lib/chargebee/models/subscription.rb +137 -137
- data/lib/chargebee/models/subscription_estimate.rb +13 -13
- data/lib/chargebee/models/third_party_payment_method.rb +9 -9
- data/lib/chargebee/models/time_machine.rb +46 -46
- data/lib/chargebee/models/token.rb +11 -0
- data/lib/chargebee/models/transaction.rb +62 -62
- data/lib/chargebee/models/unbilled_charge.rb +31 -31
- data/lib/chargebee/models/virtual_bank_account.rb +30 -26
- data/lib/chargebee/request.rb +27 -27
- data/lib/chargebee/rest.rb +92 -92
- data/lib/chargebee/result.rb +255 -240
- data/spec/errors_spec.rb +23 -23
- data/spec/sample_response.rb +73 -73
- metadata +5 -4
- data/lib/chargebee/.DS_Store +0 -0
@@ -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, :
|
11
|
-
:
|
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
|
@@ -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
|