chargebee 2.11.2 → 2.13.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0161fb2d18ed430ea6daacbff4d15094aa5a277c99dc7fe26c1e97d6b2090e38
4
- data.tar.gz: 52b81f2222f0ab37e676468f1df9b317c8dfa78add2a92a5fdde1e53634b48b3
3
+ metadata.gz: 49d70f2529b34c3a788cbf65750ba516a34ace1760b1b9ad27113b1a3c11592b
4
+ data.tar.gz: bdf0b4097567ec86e767586394c7e6f7bbb2a9ed4e16ce0d5aa3e0086bad4760
5
5
  SHA512:
6
- metadata.gz: 60d4112a05bef4c902e4e64b93ce50c30637922dfc00c32f92af996e7c349e02ec2ce55fc10198cd6a595545627a68ef6229ab0d490223c16a79f2667fbaee96
7
- data.tar.gz: ad7310dbc8448c6be60bb36c6054e3d753d3cfe96fd7a79762806b6a85dcba5f4580c4ed2c3322bed84ea1d8e531dea83d023a35077c1f0eee998e570415bc38
6
+ metadata.gz: a4a6cb02c12057610e0f7947855863f530eceacd201884e510e623a9fe2ad1800f5c8415d4e53e8f266f12b561f8c2b35ae28735c28fa62331fcdc8ce4aba57d
7
+ data.tar.gz: f44994755b77b350fca0ee5e20e09afab9d6653258b0b49297e2aa7519d4015442bf503befe750d13693c290b55f389fa0ed7ccee29f8b7315c47560a398b19f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,86 @@
1
+ ### v2.13.1 (2022-03-08)
2
+ * * *
3
+
4
+ ### Fixes:
5
+ * Fixed RSpec testcase failure issue.
6
+
7
+
8
+ ### v2.13.0 (2022-03-08)
9
+ * * *
10
+
11
+ ### Fixes:
12
+ * Fixed serialization issue for nested array attributes.
13
+ * Fixed method_missing implementation.
14
+ * Fixed RSpec deprecation warnings issue.
15
+
16
+ #### New attributes:
17
+ * upi, mandates and their subresources have been added to the payment_source resource.
18
+
19
+ #### New Input parameters:
20
+ * bank_account[phone] have been added to customers#create_bank_account
21
+ * payment_intent[payment_method_type] have been added to customers#create_payment_intent, customers#collect_payment_intent
22
+ * payment_intent[payment_method_type] have been added to estimate#gift_subscription and estimate#gift_subscription_for_items.
23
+ * payment_intent[payment_method_type] have been added to gift#create_payment_intent and gift#create_gift_for_items_payment_intent.
24
+ * customer[is_einvoice_enabled], customer[entity_identifier_scheme], customer[entity_identifier_standard], entity_identifiers[id], entity_identifiers[scheme], entity_identifiers[value], entity_identifiers[operation], entity_identifiers[standard] have been added to hosted_page#checkout_onetime_for_items, hosted_page#checkout_new_for_items and hosted_page#checkout_existing_for_items.
25
+ * bank_account[phone] have been added to invoice#create_bank_account, invoice#create_bank_account_for_chargeitems_and_charges
26
+ * payment_intent[payment_method_type] have been added to invoice#create_payment_intent, invoice#create_payment_intent_for_chargeitems_and_charges
27
+ * bank_account[phone] have been added to payment_source#create_bank_account
28
+ * payment_intent[payment_method_type] have been added to payment_source#create_using_payment_intent
29
+ * subscription_id have been added to payment_source#list_payment_source
30
+ * bank_account[phone] have been added to subscription#create_bank_account
31
+ * payment_intent[payment_method_type] have been added to subscription#create_payment_intent, subscription#create_payment_intent_for_customer, subscription#create_payment_intent_with_items, subscription#update_payment_intent, subscription#update_payment_intent_for_items, subscription#reactivate_payment_intent, subscription#resume_payment_intent
32
+ * activated_at have been added to subscription#import_subscription, subscription#import_subscription_for_customer, subscription#import_subscription_for_items
33
+
34
+ #### New Enum values:
35
+ * upi, netbanking_emandates enum has been added in customer_payment_method_type subresource of customer resource
36
+ * current enum has been added in account_type.
37
+ * quickbooks, razorpay enum has been added in gateway.
38
+ * upi, netbanking_emandates enum has been added in payment_method,payment_method_type, type
39
+ * upi, netbanking_emandates, apple_pay enum has been added in payment_method_type subresource of payment_intent resource
40
+ * current enum has been added in bank_account_type subresource of payment_source.
41
+
42
+ #### Deprecated attributes:
43
+ * coupon attribute have been added and deprecated in hosted_page resource.
44
+
45
+ #### Deprecated enums:
46
+ * NetdPaymentDueReminder have been deprecated in event_type.
47
+
48
+
49
+ ### v2.12.0 (2022-01-21)
50
+ * * *
51
+
52
+ #### New endpoints:
53
+ * credit_notes#download_einvoice has been added to the credit_notes resource.
54
+ * invoice#download_einvoice has been added to the invoice resource.
55
+
56
+ #### New attributes:
57
+ * is_einvoice_enabled, entity_identifier_scheme, entity_identifier_standard and entity_identifiers[] have been added to the customer resource.
58
+ * einvoice has been added to the invoice resource.
59
+ * einvoice has been added to the credit_notes resource.
60
+ * mime_type has been added to the download resource.
61
+
62
+ #### New Input parameters:
63
+ * entity_identifier_scheme, entity_identifier_standard, is_einvoice_enabled, entity_identifiers[id][0..N], entity_identifiers[scheme][0..N], entity_identifiers[value][0..N], entity_identifiers[standard][0..N] have been added to customers#create_a_customer, customers#update_billing_info_for_a_customer apis.
64
+ * customer[entity_identifier_scheme], customer[entity_identifier_standard], customer[is_einvoice_enabled], entity_identifiers[id][0..N], entity_identifiers[scheme][0..N], entity_identifiers[value][0..N], entity_identifiers[standard][0..N] have been added to the subscriptions#create_a_subscription api.
65
+ * customer[entity_identifier_scheme], customer[entity_identifier_standard], customer[is_einvoice_enabled] have been added to subscriptions#update_a_subscription and subscriptions#update_subscription_for_items apis.
66
+
67
+ #### New Enum values:
68
+ * operation enum has been added.
69
+ * status enum has been added in credit_notes_einvoice subresource of credit_notes resource.
70
+
71
+ #### Deprecated attributes:
72
+ * user, type, payment_method and exchange_rate have been deprecated from TaxWithHeld resource.
73
+
74
+ #### Deprecated enums:
75
+ * type and payment_method have been deprecated in TaxWithHeld resource.
76
+
77
+ #### Updated parameters:
78
+ * hierarchy_operation_type has been made mandatory in customers#get_hierarchy api.
79
+
80
+ #### Removed Filter parameters:
81
+ * create_pending_invoices has been removed from subscriptions#list_subscriptions api.
82
+
83
+
1
84
  ### v2.11.2 (2021-01-05)
2
85
  * * *
3
86
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2011-2021 ChargeBee, Inc.
3
+ Copyright (c) 2011-2022 ChargeBee, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person
6
6
  obtaining a copy of this software and associated documentation
data/Rakefile CHANGED
@@ -1,150 +1,150 @@
1
- require 'rubygems'
2
- require 'rake'
3
- require 'date'
4
-
5
- #############################################################################
6
- #
7
- # Helper functions
8
- #
9
- #############################################################################
10
-
11
- def name
12
- @name ||= Dir['*.gemspec'].first.split('.').first
13
- end
14
-
15
- def version
16
- line = File.read("lib/#{name}.rb")[/^\s*VERSION\s*=\s*.*/]
17
- line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
18
- end
19
-
20
- def date
21
- Date.today.to_s
22
- end
23
-
24
- def rubyforge_project
25
- name
26
- end
27
-
28
- def gemspec_file
29
- "#{name}.gemspec"
30
- end
31
-
32
- def gem_file
33
- "#{name}-#{version}.gem"
34
- end
35
-
36
- def replace_header(head, header_name)
37
- head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
38
- end
39
-
40
- #############################################################################
41
- #
42
- # Standard tasks
43
- #
44
- #############################################################################
45
-
46
- task :default => :test
47
-
48
- require 'rake/testtask'
49
- Rake::TestTask.new(:test) do |test|
50
- test.libs << 'lib' << 'test'
51
- test.pattern = 'test/**/test_*.rb'
52
- test.verbose = true
53
- end
54
-
55
- desc "Generate RCov test coverage and open in your browser"
56
- task :coverage do
57
- require 'rcov'
58
- sh "rm -fr coverage"
59
- sh "rcov test/test_*.rb"
60
- sh "open coverage/index.html"
61
- end
62
-
63
- # require 'rake/rdoctask'
64
- # Rake::RDocTask.new do |rdoc|
65
- # rdoc.rdoc_dir = 'rdoc'
66
- # rdoc.title = "#{name} #{version}"
67
- # rdoc.rdoc_files.include('README*')
68
- # rdoc.rdoc_files.include('lib/**/*.rb')
69
- # end
70
-
71
- desc "Open an irb session preloaded with this library"
72
- task :console do
73
- sh "irb -rubygems -r ./lib/#{name}.rb"
74
- end
75
-
76
- #############################################################################
77
- #
78
- # Custom tasks (add your own tasks here)
79
- #
80
- #############################################################################
81
-
82
-
83
-
84
- #############################################################################
85
- #
86
- # Packaging tasks
87
- #
88
- #############################################################################
89
-
90
- desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
91
- task :release => :build do
92
- unless `git branch` =~ /^\* master$/
93
- puts "You must be on the master branch to release!"
94
- exit!
95
- end
96
- sh "git commit --allow-empty -a -m 'Release #{version}'"
97
- sh "git tag v#{version}"
98
- sh "git push origin master"
99
- sh "git push origin v#{version}"
100
- sh "gem push pkg/#{name}-#{version}.gem"
101
- end
102
-
103
- desc "Build #{gem_file} into the pkg directory"
104
- task :build => :gemspec do
105
- sh "mkdir -p pkg"
106
- sh "gem build #{gemspec_file}"
107
- sh "mv #{gem_file} pkg"
108
- end
109
-
110
- desc "Generate #{gemspec_file}"
111
- task :gemspec => :validate do
112
- # read spec file and split out manifest section
113
- spec = File.read(gemspec_file)
114
- head, manifest, tail = spec.split(" # = MANIFEST =\n")
115
-
116
- # replace name version and date
117
- replace_header(head, :name)
118
- replace_header(head, :version)
119
- replace_header(head, :date)
120
- #comment this out if your rubyforge_project has a different name
121
- replace_header(head, :rubyforge_project)
122
-
123
- # determine file list from git ls-files
124
- files = `git ls-files`.
125
- split("\n").
126
- sort.
127
- reject { |file| file =~ /^\./ }.
128
- reject { |file| file =~ /^(rdoc|pkg)/ }.
129
- map { |file| " #{file}" }.
130
- join("\n")
131
-
132
- # piece file back together and write
133
- manifest = " s.files = %w[\n#{files}\n ]\n"
134
- spec = [head, manifest, tail].join(" # = MANIFEST =\n")
135
- File.open(gemspec_file, 'w') { |io| io.write(spec) }
136
- puts "Updated #{gemspec_file}"
137
- end
138
-
139
- desc "Validate #{gemspec_file}"
140
- task :validate do
141
- libfiles = Dir['lib/*'] - ["lib/#{name}.rb", "lib/#{name}", "lib/ssl"]
142
- unless libfiles.empty?
143
- puts "Directory `lib` should only contain a `#{name}.rb` file, `#{name}` dir and `lib/ssl` dir."
144
- exit!
145
- end
146
- unless Dir['VERSION*'].empty?
147
- puts "A `VERSION` file at root level violates Gem best practices."
148
- exit!
149
- end
150
- end
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'date'
4
+
5
+ #############################################################################
6
+ #
7
+ # Helper functions
8
+ #
9
+ #############################################################################
10
+
11
+ def name
12
+ @name ||= Dir['*.gemspec'].first.split('.').first
13
+ end
14
+
15
+ def version
16
+ line = File.read("lib/#{name}.rb")[/^\s*VERSION\s*=\s*.*/]
17
+ line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
18
+ end
19
+
20
+ def date
21
+ Date.today.to_s
22
+ end
23
+
24
+ def rubyforge_project
25
+ name
26
+ end
27
+
28
+ def gemspec_file
29
+ "#{name}.gemspec"
30
+ end
31
+
32
+ def gem_file
33
+ "#{name}-#{version}.gem"
34
+ end
35
+
36
+ def replace_header(head, header_name)
37
+ head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
38
+ end
39
+
40
+ #############################################################################
41
+ #
42
+ # Standard tasks
43
+ #
44
+ #############################################################################
45
+
46
+ task :default => :test
47
+
48
+ require 'rake/testtask'
49
+ Rake::TestTask.new(:test) do |test|
50
+ test.libs << 'lib' << 'test'
51
+ test.pattern = 'test/**/test_*.rb'
52
+ test.verbose = true
53
+ end
54
+
55
+ desc "Generate RCov test coverage and open in your browser"
56
+ task :coverage do
57
+ require 'rcov'
58
+ sh "rm -fr coverage"
59
+ sh "rcov test/test_*.rb"
60
+ sh "open coverage/index.html"
61
+ end
62
+
63
+ # require 'rake/rdoctask'
64
+ # Rake::RDocTask.new do |rdoc|
65
+ # rdoc.rdoc_dir = 'rdoc'
66
+ # rdoc.title = "#{name} #{version}"
67
+ # rdoc.rdoc_files.include('README*')
68
+ # rdoc.rdoc_files.include('lib/**/*.rb')
69
+ # end
70
+
71
+ desc "Open an irb session preloaded with this library"
72
+ task :console do
73
+ sh "irb -rubygems -r ./lib/#{name}.rb"
74
+ end
75
+
76
+ #############################################################################
77
+ #
78
+ # Custom tasks (add your own tasks here)
79
+ #
80
+ #############################################################################
81
+
82
+
83
+
84
+ #############################################################################
85
+ #
86
+ # Packaging tasks
87
+ #
88
+ #############################################################################
89
+
90
+ desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
91
+ task :release => :build do
92
+ unless `git branch` =~ /^\* master$/
93
+ puts "You must be on the master branch to release!"
94
+ exit!
95
+ end
96
+ sh "git commit --allow-empty -a -m 'Release #{version}'"
97
+ sh "git tag v#{version}"
98
+ sh "git push origin master"
99
+ sh "git push origin v#{version}"
100
+ sh "gem push pkg/#{name}-#{version}.gem"
101
+ end
102
+
103
+ desc "Build #{gem_file} into the pkg directory"
104
+ task :build => :gemspec do
105
+ sh "mkdir -p pkg"
106
+ sh "gem build #{gemspec_file}"
107
+ sh "mv #{gem_file} pkg"
108
+ end
109
+
110
+ desc "Generate #{gemspec_file}"
111
+ task :gemspec => :validate do
112
+ # read spec file and split out manifest section
113
+ spec = File.read(gemspec_file)
114
+ head, manifest, tail = spec.split(" # = MANIFEST =\n")
115
+
116
+ # replace name version and date
117
+ replace_header(head, :name)
118
+ replace_header(head, :version)
119
+ replace_header(head, :date)
120
+ #comment this out if your rubyforge_project has a different name
121
+ replace_header(head, :rubyforge_project)
122
+
123
+ # determine file list from git ls-files
124
+ files = `git ls-files`.
125
+ split("\n").
126
+ sort.
127
+ reject { |file| file =~ /^\./ }.
128
+ reject { |file| file =~ /^(rdoc|pkg)/ }.
129
+ map { |file| " #{file}" }.
130
+ join("\n")
131
+
132
+ # piece file back together and write
133
+ manifest = " s.files = %w[\n#{files}\n ]\n"
134
+ spec = [head, manifest, tail].join(" # = MANIFEST =\n")
135
+ File.open(gemspec_file, 'w') { |io| io.write(spec) }
136
+ puts "Updated #{gemspec_file}"
137
+ end
138
+
139
+ desc "Validate #{gemspec_file}"
140
+ task :validate do
141
+ libfiles = Dir['lib/*'] - ["lib/#{name}.rb", "lib/#{name}", "lib/ssl"]
142
+ unless libfiles.empty?
143
+ puts "Directory `lib` should only contain a `#{name}.rb` file, `#{name}` dir and `lib/ssl` dir."
144
+ exit!
145
+ end
146
+ unless Dir['VERSION*'].empty?
147
+ puts "A `VERSION` file at root level violates Gem best practices."
148
+ exit!
149
+ end
150
+ end
data/chargebee.gemspec CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.5'
5
5
  s.required_ruby_version = '>= 1.9.3'
6
6
  s.name = 'chargebee'
7
- s.version = '2.11.2'
8
- s.date = '2022-01-05'
7
+ s.version = '2.13.1'
8
+ s.date = '2022-03-08'
9
9
  s.summary = "Ruby client for Chargebee API."
10
10
  s.description = "Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com."
11
11
 
@@ -1,28 +1,28 @@
1
- require 'forwardable'
2
-
3
- module ChargeBee
4
- class ListResult
5
- extend Forwardable
6
- include Enumerable
7
-
8
- def_delegator :@list, :each, :each
9
- def_delegator :@list, :length, :length
10
-
11
- attr_reader :next_offset
12
-
13
- def initialize(response, next_offset=nil)
14
- @response = response
15
- @list = Array.new
16
- @next_offset = JSON.parse(next_offset).to_s if next_offset
17
- initItems()
18
- end
19
-
20
- private
21
- def initItems()
22
- @response.each do |item|
23
- @list.push(Result.new(item))
24
- end
25
- end
26
-
27
- end
28
- end
1
+ require 'forwardable'
2
+
3
+ module ChargeBee
4
+ class ListResult
5
+ extend Forwardable
6
+ include Enumerable
7
+
8
+ def_delegator :@list, :each, :each
9
+ def_delegator :@list, :length, :length
10
+
11
+ attr_reader :next_offset
12
+
13
+ def initialize(response, next_offset=nil)
14
+ @response = response
15
+ @list = Array.new
16
+ @next_offset = JSON.parse(next_offset).to_s if next_offset
17
+ initItems()
18
+ end
19
+
20
+ private
21
+ def initItems()
22
+ @response.each do |item|
23
+ @list.push(Result.new(item))
24
+ end
25
+ end
26
+
27
+ end
28
+ end
@@ -1,6 +1,10 @@
1
1
  module ChargeBee
2
2
  class CreditNote < Model
3
3
 
4
+ class Einvoice < Model
5
+ attr_accessor :id, :status, :message
6
+ end
7
+
4
8
  class LineItem < Model
5
9
  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, :description, :entity_description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
6
10
  end
@@ -36,9 +40,9 @@ module ChargeBee
36
40
  attr_accessor :id, :customer_id, :subscription_id, :reference_invoice_id, :type, :reason_code,
37
41
  :status, :vat_number, :date, :price_type, :currency_code, :total, :amount_allocated, :amount_refunded,
38
42
  :amount_available, :refunded_at, :voided_at, :generated_at, :resource_version, :updated_at,
39
- :sub_total, :sub_total_in_local_currency, :total_in_local_currency, :local_currency_code, :round_off_amount,
40
- :fractional_correction, :line_items, :discounts, :line_item_discounts, :line_item_tiers, :taxes,
41
- :line_item_taxes, :linked_refunds, :allocations, :deleted, :create_reason_code, :vat_number_prefix
43
+ :einvoice, :sub_total, :sub_total_in_local_currency, :total_in_local_currency, :local_currency_code,
44
+ :round_off_amount, :fractional_correction, :line_items, :discounts, :line_item_discounts, :line_item_tiers,
45
+ :taxes, :line_item_taxes, :linked_refunds, :allocations, :deleted, :create_reason_code, :vat_number_prefix
42
46
 
43
47
  # OPERATIONS
44
48
  #-----------
@@ -55,6 +59,10 @@ module ChargeBee
55
59
  Request.send('post', uri_path("credit_notes",id.to_s,"pdf"), params, env, headers)
56
60
  end
57
61
 
62
+ def self.download_einvoice(id, env=nil, headers={})
63
+ Request.send('get', uri_path("credit_notes",id.to_s,"download_einvoice"), {}, env, headers)
64
+ end
65
+
58
66
  def self.refund(id, params={}, env=nil, headers={})
59
67
  Request.send('post', uri_path("credit_notes",id.to_s,"refund"), params, env, headers)
60
68
  end
@@ -21,6 +21,10 @@ module ChargeBee
21
21
  attr_accessor :promotional_credits, :excess_payments, :refundable_credits, :unbilled_charges, :currency_code, :balance_currency_code
22
22
  end
23
23
 
24
+ class EntityIdentifier < Model
25
+ attr_accessor :id, :value, :scheme, :standard
26
+ end
27
+
24
28
  class Relationship < Model
25
29
  attr_accessor :parent_id, :payment_owner_id, :invoice_owner_id
26
30
  end
@@ -40,10 +44,10 @@ module ChargeBee
40
44
  :billing_day_of_week, :billing_day_of_week_mode, :pii_cleared, :auto_close_invoices, :card_status,
41
45
  :fraud_flag, :primary_payment_source_id, :backup_payment_source_id, :billing_address, :referral_urls,
42
46
  :contacts, :payment_method, :invoice_notes, :preferred_currency_code, :promotional_credits,
43
- :unbilled_charges, :refundable_credits, :excess_payments, :balances, :meta_data, :deleted, :registered_for_gst,
44
- :consolidated_invoicing, :customer_type, :business_customer_without_vat_number, :client_profile_id,
45
- :relationship, :use_default_hierarchy_settings, :parent_account_access, :child_account_access,
46
- :vat_number_prefix
47
+ :unbilled_charges, :refundable_credits, :excess_payments, :balances, :entity_identifiers, :is_einvoice_enabled,
48
+ :meta_data, :deleted, :registered_for_gst, :consolidated_invoicing, :customer_type, :business_customer_without_vat_number,
49
+ :client_profile_id, :relationship, :use_default_hierarchy_settings, :parent_account_access,
50
+ :child_account_access, :vat_number_prefix, :entity_identifier_scheme, :entity_identifier_standard
47
51
 
48
52
  # OPERATIONS
49
53
  #-----------
@@ -140,7 +144,7 @@ module ChargeBee
140
144
  Request.send('post', uri_path("customers",id.to_s,"delete_relationship"), {}, env, headers)
141
145
  end
142
146
 
143
- def self.hierarchy(id, params={}, env=nil, headers={})
147
+ def self.hierarchy(id, params, env=nil, headers={})
144
148
  Request.send('get', uri_path("customers",id.to_s,"hierarchy"), params, env, headers)
145
149
  end
146
150
 
@@ -1,7 +1,7 @@
1
1
  module ChargeBee
2
2
  class Download < Model
3
3
 
4
- attr_accessor :download_url, :valid_till
4
+ attr_accessor :download_url, :valid_till, :mime_type
5
5
 
6
6
  # OPERATIONS
7
7
  #-----------
@@ -2,7 +2,7 @@ module ChargeBee
2
2
  class Export < Model
3
3
 
4
4
  class Download < Model
5
- attr_accessor :download_url, :valid_till
5
+ attr_accessor :download_url, :valid_till, :mime_type
6
6
  end
7
7
 
8
8
  attr_accessor :id, :operation_type, :mime_type, :status, :created_at, :download
@@ -61,6 +61,10 @@ module ChargeBee
61
61
  attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
62
62
  end
63
63
 
64
+ class Einvoice < Model
65
+ attr_accessor :id, :status, :message
66
+ end
67
+
64
68
  attr_accessor :id, :po_number, :customer_id, :subscription_id, :recurring, :status, :vat_number,
65
69
  :price_type, :date, :due_date, :net_term_days, :exchange_rate, :currency_code, :total, :amount_paid,
66
70
  :amount_adjusted, :write_off_amount, :credits_applied, :amount_due, :paid_at, :dunning_status,
@@ -69,7 +73,8 @@ module ChargeBee
69
73
  :term_finalized, :is_gifted, :generated_at, :expected_payment_date, :amount_to_collect, :round_off_amount,
70
74
  :line_items, :discounts, :line_item_discounts, :taxes, :line_item_taxes, :line_item_tiers, :linked_payments,
71
75
  :dunning_attempts, :applied_credits, :adjustment_credit_notes, :issued_credit_notes, :linked_orders,
72
- :notes, :shipping_address, :billing_address, :payment_owner, :void_reason_code, :deleted, :vat_number_prefix
76
+ :notes, :shipping_address, :billing_address, :einvoice, :payment_owner, :void_reason_code, :deleted,
77
+ :vat_number_prefix
73
78
 
74
79
  # OPERATIONS
75
80
  #-----------
@@ -130,6 +135,10 @@ module ChargeBee
130
135
  Request.send('post', uri_path("invoices",id.to_s,"pdf"), params, env, headers)
131
136
  end
132
137
 
138
+ def self.download_einvoice(id, env=nil, headers={})
139
+ Request.send('get', uri_path("invoices",id.to_s,"download_einvoice"), {}, env, headers)
140
+ end
141
+
133
142
  def self.add_charge(id, params, env=nil, headers={})
134
143
  Request.send('post', uri_path("invoices",id.to_s,"add_charge"), params, env, headers)
135
144
  end
@@ -47,8 +47,8 @@ module ChargeBee
47
47
  elsif(m[0,3] == "cf_") # All the custom fields start with prefix cf_.
48
48
  return nil
49
49
  end
50
- puts "There's no method called #{m} #{args} here -- please try again."
51
- puts @values
50
+ message = "There's no method called #{m} #{args} here -- please try again."
51
+ raise NoMethodError, message
52
52
  end
53
53
 
54
54
  def self.uri_path(*paths)
@@ -13,13 +13,21 @@ module ChargeBee
13
13
  attr_accessor :email, :agreement_id
14
14
  end
15
15
 
16
+ class Upi < Model
17
+ attr_accessor :vpa
18
+ end
19
+
16
20
  class Paypal < Model
17
21
  attr_accessor :email, :agreement_id
18
22
  end
19
23
 
24
+ class Mandate < Model
25
+ attr_accessor :id, :subscription_id, :created_at
26
+ end
27
+
20
28
  attr_accessor :id, :resource_version, :updated_at, :created_at, :customer_id, :type, :reference_id,
21
29
  :status, :gateway, :gateway_account_id, :ip_address, :issuing_country, :card, :bank_account,
22
- :amazon_payment, :paypal, :deleted
30
+ :amazon_payment, :upi, :paypal, :mandates, :deleted
23
31
 
24
32
  # OPERATIONS
25
33
  #-----------
@@ -1,7 +1,8 @@
1
1
  module ChargeBee
2
2
  class TaxWithheld < Model
3
3
 
4
- attr_accessor :id, :reference_number, :description, :date, :currency_code, :amount
4
+ attr_accessor :id, :user, :reference_number, :description, :type, :payment_method, :date, :currency_code,
5
+ :amount, :exchange_rate
5
6
 
6
7
  # OPERATIONS
7
8
  #-----------