chargebee 2.6.2 → 2.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1483 -1473
  3. data/LICENSE +24 -24
  4. data/README.rdoc +41 -41
  5. data/Rakefile +150 -150
  6. data/chargebee.gemspec +2 -2
  7. data/lib/.DS_Store +0 -0
  8. data/lib/chargebee.rb +85 -85
  9. data/lib/chargebee/environment.rb +28 -28
  10. data/lib/chargebee/errors.rb +43 -43
  11. data/lib/chargebee/list_result.rb +28 -28
  12. data/lib/chargebee/models/addon.rb +45 -45
  13. data/lib/chargebee/models/address.rb +18 -18
  14. data/lib/chargebee/models/card.rb +32 -32
  15. data/lib/chargebee/models/comment.rb +25 -25
  16. data/lib/chargebee/models/contact.rb +10 -10
  17. data/lib/chargebee/models/coupon.rb +40 -40
  18. data/lib/chargebee/models/coupon_code.rb +25 -25
  19. data/lib/chargebee/models/coupon_set.rb +37 -37
  20. data/lib/chargebee/models/credit_note.rb +77 -77
  21. data/lib/chargebee/models/credit_note_estimate.rb +35 -35
  22. data/lib/chargebee/models/customer.rb +120 -120
  23. data/lib/chargebee/models/download.rb +9 -9
  24. data/lib/chargebee/models/estimate.rb +46 -46
  25. data/lib/chargebee/models/event.rb +45 -45
  26. data/lib/chargebee/models/export.rb +86 -82
  27. data/lib/chargebee/models/gift.rb +42 -42
  28. data/lib/chargebee/models/hosted_page.rb +77 -73
  29. data/lib/chargebee/models/invoice.rb +172 -172
  30. data/lib/chargebee/models/invoice_estimate.rb +35 -35
  31. data/lib/chargebee/models/model.rb +101 -101
  32. data/lib/chargebee/models/order.rb +76 -76
  33. data/lib/chargebee/models/payment_source.rb +71 -70
  34. data/lib/chargebee/models/plan.rb +59 -59
  35. data/lib/chargebee/models/portal_session.rb +30 -30
  36. data/lib/chargebee/models/promotional_credit.rb +30 -30
  37. data/lib/chargebee/models/quote.rb +72 -72
  38. data/lib/chargebee/models/resource_migration.rb +13 -13
  39. data/lib/chargebee/models/site_migration_detail.rb +14 -14
  40. data/lib/chargebee/models/subscription.rb +137 -137
  41. data/lib/chargebee/models/subscription_estimate.rb +13 -13
  42. data/lib/chargebee/models/third_party_payment_method.rb +9 -9
  43. data/lib/chargebee/models/time_machine.rb +46 -46
  44. data/lib/chargebee/models/transaction.rb +62 -58
  45. data/lib/chargebee/models/unbilled_charge.rb +31 -31
  46. data/lib/chargebee/models/virtual_bank_account.rb +26 -26
  47. data/lib/chargebee/request.rb +27 -27
  48. data/lib/chargebee/rest.rb +92 -90
  49. data/lib/chargebee/result.rb +240 -240
  50. data/lib/chargebee/util.rb +56 -56
  51. data/lib/ssl/ca-certs.crt +3385 -3385
  52. data/spec/chargebee/list_result_spec.rb +53 -53
  53. data/spec/chargebee_spec.rb +99 -99
  54. data/spec/errors_spec.rb +23 -23
  55. data/spec/sample_response.rb +73 -73
  56. data/spec/spec_helper.rb +24 -24
  57. metadata +2 -2
@@ -1,36 +1,36 @@
1
- module ChargeBee
2
- class InvoiceEstimate < Model
3
-
4
- class LineItem < Model
5
- attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :discount_amount, :item_level_discount_amount, :description, :entity_type, :tax_exempt_reason, :entity_id
6
- end
7
-
8
- class Discount < Model
9
- attr_accessor :amount, :description, :entity_type, :entity_id
10
- end
11
-
12
- class Tax < Model
13
- attr_accessor :name, :amount, :description
14
- end
15
-
16
- class LineItemTax < Model
17
- attr_accessor :line_item_id, :tax_name, :tax_rate, :tax_amount, :tax_juris_type, :tax_juris_name, :tax_juris_code
18
- end
19
-
20
- class LineItemTier < Model
21
- attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount
22
- end
23
-
24
- class LineItemDiscount < Model
25
- attr_accessor :line_item_id, :discount_type, :coupon_id, :discount_amount
26
- end
27
-
28
- attr_accessor :recurring, :price_type, :currency_code, :sub_total, :total, :credits_applied,
29
- :amount_paid, :amount_due, :line_items, :discounts, :taxes, :line_item_taxes, :line_item_tiers,
30
- :line_item_discounts, :round_off_amount
31
-
32
- # OPERATIONS
33
- #-----------
34
-
35
- end # ~InvoiceEstimate
1
+ module ChargeBee
2
+ class InvoiceEstimate < Model
3
+
4
+ class LineItem < Model
5
+ attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :discount_amount, :item_level_discount_amount, :description, :entity_type, :tax_exempt_reason, :entity_id
6
+ end
7
+
8
+ class Discount < Model
9
+ attr_accessor :amount, :description, :entity_type, :entity_id
10
+ end
11
+
12
+ class Tax < Model
13
+ attr_accessor :name, :amount, :description
14
+ end
15
+
16
+ class LineItemTax < Model
17
+ attr_accessor :line_item_id, :tax_name, :tax_rate, :tax_amount, :tax_juris_type, :tax_juris_name, :tax_juris_code
18
+ end
19
+
20
+ class LineItemTier < Model
21
+ attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount
22
+ end
23
+
24
+ class LineItemDiscount < Model
25
+ attr_accessor :line_item_id, :discount_type, :coupon_id, :discount_amount
26
+ end
27
+
28
+ attr_accessor :recurring, :price_type, :currency_code, :sub_total, :total, :credits_applied,
29
+ :amount_paid, :amount_due, :line_items, :discounts, :taxes, :line_item_taxes, :line_item_tiers,
30
+ :line_item_discounts, :round_off_amount
31
+
32
+ # OPERATIONS
33
+ #-----------
34
+
35
+ end # ~InvoiceEstimate
36
36
  end # ~ChargeBee
@@ -1,101 +1,101 @@
1
- require 'uri'
2
-
3
- module ChargeBee
4
- class Model
5
-
6
- def initialize(values, sub_types={}, dependant_types={})
7
- @values = values
8
- @sub_types = sub_types
9
- @dependant_types = dependant_types
10
- end
11
-
12
- def to_s(*args)
13
- JSON.pretty_generate(@values)
14
- end
15
-
16
- def inspect()
17
- "#<#{self.class}:0x#{self.object_id.to_s(16)} > JSON: " + JSON.pretty_generate(@values)
18
- end
19
-
20
- def load(values)
21
- instance_eval do
22
- values.each do |k, v|
23
- set_val = nil
24
- case v
25
- when Hash && (@dependant_types[k] != nil)
26
- next
27
- when Hash
28
- set_val = (@sub_types[k] != nil) ? @sub_types[k].construct(v) : v
29
- when Array
30
- if(@sub_types[k] != nil)
31
- set_val = v.map { |item| @sub_types[k].construct(item)}
32
- else
33
- set_val = v
34
- end
35
- else
36
- set_val = v
37
- end
38
- instance_variable_set("@#{k}", set_val)
39
- end
40
- end
41
- end
42
-
43
- def method_missing(m, *args, &block)
44
- if(@values.has_key?(m))
45
- return @values[m]
46
- elsif(m[0,3] == "cf_") # All the custom fields start with prefix cf_.
47
- return nil
48
- end
49
- puts "There's no method called #{m} #{args} here -- please try again."
50
- puts @values
51
- end
52
-
53
- def self.uri_path(*paths)
54
- url = ""
55
- for path in paths
56
- if(path.nil? || path.strip.length < 1)
57
- raise "Id is empty or nil"
58
- end
59
- url = "#{url}/#{URI.encode(path.strip)}"
60
- end
61
- return url
62
- end
63
-
64
- def self.construct(values, sub_types = {}, dependant_types = {})
65
- if(values != nil)
66
- obj = self.new(values, sub_types, dependant_types)
67
- obj.load(values)
68
- obj
69
- end
70
- end
71
-
72
- def init_dependant(obj, type, sub_types = {})
73
- instance_eval do
74
- if(obj[type] != nil)
75
- case obj
76
- when Hash
77
- if(@dependant_types[type] != nil)
78
- dependant_obj = @dependant_types[type].construct(obj[type], sub_types)
79
- instance_variable_set("@#{type}", dependant_obj)
80
- end
81
- end
82
- end
83
- end
84
- end
85
-
86
- def init_dependant_list(obj, type, sub_types = {})
87
- instance_eval do
88
- if(obj[type] != nil)
89
- case obj[type]
90
- when Array
91
- if(@dependant_types[type] != nil)
92
- set_val = obj[type].map {|dt| @dependant_types[type].construct(dt, sub_types)}
93
- instance_variable_set("@#{type}", set_val)
94
- end
95
- end
96
- end
97
- end
98
- end
99
-
100
- end
101
- end
1
+ require 'uri'
2
+
3
+ module ChargeBee
4
+ class Model
5
+
6
+ def initialize(values, sub_types={}, dependant_types={})
7
+ @values = values
8
+ @sub_types = sub_types
9
+ @dependant_types = dependant_types
10
+ end
11
+
12
+ def to_s(*args)
13
+ JSON.pretty_generate(@values)
14
+ end
15
+
16
+ def inspect()
17
+ "#<#{self.class}:0x#{self.object_id.to_s(16)} > JSON: " + JSON.pretty_generate(@values)
18
+ end
19
+
20
+ def load(values)
21
+ instance_eval do
22
+ values.each do |k, v|
23
+ set_val = nil
24
+ case v
25
+ when Hash && (@dependant_types[k] != nil)
26
+ next
27
+ when Hash
28
+ set_val = (@sub_types[k] != nil) ? @sub_types[k].construct(v) : v
29
+ when Array
30
+ if(@sub_types[k] != nil)
31
+ set_val = v.map { |item| @sub_types[k].construct(item)}
32
+ else
33
+ set_val = v
34
+ end
35
+ else
36
+ set_val = v
37
+ end
38
+ instance_variable_set("@#{k}", set_val)
39
+ end
40
+ end
41
+ end
42
+
43
+ def method_missing(m, *args, &block)
44
+ if(@values.has_key?(m))
45
+ return @values[m]
46
+ elsif(m[0,3] == "cf_") # All the custom fields start with prefix cf_.
47
+ return nil
48
+ end
49
+ puts "There's no method called #{m} #{args} here -- please try again."
50
+ puts @values
51
+ end
52
+
53
+ def self.uri_path(*paths)
54
+ url = ""
55
+ for path in paths
56
+ if(path.nil? || path.strip.length < 1)
57
+ raise "Id is empty or nil"
58
+ end
59
+ url = "#{url}/#{URI.encode(path.strip)}"
60
+ end
61
+ return url
62
+ end
63
+
64
+ def self.construct(values, sub_types = {}, dependant_types = {})
65
+ if(values != nil)
66
+ obj = self.new(values, sub_types, dependant_types)
67
+ obj.load(values)
68
+ obj
69
+ end
70
+ end
71
+
72
+ def init_dependant(obj, type, sub_types = {})
73
+ instance_eval do
74
+ if(obj[type] != nil)
75
+ case obj
76
+ when Hash
77
+ if(@dependant_types[type] != nil)
78
+ dependant_obj = @dependant_types[type].construct(obj[type], sub_types)
79
+ instance_variable_set("@#{type}", dependant_obj)
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
85
+
86
+ def init_dependant_list(obj, type, sub_types = {})
87
+ instance_eval do
88
+ if(obj[type] != nil)
89
+ case obj[type]
90
+ when Array
91
+ if(@dependant_types[type] != nil)
92
+ set_val = obj[type].map {|dt| @dependant_types[type].construct(dt, sub_types)}
93
+ instance_variable_set("@#{type}", set_val)
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
99
+
100
+ end
101
+ end
@@ -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, :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,71 +1,72 @@
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, :customer_id, :type, :reference_id, :status, :gateway, :gateway_account_id,
21
- :ip_address, :issuing_country, :card, :bank_account, :amazon_payment, :paypal, :deleted
22
-
23
- # OPERATIONS
24
- #-----------
25
-
26
- def self.create_using_temp_token(params, env=nil, headers={})
27
- Request.send('post', uri_path("payment_sources","create_using_temp_token"), params, env, headers)
28
- end
29
-
30
- def self.create_using_permanent_token(params, env=nil, headers={})
31
- Request.send('post', uri_path("payment_sources","create_using_permanent_token"), params, env, headers)
32
- end
33
-
34
- def self.create_card(params, env=nil, headers={})
35
- Request.send('post', uri_path("payment_sources","create_card"), params, env, headers)
36
- end
37
-
38
- def self.create_bank_account(params, env=nil, headers={})
39
- Request.send('post', uri_path("payment_sources","create_bank_account"), params, env, headers)
40
- end
41
-
42
- def self.update_card(id, params={}, env=nil, headers={})
43
- Request.send('post', uri_path("payment_sources",id.to_s,"update_card"), params, env, headers)
44
- end
45
-
46
- def self.verify_bank_account(id, params, env=nil, headers={})
47
- Request.send('post', uri_path("payment_sources",id.to_s,"verify_bank_account"), params, env, headers)
48
- end
49
-
50
- def self.retrieve(id, env=nil, headers={})
51
- Request.send('get', uri_path("payment_sources",id.to_s), {}, env, headers)
52
- end
53
-
54
- def self.list(params={}, env=nil, headers={})
55
- Request.send_list_request('get', uri_path("payment_sources"), params, env, headers)
56
- end
57
-
58
- def self.switch_gateway_account(id, params, env=nil, headers={})
59
- Request.send('post', uri_path("payment_sources",id.to_s,"switch_gateway_account"), params, env, headers)
60
- end
61
-
62
- def self.export_payment_source(id, params, env=nil, headers={})
63
- Request.send('post', uri_path("payment_sources",id.to_s,"export_payment_source"), params, env, headers)
64
- end
65
-
66
- def self.delete(id, env=nil, headers={})
67
- Request.send('post', uri_path("payment_sources",id.to_s,"delete"), {}, env, headers)
68
- end
69
-
70
- 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
+ end # ~PaymentSource
71
72
  end # ~ChargeBee