chargebee 2.58.0 → 2.69.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +314 -0
- data/Gemfile +4 -3
- data/Gemfile.lock +18 -14
- data/Makefile +112 -0
- data/README.md +6 -0
- data/VERSION +1 -0
- data/chargebee.gemspec +17 -3
- data/lib/chargebee/errors.rb +12 -3
- data/lib/chargebee/models/comment.rb +1 -1
- data/lib/chargebee/models/coupon_code.rb +1 -0
- data/lib/chargebee/models/credit_note.rb +25 -24
- data/lib/chargebee/models/credit_note_estimate.rb +10 -10
- data/lib/chargebee/models/currency.rb +2 -2
- data/lib/chargebee/models/customer.rb +4 -1
- data/lib/chargebee/models/discount.rb +1 -1
- data/lib/chargebee/models/einvoice.rb +10 -0
- data/lib/chargebee/models/entitlement_override.rb +2 -2
- data/lib/chargebee/models/gateway_error_detail.rb +1 -1
- data/lib/chargebee/models/gift.rb +1 -0
- data/lib/chargebee/models/hosted_page.rb +1 -0
- data/lib/chargebee/models/impacted_customer.rb +14 -0
- data/lib/chargebee/models/invoice.rb +40 -33
- data/lib/chargebee/models/invoice_estimate.rb +14 -14
- data/lib/chargebee/models/offer_event.rb +16 -0
- data/lib/chargebee/models/offer_fulfillment.rb +36 -0
- data/lib/chargebee/models/omnichannel_one_time_order.rb +25 -0
- data/lib/chargebee/models/omnichannel_one_time_order_item.rb +11 -0
- data/lib/chargebee/models/omnichannel_subscription.rb +9 -4
- data/lib/chargebee/models/omnichannel_subscription_item.rb +2 -2
- data/lib/chargebee/models/omnichannel_subscription_item_offer.rb +12 -0
- data/lib/chargebee/models/omnichannel_transaction.rb +9 -1
- data/lib/chargebee/models/order.rb +2 -1
- data/lib/chargebee/models/payment_intent.rb +6 -2
- data/lib/chargebee/models/personalized_offer.rb +26 -0
- data/lib/chargebee/models/pricing_page_session.rb +2 -0
- data/lib/chargebee/models/promotional_credit.rb +1 -1
- data/lib/chargebee/models/quote.rb +11 -11
- data/lib/chargebee/models/quote_line_group.rb +10 -10
- data/lib/chargebee/models/quoted_charge.rb +5 -1
- data/lib/chargebee/models/quoted_delta_ramp.rb +14 -0
- data/lib/chargebee/models/quoted_ramp.rb +1 -1
- data/lib/chargebee/models/quoted_subscription.rb +2 -2
- data/lib/chargebee/models/ramp.rb +7 -3
- data/lib/chargebee/models/recorded_purchase.rb +5 -1
- data/lib/chargebee/models/subscription.rb +4 -3
- data/lib/chargebee/models/subscription_entitlements_created_detail.rb +10 -0
- data/lib/chargebee/models/subscription_entitlements_updated_detail.rb +10 -0
- data/lib/chargebee/models/subscription_estimate.rb +1 -1
- data/lib/chargebee/models/transaction.rb +3 -1
- data/lib/chargebee/models/usage_file.rb +5 -5
- data/lib/chargebee/models/webhook_endpoint.rb +52 -0
- data/lib/chargebee/{nativeRequest.rb → native_request.rb} +17 -9
- data/lib/chargebee/request.rb +2 -2
- data/lib/chargebee/result.rb +103 -18
- data/lib/chargebee.rb +10 -2
- data/lib/ssl/ca-certs.crt +50 -0
- data/spec/chargebee/native_request_spec.rb +13 -0
- metadata +22 -5
data/lib/chargebee/errors.rb
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
module ChargeBee
|
|
2
|
-
|
|
3
2
|
class Error < StandardError
|
|
4
3
|
attr_reader :original_error
|
|
5
4
|
|
|
@@ -9,6 +8,8 @@ module ChargeBee
|
|
|
9
8
|
end
|
|
10
9
|
end
|
|
11
10
|
|
|
11
|
+
class ForbiddenError < Error; end
|
|
12
|
+
|
|
12
13
|
class IOError < Error; end
|
|
13
14
|
|
|
14
15
|
class APIError < Error
|
|
@@ -16,7 +17,7 @@ module ChargeBee
|
|
|
16
17
|
attr_reader :http_status_code, :type, :api_error_code, :param, :json_obj, :error_cause_id,
|
|
17
18
|
#Deprecated attributes
|
|
18
19
|
:http_code, :http_body, :error_code
|
|
19
|
-
|
|
20
|
+
|
|
20
21
|
def initialize(http_code=nil, json_obj = nil)
|
|
21
22
|
super json_obj[:message]
|
|
22
23
|
@json_obj = json_obj
|
|
@@ -31,7 +32,7 @@ module ChargeBee
|
|
|
31
32
|
@http_code = http_code
|
|
32
33
|
@http_body = json_obj.to_s
|
|
33
34
|
end
|
|
34
|
-
|
|
35
|
+
|
|
35
36
|
end
|
|
36
37
|
|
|
37
38
|
|
|
@@ -41,4 +42,12 @@ module ChargeBee
|
|
|
41
42
|
|
|
42
43
|
class PaymentError < APIError; end
|
|
43
44
|
|
|
45
|
+
class UbbBatchIngestionInvalidRequestError < APIError
|
|
46
|
+
attr_reader :batch_id, :failed_events
|
|
47
|
+
def initialize(http_code=nil, json_obj=nil)
|
|
48
|
+
super(http_code, json_obj)
|
|
49
|
+
@batch_id=json_obj[:batch_id]
|
|
50
|
+
@failed_events=json_obj[:failed_events]
|
|
51
|
+
end
|
|
52
|
+
end
|
|
44
53
|
end
|
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
module ChargeBee
|
|
2
2
|
class CreditNote < Model
|
|
3
3
|
|
|
4
|
-
class Einvoice < Model
|
|
5
|
-
attr_accessor :id, :reference_number, :status, :message
|
|
6
|
-
end
|
|
7
|
-
|
|
8
4
|
class LineItem < Model
|
|
9
5
|
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :unit_amount_in_decimal, :quantity_in_decimal, :amount_in_decimal, :discount_amount, :item_level_discount_amount, :metered, :is_percentage_pricing, :reference_line_item_id, :description, :entity_description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
|
10
6
|
end
|
|
11
7
|
|
|
12
|
-
class
|
|
13
|
-
attr_accessor :
|
|
8
|
+
class LineItemTier < Model
|
|
9
|
+
attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount, :starting_unit_in_decimal, :ending_unit_in_decimal, :quantity_used_in_decimal, :unit_amount_in_decimal, :pricing_type, :package_size
|
|
14
10
|
end
|
|
15
11
|
|
|
16
12
|
class LineItemDiscount < Model
|
|
17
13
|
attr_accessor :line_item_id, :discount_type, :coupon_id, :entity_id, :discount_amount
|
|
18
14
|
end
|
|
19
15
|
|
|
20
|
-
class
|
|
21
|
-
attr_accessor :line_item_id, :
|
|
16
|
+
class LineItemTax < Model
|
|
17
|
+
attr_accessor :line_item_id, :tax_name, :tax_rate, :date_to, :date_from, :prorated_taxable_amount, :is_partial_tax_applied, :is_non_compliance_tax, :taxable_amount, :tax_amount, :tax_juris_type, :tax_juris_name, :tax_juris_code, :tax_amount_in_local_currency, :local_currency_code
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
class LineItemAddress < Model
|
|
21
|
+
attr_accessor :line_item_id, :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
class Discount < Model
|
|
25
|
+
attr_accessor :amount, :description, :line_item_id, :entity_type, :discount_type, :entity_id, :coupon_set_code
|
|
22
26
|
end
|
|
23
27
|
|
|
24
28
|
class Tax < Model
|
|
25
29
|
attr_accessor :name, :amount, :description
|
|
26
30
|
end
|
|
27
31
|
|
|
28
|
-
class
|
|
29
|
-
attr_accessor :
|
|
32
|
+
class TaxOrigin < Model
|
|
33
|
+
attr_accessor :country, :registration_number
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
class LinkedRefund < Model
|
|
@@ -38,33 +42,29 @@ module ChargeBee
|
|
|
38
42
|
end
|
|
39
43
|
|
|
40
44
|
class ShippingAddress < Model
|
|
41
|
-
attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
|
|
45
|
+
attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
|
|
42
46
|
end
|
|
43
47
|
|
|
44
48
|
class BillingAddress < Model
|
|
45
49
|
attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
|
|
46
50
|
end
|
|
47
51
|
|
|
48
|
-
class
|
|
49
|
-
attr_accessor :
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
class TaxOrigin < Model
|
|
53
|
-
attr_accessor :country, :registration_number
|
|
52
|
+
class Einvoice < Model
|
|
53
|
+
attr_accessor :id, :reference_number, :status, :message
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
-
class
|
|
57
|
-
attr_accessor :
|
|
56
|
+
class SiteDetailsAtCreation < Model
|
|
57
|
+
attr_accessor :timezone, :organization_address
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
attr_accessor :id, :customer_id, :subscription_id, :reference_invoice_id, :type, :reason_code,
|
|
61
61
|
:status, :vat_number, :date, :price_type, :currency_code, :total, :amount_allocated, :amount_refunded,
|
|
62
62
|
:amount_available, :refunded_at, :voided_at, :generated_at, :resource_version, :updated_at,
|
|
63
|
-
:channel, :
|
|
64
|
-
:round_off_amount, :fractional_correction, :line_items, :
|
|
65
|
-
:
|
|
66
|
-
:
|
|
67
|
-
:
|
|
63
|
+
:channel, :line_items_next_offset, :sub_total, :sub_total_in_local_currency, :total_in_local_currency,
|
|
64
|
+
:local_currency_code, :round_off_amount, :fractional_correction, :line_items, :line_item_tiers,
|
|
65
|
+
:line_item_discounts, :line_item_taxes, :line_item_addresses, :discounts, :taxes, :tax_origin,
|
|
66
|
+
:linked_refunds, :allocations, :deleted, :tax_category, :local_currency_exchange_rate, :create_reason_code,
|
|
67
|
+
:vat_number_prefix, :business_entity_id, :shipping_address, :billing_address, :einvoice, :site_details_at_creation
|
|
68
68
|
|
|
69
69
|
# OPERATIONS
|
|
70
70
|
#-----------
|
|
@@ -135,6 +135,7 @@ module ChargeBee
|
|
|
135
135
|
Request.send_list_request('get', uri_path("credit_notes"), params, env, headers,nil, false, jsonKeys, options)
|
|
136
136
|
end
|
|
137
137
|
|
|
138
|
+
# @deprecated This method is deprecated and will be removed in a future version.
|
|
138
139
|
def self.credit_notes_for_customer(id, params={}, env=nil, headers={})
|
|
139
140
|
jsonKeys = {
|
|
140
141
|
}
|
|
@@ -5,29 +5,29 @@ module ChargeBee
|
|
|
5
5
|
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :unit_amount_in_decimal, :quantity_in_decimal, :amount_in_decimal, :discount_amount, :item_level_discount_amount, :metered, :is_percentage_pricing, :reference_line_item_id, :description, :entity_description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
|
6
6
|
end
|
|
7
7
|
|
|
8
|
-
class
|
|
9
|
-
attr_accessor :
|
|
8
|
+
class LineItemTier < Model
|
|
9
|
+
attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount, :starting_unit_in_decimal, :ending_unit_in_decimal, :quantity_used_in_decimal, :unit_amount_in_decimal, :pricing_type, :package_size
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
class
|
|
13
|
-
attr_accessor :
|
|
12
|
+
class LineItemDiscount < Model
|
|
13
|
+
attr_accessor :line_item_id, :discount_type, :coupon_id, :entity_id, :discount_amount
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
class LineItemTax < Model
|
|
17
17
|
attr_accessor :line_item_id, :tax_name, :tax_rate, :date_to, :date_from, :prorated_taxable_amount, :is_partial_tax_applied, :is_non_compliance_tax, :taxable_amount, :tax_amount, :tax_juris_type, :tax_juris_name, :tax_juris_code, :tax_amount_in_local_currency, :local_currency_code
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
class
|
|
21
|
-
attr_accessor :line_item_id, :
|
|
20
|
+
class Discount < Model
|
|
21
|
+
attr_accessor :amount, :description, :line_item_id, :entity_type, :discount_type, :entity_id, :coupon_set_code
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
class
|
|
25
|
-
attr_accessor :
|
|
24
|
+
class Tax < Model
|
|
25
|
+
attr_accessor :name, :amount, :description
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
attr_accessor :reference_invoice_id, :type, :price_type, :currency_code, :sub_total, :total,
|
|
29
|
-
:amount_allocated, :amount_available, :line_items, :
|
|
30
|
-
:
|
|
29
|
+
:amount_allocated, :amount_available, :line_items, :line_item_tiers, :line_item_discounts, :line_item_taxes,
|
|
30
|
+
:discounts, :taxes, :round_off_amount, :customer_id
|
|
31
31
|
|
|
32
32
|
# OPERATIONS
|
|
33
33
|
#-----------
|
|
@@ -6,11 +6,11 @@ module ChargeBee
|
|
|
6
6
|
# OPERATIONS
|
|
7
7
|
#-----------
|
|
8
8
|
|
|
9
|
-
def self.list(env=nil, headers={})
|
|
9
|
+
def self.list(params={}, env=nil, headers={})
|
|
10
10
|
jsonKeys = {
|
|
11
11
|
}
|
|
12
12
|
options = {}
|
|
13
|
-
Request.send_list_request('get', uri_path("currencies","list"),
|
|
13
|
+
Request.send_list_request('get', uri_path("currencies","list"), params, env, headers,nil, false, jsonKeys, options)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def self.retrieve(id, env=nil, headers={})
|
|
@@ -18,7 +18,7 @@ module ChargeBee
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
class Balance < Model
|
|
21
|
-
attr_accessor :promotional_credits, :excess_payments, :refundable_credits, :unbilled_charges, :currency_code, :balance_currency_code
|
|
21
|
+
attr_accessor :promotional_credits, :excess_payments, :refundable_credits, :unbilled_charges, :currency_code, :balance_currency_code, :business_entity_id
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
class EntityIdentifier < Model
|
|
@@ -157,6 +157,7 @@ module ChargeBee
|
|
|
157
157
|
Request.send('post', uri_path("customers",id.to_s,"delete_contact"), params, env, headers,nil, false, jsonKeys, options)
|
|
158
158
|
end
|
|
159
159
|
|
|
160
|
+
# @deprecated This method is deprecated and will be removed in a future version.
|
|
160
161
|
def self.add_promotional_credits(id, params, env=nil, headers={})
|
|
161
162
|
jsonKeys = {
|
|
162
163
|
}
|
|
@@ -166,6 +167,7 @@ module ChargeBee
|
|
|
166
167
|
Request.send('post', uri_path("customers",id.to_s,"add_promotional_credits"), params, env, headers,nil, false, jsonKeys, options)
|
|
167
168
|
end
|
|
168
169
|
|
|
170
|
+
# @deprecated This method is deprecated and will be removed in a future version.
|
|
169
171
|
def self.deduct_promotional_credits(id, params, env=nil, headers={})
|
|
170
172
|
jsonKeys = {
|
|
171
173
|
}
|
|
@@ -175,6 +177,7 @@ module ChargeBee
|
|
|
175
177
|
Request.send('post', uri_path("customers",id.to_s,"deduct_promotional_credits"), params, env, headers,nil, false, jsonKeys, options)
|
|
176
178
|
end
|
|
177
179
|
|
|
180
|
+
# @deprecated This method is deprecated and will be removed in a future version.
|
|
178
181
|
def self.set_promotional_credits(id, params, env=nil, headers={})
|
|
179
182
|
jsonKeys = {
|
|
180
183
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module ChargeBee
|
|
2
2
|
class Discount < Model
|
|
3
3
|
|
|
4
|
-
attr_accessor :id, :invoice_name, :type, :percentage, :amount, :currency_code, :duration_type,
|
|
4
|
+
attr_accessor :id, :invoice_name, :type, :percentage, :amount, :quantity, :currency_code, :duration_type,
|
|
5
5
|
:period, :period_unit, :included_in_mrr, :apply_on, :item_price_id, :created_at, :apply_till,
|
|
6
6
|
:applied_count, :coupon_id, :index
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module ChargeBee
|
|
2
2
|
class EntitlementOverride < Model
|
|
3
3
|
|
|
4
|
-
attr_accessor :id, :entity_id, :entity_type, :feature_id, :feature_name, :value,
|
|
5
|
-
:effective_from, :schedule_status
|
|
4
|
+
attr_accessor :id, :subscription_id, :entity_id, :entity_type, :feature_id, :feature_name, :value,
|
|
5
|
+
:name, :expires_at, :effective_from, :is_enabled, :schedule_status
|
|
6
6
|
|
|
7
7
|
# OPERATIONS
|
|
8
8
|
#-----------
|
|
@@ -3,7 +3,7 @@ module ChargeBee
|
|
|
3
3
|
|
|
4
4
|
attr_accessor :request_id, :error_category, :error_code, :error_message, :decline_code, :decline_message,
|
|
5
5
|
:network_error_code, :network_error_message, :error_field, :recommendation_code, :recommendation_message,
|
|
6
|
-
:processor_error_code, :processor_error_message, :error_cause_id
|
|
6
|
+
:processor_error_code, :processor_error_message, :error_cause_id, :processor_advice_code
|
|
7
7
|
|
|
8
8
|
# OPERATIONS
|
|
9
9
|
#-----------
|
|
@@ -72,6 +72,7 @@ module ChargeBee
|
|
|
72
72
|
Request.send('post', uri_path("hosted_pages","checkout_existing_for_items"), params, env, headers,nil, false, jsonKeys, options)
|
|
73
73
|
end
|
|
74
74
|
|
|
75
|
+
# @deprecated This method is deprecated and will be removed in a future version.
|
|
75
76
|
def self.update_card(params, env=nil, headers={})
|
|
76
77
|
jsonKeys = {
|
|
77
78
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module ChargeBee
|
|
2
|
+
class ImpactedCustomer < Model
|
|
3
|
+
|
|
4
|
+
class Download < Model
|
|
5
|
+
attr_accessor :download_url, :valid_till, :mime_type
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
attr_accessor :action_type, :download
|
|
9
|
+
|
|
10
|
+
# OPERATIONS
|
|
11
|
+
#-----------
|
|
12
|
+
|
|
13
|
+
end # ~ImpactedCustomer
|
|
14
|
+
end # ~ChargeBee
|
|
@@ -5,18 +5,14 @@ module ChargeBee
|
|
|
5
5
|
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :unit_amount_in_decimal, :quantity_in_decimal, :amount_in_decimal, :discount_amount, :item_level_discount_amount, :metered, :is_percentage_pricing, :reference_line_item_id, :description, :entity_description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
|
6
6
|
end
|
|
7
7
|
|
|
8
|
-
class
|
|
9
|
-
attr_accessor :
|
|
8
|
+
class LineItemTier < Model
|
|
9
|
+
attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount, :starting_unit_in_decimal, :ending_unit_in_decimal, :quantity_used_in_decimal, :unit_amount_in_decimal, :pricing_type, :package_size
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
class LineItemDiscount < Model
|
|
13
13
|
attr_accessor :line_item_id, :discount_type, :coupon_id, :entity_id, :discount_amount
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
class Tax < Model
|
|
17
|
-
attr_accessor :name, :amount, :description
|
|
18
|
-
end
|
|
19
|
-
|
|
20
16
|
class LineItemTax < Model
|
|
21
17
|
attr_accessor :line_item_id, :tax_name, :tax_rate, :date_to, :date_from, :prorated_taxable_amount, :is_partial_tax_applied, :is_non_compliance_tax, :taxable_amount, :tax_amount, :tax_juris_type, :tax_juris_name, :tax_juris_code, :tax_amount_in_local_currency, :local_currency_code
|
|
22
18
|
end
|
|
@@ -25,16 +21,32 @@ module ChargeBee
|
|
|
25
21
|
attr_accessor :cn_id, :applied_amount, :line_item_id
|
|
26
22
|
end
|
|
27
23
|
|
|
28
|
-
class
|
|
29
|
-
attr_accessor :line_item_id, :
|
|
24
|
+
class LineItemAddress < Model
|
|
25
|
+
attr_accessor :line_item_id, :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
class Discount < Model
|
|
29
|
+
attr_accessor :amount, :description, :line_item_id, :entity_type, :discount_type, :entity_id, :coupon_set_code
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
class Tax < Model
|
|
33
|
+
attr_accessor :name, :amount, :description
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
class TaxOrigin < Model
|
|
37
|
+
attr_accessor :country, :registration_number
|
|
30
38
|
end
|
|
31
39
|
|
|
32
40
|
class LinkedPayment < Model
|
|
33
41
|
attr_accessor :txn_id, :applied_amount, :applied_at, :txn_status, :txn_date, :txn_amount
|
|
34
42
|
end
|
|
35
43
|
|
|
44
|
+
class ReferenceTransaction < Model
|
|
45
|
+
attr_accessor :applied_amount, :applied_at, :txn_id, :txn_status, :txn_date, :txn_amount, :txn_type, :amount_capturable, :authorization_reason
|
|
46
|
+
end
|
|
47
|
+
|
|
36
48
|
class DunningAttempt < Model
|
|
37
|
-
attr_accessor :attempt, :transaction_id, :dunning_type, :created_at, :txn_status, :txn_amount
|
|
49
|
+
attr_accessor :attempt, :transaction_id, :dunning_type, :created_at, :txn_status, :txn_amount, :retry_engine
|
|
38
50
|
end
|
|
39
51
|
|
|
40
52
|
class AppliedCredit < Model
|
|
@@ -58,17 +70,17 @@ module ChargeBee
|
|
|
58
70
|
end
|
|
59
71
|
|
|
60
72
|
class ShippingAddress < Model
|
|
61
|
-
attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
class StatementDescriptor < Model
|
|
65
|
-
attr_accessor :id, :descriptor
|
|
73
|
+
attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
|
|
66
74
|
end
|
|
67
75
|
|
|
68
76
|
class BillingAddress < Model
|
|
69
77
|
attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
|
|
70
78
|
end
|
|
71
79
|
|
|
80
|
+
class StatementDescriptor < Model
|
|
81
|
+
attr_accessor :id, :descriptor
|
|
82
|
+
end
|
|
83
|
+
|
|
72
84
|
class Einvoice < Model
|
|
73
85
|
attr_accessor :id, :reference_number, :status, :message
|
|
74
86
|
end
|
|
@@ -77,26 +89,18 @@ module ChargeBee
|
|
|
77
89
|
attr_accessor :timezone, :organization_address
|
|
78
90
|
end
|
|
79
91
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
:price_type, :date, :due_date, :net_term_days, :exchange_rate, :currency_code, :total, :amount_paid,
|
|
90
|
-
:amount_adjusted, :write_off_amount, :credits_applied, :amount_due, :paid_at, :dunning_status,
|
|
91
|
-
:next_retry_at, :voided_at, :resource_version, :updated_at, :sub_total, :sub_total_in_local_currency,
|
|
92
|
-
:total_in_local_currency, :local_currency_code, :tax, :local_currency_exchange_rate, :first_invoice,
|
|
93
|
-
:new_sales_amount, :has_advance_charges, :term_finalized, :is_gifted, :generated_at, :expected_payment_date,
|
|
94
|
-
:amount_to_collect, :round_off_amount, :line_items, :discounts, :line_item_discounts, :taxes,
|
|
95
|
-
:line_item_taxes, :line_item_credits, :line_item_tiers, :linked_payments, :dunning_attempts,
|
|
92
|
+
attr_accessor :id, :customer_id, :payment_owner, :subscription_id, :recurring, :status, :date,
|
|
93
|
+
:due_date, :net_term_days, :po_number, :vat_number, :price_type, :exchange_rate, :local_currency_exchange_rate,
|
|
94
|
+
:currency_code, :local_currency_code, :tax, :sub_total, :sub_total_in_local_currency, :total,
|
|
95
|
+
:total_in_local_currency, :amount_due, :amount_adjusted, :amount_paid, :paid_at, :write_off_amount,
|
|
96
|
+
:credits_applied, :dunning_status, :next_retry_at, :voided_at, :resource_version, :updated_at,
|
|
97
|
+
:line_items_next_offset, :first_invoice, :new_sales_amount, :has_advance_charges, :term_finalized,
|
|
98
|
+
:is_gifted, :generated_at, :expected_payment_date, :amount_to_collect, :round_off_amount, :line_items,
|
|
99
|
+
:line_item_tiers, :line_item_discounts, :line_item_taxes, :line_item_credits, :line_item_addresses,
|
|
100
|
+
:discounts, :taxes, :tax_origin, :linked_payments, :reference_transactions, :dunning_attempts,
|
|
96
101
|
:applied_credits, :adjustment_credit_notes, :issued_credit_notes, :linked_orders, :notes, :shipping_address,
|
|
97
|
-
:
|
|
98
|
-
:
|
|
99
|
-
:tax_origin, :line_item_addresses
|
|
102
|
+
:billing_address, :statement_descriptor, :einvoice, :void_reason_code, :deleted, :tax_category,
|
|
103
|
+
:vat_number_prefix, :channel, :business_entity_id, :site_details_at_creation
|
|
100
104
|
|
|
101
105
|
# OPERATIONS
|
|
102
106
|
#-----------
|
|
@@ -141,6 +145,7 @@ module ChargeBee
|
|
|
141
145
|
Request.send('post', uri_path("invoices","charge_addon"), params, env, headers,nil, false, jsonKeys, options)
|
|
142
146
|
end
|
|
143
147
|
|
|
148
|
+
# @deprecated This method is deprecated and will be removed in a future version.
|
|
144
149
|
def self.create_for_charge_item(params, env=nil, headers={})
|
|
145
150
|
jsonKeys = {
|
|
146
151
|
}
|
|
@@ -229,6 +234,7 @@ module ChargeBee
|
|
|
229
234
|
Request.send_list_request('get', uri_path("invoices"), params, env, headers,nil, false, jsonKeys, options)
|
|
230
235
|
end
|
|
231
236
|
|
|
237
|
+
# @deprecated This method is deprecated and will be removed in a future version.
|
|
232
238
|
def self.invoices_for_customer(id, params={}, env=nil, headers={})
|
|
233
239
|
jsonKeys = {
|
|
234
240
|
}
|
|
@@ -236,6 +242,7 @@ module ChargeBee
|
|
|
236
242
|
Request.send('get', uri_path("customers",id.to_s,"invoices"), params, env, headers,nil, false, jsonKeys, options)
|
|
237
243
|
end
|
|
238
244
|
|
|
245
|
+
# @deprecated This method is deprecated and will be removed in a future version.
|
|
239
246
|
def self.invoices_for_subscription(id, params={}, env=nil, headers={})
|
|
240
247
|
jsonKeys = {
|
|
241
248
|
}
|
|
@@ -5,37 +5,37 @@ module ChargeBee
|
|
|
5
5
|
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :unit_amount_in_decimal, :quantity_in_decimal, :amount_in_decimal, :discount_amount, :item_level_discount_amount, :metered, :is_percentage_pricing, :reference_line_item_id, :description, :entity_description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
|
6
6
|
end
|
|
7
7
|
|
|
8
|
-
class
|
|
9
|
-
attr_accessor :
|
|
8
|
+
class LineItemTier < Model
|
|
9
|
+
attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount, :starting_unit_in_decimal, :ending_unit_in_decimal, :quantity_used_in_decimal, :unit_amount_in_decimal, :pricing_type, :package_size
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
class
|
|
13
|
-
attr_accessor :
|
|
12
|
+
class LineItemDiscount < Model
|
|
13
|
+
attr_accessor :line_item_id, :discount_type, :coupon_id, :entity_id, :discount_amount
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
class LineItemTax < Model
|
|
17
17
|
attr_accessor :line_item_id, :tax_name, :tax_rate, :date_to, :date_from, :prorated_taxable_amount, :is_partial_tax_applied, :is_non_compliance_tax, :taxable_amount, :tax_amount, :tax_juris_type, :tax_juris_name, :tax_juris_code, :tax_amount_in_local_currency, :local_currency_code
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
class LineItemTier < Model
|
|
21
|
-
attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount, :starting_unit_in_decimal, :ending_unit_in_decimal, :quantity_used_in_decimal, :unit_amount_in_decimal, :pricing_type, :package_size
|
|
22
|
-
end
|
|
23
|
-
|
|
24
20
|
class LineItemCredit < Model
|
|
25
21
|
attr_accessor :cn_id, :applied_amount, :line_item_id
|
|
26
22
|
end
|
|
27
23
|
|
|
28
|
-
class LineItemDiscount < Model
|
|
29
|
-
attr_accessor :line_item_id, :discount_type, :coupon_id, :entity_id, :discount_amount
|
|
30
|
-
end
|
|
31
|
-
|
|
32
24
|
class LineItemAddress < Model
|
|
33
25
|
attr_accessor :line_item_id, :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
|
|
34
26
|
end
|
|
35
27
|
|
|
28
|
+
class Discount < Model
|
|
29
|
+
attr_accessor :amount, :description, :line_item_id, :entity_type, :discount_type, :entity_id, :coupon_set_code
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
class Tax < Model
|
|
33
|
+
attr_accessor :name, :amount, :description
|
|
34
|
+
end
|
|
35
|
+
|
|
36
36
|
attr_accessor :recurring, :price_type, :currency_code, :sub_total, :total, :credits_applied,
|
|
37
|
-
:amount_paid, :amount_due, :line_items, :
|
|
38
|
-
:line_item_credits, :
|
|
37
|
+
:amount_paid, :amount_due, :line_items, :line_item_tiers, :line_item_discounts, :line_item_taxes,
|
|
38
|
+
:line_item_credits, :line_item_addresses, :discounts, :taxes, :round_off_amount, :customer_id
|
|
39
39
|
|
|
40
40
|
# OPERATIONS
|
|
41
41
|
#-----------
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module ChargeBee
|
|
2
|
+
class OfferEvent < Model
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
# OPERATIONS
|
|
6
|
+
#-----------
|
|
7
|
+
|
|
8
|
+
def self.offer_events(params, env=nil, headers={})
|
|
9
|
+
jsonKeys = {
|
|
10
|
+
}
|
|
11
|
+
options = {}
|
|
12
|
+
Request.send('post', uri_path("offer_events"), params, env, headers, "grow", true, jsonKeys, options)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
end # ~OfferEvent
|
|
16
|
+
end # ~ChargeBee
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module ChargeBee
|
|
2
|
+
class OfferFulfillment < Model
|
|
3
|
+
|
|
4
|
+
class Error < Model
|
|
5
|
+
attr_accessor :code, :message
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
attr_accessor :id, :personalized_offer_id, :option_id, :processing_type, :status, :redirect_url,
|
|
9
|
+
:failed_at, :created_at, :completed_at, :error
|
|
10
|
+
|
|
11
|
+
# OPERATIONS
|
|
12
|
+
#-----------
|
|
13
|
+
|
|
14
|
+
def self.offer_fulfillments(params, env=nil, headers={})
|
|
15
|
+
jsonKeys = {
|
|
16
|
+
}
|
|
17
|
+
options = {}
|
|
18
|
+
Request.send('post', uri_path("offer_fulfillments"), params, env, headers, "grow", true, jsonKeys, options)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.offer_fulfillments_get(id, env=nil, headers={})
|
|
22
|
+
jsonKeys = {
|
|
23
|
+
}
|
|
24
|
+
options = {}
|
|
25
|
+
Request.send('get', uri_path("offer_fulfillments",id.to_s), {}, env, headers, "grow", true, jsonKeys, options)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def self.offer_fulfillments_update(id, params, env=nil, headers={})
|
|
29
|
+
jsonKeys = {
|
|
30
|
+
}
|
|
31
|
+
options = {}
|
|
32
|
+
Request.send('post', uri_path("offer_fulfillments",id.to_s), params, env, headers, "grow", true, jsonKeys, options)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end # ~OfferFulfillment
|
|
36
|
+
end # ~ChargeBee
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module ChargeBee
|
|
2
|
+
class OmnichannelOneTimeOrder < Model
|
|
3
|
+
|
|
4
|
+
attr_accessor :id, :app_id, :customer_id, :id_at_source, :origin, :source, :created_at, :resource_version,
|
|
5
|
+
:omnichannel_one_time_order_items, :purchase_transaction
|
|
6
|
+
|
|
7
|
+
# OPERATIONS
|
|
8
|
+
#-----------
|
|
9
|
+
|
|
10
|
+
def self.retrieve(id, env=nil, headers={})
|
|
11
|
+
jsonKeys = {
|
|
12
|
+
}
|
|
13
|
+
options = {}
|
|
14
|
+
Request.send('get', uri_path("omnichannel_one_time_orders",id.to_s), {}, env, headers,nil, false, jsonKeys, options)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.list(params={}, env=nil, headers={})
|
|
18
|
+
jsonKeys = {
|
|
19
|
+
}
|
|
20
|
+
options = {}
|
|
21
|
+
Request.send_list_request('get', uri_path("omnichannel_one_time_orders"), params, env, headers,nil, false, jsonKeys, options)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
end # ~OmnichannelOneTimeOrder
|
|
25
|
+
end # ~ChargeBee
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module ChargeBee
|
|
2
|
+
class OmnichannelOneTimeOrderItem < Model
|
|
3
|
+
|
|
4
|
+
attr_accessor :id, :item_id_at_source, :item_type_at_source, :quantity, :cancelled_at, :cancellation_reason,
|
|
5
|
+
:created_at, :resource_version
|
|
6
|
+
|
|
7
|
+
# OPERATIONS
|
|
8
|
+
#-----------
|
|
9
|
+
|
|
10
|
+
end # ~OmnichannelOneTimeOrderItem
|
|
11
|
+
end # ~ChargeBee
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
module ChargeBee
|
|
2
2
|
class OmnichannelSubscription < Model
|
|
3
3
|
|
|
4
|
-
class OmnichannelTransaction < Model
|
|
5
|
-
attr_accessor :id, :id_at_source, :app_id, :price_currency, :price_units, :price_nanos, :type, :transacted_at, :created_at, :resource_version
|
|
6
|
-
end
|
|
7
|
-
|
|
8
4
|
attr_accessor :id, :id_at_source, :app_id, :source, :customer_id, :created_at, :resource_version,
|
|
9
5
|
:omnichannel_subscription_items, :initial_purchase_transaction
|
|
10
6
|
|
|
@@ -32,5 +28,14 @@ module ChargeBee
|
|
|
32
28
|
Request.send('get', uri_path("omnichannel_subscriptions",id.to_s,"omnichannel_transactions"), params, env, headers,nil, false, jsonKeys, options)
|
|
33
29
|
end
|
|
34
30
|
|
|
31
|
+
def self.move(id, params, env=nil, headers={})
|
|
32
|
+
jsonKeys = {
|
|
33
|
+
}
|
|
34
|
+
options = {
|
|
35
|
+
:isIdempotent => true
|
|
36
|
+
}
|
|
37
|
+
Request.send('post', uri_path("omnichannel_subscriptions",id.to_s,"move"), params, env, headers,nil, false, jsonKeys, options)
|
|
38
|
+
end
|
|
39
|
+
|
|
35
40
|
end # ~OmnichannelSubscription
|
|
36
41
|
end # ~ChargeBee
|