chargebee 1.7.4 → 2.6.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1107 -94
- data/LICENSE +1 -1
- data/README.rdoc +22 -15
- data/chargebee.gemspec +27 -7
- data/lib/.DS_Store +0 -0
- data/lib/chargebee.rb +28 -2
- data/lib/chargebee/environment.rb +11 -6
- data/lib/chargebee/errors.rb +1 -1
- data/lib/chargebee/models/addon.rb +18 -3
- data/lib/chargebee/models/address.rb +1 -1
- data/lib/chargebee/models/card.rb +8 -7
- data/lib/chargebee/models/comment.rb +1 -1
- data/lib/chargebee/models/contact.rb +11 -0
- data/lib/chargebee/models/coupon.rb +20 -4
- data/lib/chargebee/models/coupon_code.rb +9 -1
- data/lib/chargebee/models/coupon_set.rb +38 -0
- data/lib/chargebee/models/credit_note.rb +78 -0
- data/lib/chargebee/models/credit_note_estimate.rb +36 -0
- data/lib/chargebee/models/customer.rb +73 -12
- data/lib/chargebee/models/estimate.rb +26 -15
- data/lib/chargebee/models/event.rb +1 -1
- data/lib/chargebee/models/export.rb +87 -0
- data/lib/chargebee/models/gift.rb +43 -0
- data/lib/chargebee/models/hierarchy.rb +10 -0
- data/lib/chargebee/models/hosted_page.rb +33 -5
- data/lib/chargebee/models/invoice.rb +82 -19
- data/lib/chargebee/models/invoice_estimate.rb +36 -0
- data/lib/chargebee/models/model.rb +34 -3
- data/lib/chargebee/models/order.rb +49 -3
- data/lib/chargebee/models/payment_source.rb +84 -0
- data/lib/chargebee/models/plan.rb +33 -5
- data/lib/chargebee/models/promotional_credit.rb +31 -0
- data/lib/chargebee/models/quote.rb +77 -0
- data/lib/chargebee/models/resource_migration.rb +14 -0
- data/lib/chargebee/models/site_migration_detail.rb +15 -0
- data/lib/chargebee/models/subscription.rb +60 -8
- data/lib/chargebee/models/subscription_estimate.rb +14 -0
- data/lib/chargebee/models/third_party_payment_method.rb +10 -0
- data/lib/chargebee/models/time_machine.rb +47 -0
- data/lib/chargebee/models/token.rb +11 -0
- data/lib/chargebee/models/transaction.rb +29 -10
- data/lib/chargebee/models/unbilled_charge.rb +32 -0
- data/lib/chargebee/models/virtual_bank_account.rb +32 -0
- data/lib/chargebee/request.rb +11 -0
- data/lib/chargebee/rest.rb +6 -4
- data/lib/chargebee/result.rb +183 -27
- data/spec/errors_spec.rb +23 -0
- data/spec/sample_response.rb +1 -1
- metadata +39 -11
- data/lib/chargebee/models/payment_intent.rb +0 -27
@@ -1,10 +1,30 @@
|
|
1
1
|
module ChargeBee
|
2
2
|
class Plan < Model
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
class Tier < Model
|
5
|
+
attr_accessor :starting_unit, :ending_unit, :price
|
6
|
+
end
|
7
|
+
|
8
|
+
class ApplicableAddon < Model
|
9
|
+
attr_accessor :id
|
10
|
+
end
|
11
|
+
|
12
|
+
class AttachedAddon < Model
|
13
|
+
attr_accessor :id, :quantity, :billing_cycles, :type
|
14
|
+
end
|
15
|
+
|
16
|
+
class EventBasedAddon < Model
|
17
|
+
attr_accessor :id, :quantity, :on_event, :charge_once
|
18
|
+
end
|
19
|
+
|
20
|
+
attr_accessor :id, :name, :invoice_name, :description, :price, :currency_code, :period, :period_unit,
|
21
|
+
:trial_period, :trial_period_unit, :pricing_model, :charge_model, :free_quantity, :setup_cost,
|
22
|
+
:downgrade_penalty, :status, :archived_at, :billing_cycles, :redirect_url, :enabled_in_hosted_pages,
|
23
|
+
:enabled_in_portal, :addon_applicability, :tax_code, :avalara_sale_type, :avalara_transaction_type,
|
24
|
+
:avalara_service_type, :sku, :accounting_code, :accounting_category1, :accounting_category2,
|
25
|
+
:is_shippable, :shipping_frequency_period, :shipping_frequency_period_unit, :resource_version,
|
26
|
+
:updated_at, :giftable, :claim_url, :invoice_notes, :taxable, :tax_profile_id, :meta_data, :tiers,
|
27
|
+
:applicable_addons, :attached_addons, :event_based_addons
|
8
28
|
|
9
29
|
# OPERATIONS
|
10
30
|
#-----------
|
@@ -18,7 +38,7 @@ module ChargeBee
|
|
18
38
|
end
|
19
39
|
|
20
40
|
def self.list(params={}, env=nil, headers={})
|
21
|
-
Request.
|
41
|
+
Request.send_list_request('get', uri_path("plans"), params, env, headers)
|
22
42
|
end
|
23
43
|
|
24
44
|
def self.retrieve(id, env=nil, headers={})
|
@@ -29,5 +49,13 @@ module ChargeBee
|
|
29
49
|
Request.send('post', uri_path("plans",id.to_s,"delete"), {}, env, headers)
|
30
50
|
end
|
31
51
|
|
52
|
+
def self.copy(params, env=nil, headers={})
|
53
|
+
Request.send('post', uri_path("plans","copy"), params, env, headers)
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.unarchive(id, env=nil, headers={})
|
57
|
+
Request.send('post', uri_path("plans",id.to_s,"unarchive"), {}, env, headers)
|
58
|
+
end
|
59
|
+
|
32
60
|
end # ~Plan
|
33
61
|
end # ~ChargeBee
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module ChargeBee
|
2
|
+
class PromotionalCredit < Model
|
3
|
+
|
4
|
+
attr_accessor :id, :customer_id, :type, :amount, :currency_code, :description, :credit_type,
|
5
|
+
:reference, :closing_balance, :done_by, :created_at
|
6
|
+
|
7
|
+
# OPERATIONS
|
8
|
+
#-----------
|
9
|
+
|
10
|
+
def self.add(params, env=nil, headers={})
|
11
|
+
Request.send('post', uri_path("promotional_credits","add"), params, env, headers)
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.deduct(params, env=nil, headers={})
|
15
|
+
Request.send('post', uri_path("promotional_credits","deduct"), params, env, headers)
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.set(params, env=nil, headers={})
|
19
|
+
Request.send('post', uri_path("promotional_credits","set"), params, env, headers)
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.list(params={}, env=nil, headers={})
|
23
|
+
Request.send_list_request('get', uri_path("promotional_credits"), params, env, headers)
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.retrieve(id, env=nil, headers={})
|
27
|
+
Request.send('get', uri_path("promotional_credits",id.to_s), {}, env, headers)
|
28
|
+
end
|
29
|
+
|
30
|
+
end # ~PromotionalCredit
|
31
|
+
end # ~ChargeBee
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module ChargeBee
|
2
|
+
class Quote < 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, :customer_id
|
6
|
+
end
|
7
|
+
|
8
|
+
class Discount < Model
|
9
|
+
attr_accessor :amount, :description, :entity_type, :entity_id
|
10
|
+
end
|
11
|
+
|
12
|
+
class LineItemDiscount < Model
|
13
|
+
attr_accessor :line_item_id, :discount_type, :coupon_id, :discount_amount
|
14
|
+
end
|
15
|
+
|
16
|
+
class Tax < Model
|
17
|
+
attr_accessor :name, :amount, :description
|
18
|
+
end
|
19
|
+
|
20
|
+
class LineItemTax < Model
|
21
|
+
attr_accessor :line_item_id, :tax_name, :tax_rate, :is_partial_tax_applied, :is_non_compliance_tax, :taxable_amount, :tax_amount, :tax_juris_type, :tax_juris_name, :tax_juris_code
|
22
|
+
end
|
23
|
+
|
24
|
+
class ShippingAddress < Model
|
25
|
+
attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
|
26
|
+
end
|
27
|
+
|
28
|
+
class BillingAddress < Model
|
29
|
+
attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
|
30
|
+
end
|
31
|
+
|
32
|
+
attr_accessor :id, :po_number, :customer_id, :subscription_id, :status, :operation_type, :vat_number,
|
33
|
+
:price_type, :valid_till, :date, :sub_total, :total, :credits_applied, :amount_paid, :amount_due,
|
34
|
+
:resource_version, :updated_at, :currency_code, :line_items, :discounts, :line_item_discounts,
|
35
|
+
:taxes, :line_item_taxes, :shipping_address, :billing_address
|
36
|
+
|
37
|
+
# OPERATIONS
|
38
|
+
#-----------
|
39
|
+
|
40
|
+
def self.retrieve(id, env=nil, headers={})
|
41
|
+
Request.send('get', uri_path("quotes",id.to_s), {}, env, headers)
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.create_sub_for_customer_quote(id, params, env=nil, headers={})
|
45
|
+
Request.send('post', uri_path("customers",id.to_s,"create_subscription_quote"), params, env, headers)
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.update_subscription_quote(params, env=nil, headers={})
|
49
|
+
Request.send('post', uri_path("quotes","update_subscription_quote"), params, env, headers)
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.create_for_onetime_charges(params, env=nil, headers={})
|
53
|
+
Request.send('post', uri_path("quotes","create_for_onetime_charges"), params, env, headers)
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.list(params={}, env=nil, headers={})
|
57
|
+
Request.send_list_request('get', uri_path("quotes"), params, env, headers)
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.convert(id, env=nil, headers={})
|
61
|
+
Request.send('post', uri_path("quotes",id.to_s,"convert"), {}, env, headers)
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.update_status(id, params, env=nil, headers={})
|
65
|
+
Request.send('post', uri_path("quotes",id.to_s,"update_status"), params, env, headers)
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.delete(id, params={}, env=nil, headers={})
|
69
|
+
Request.send('post', uri_path("quotes",id.to_s,"delete"), params, env, headers)
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.pdf(id, params={}, env=nil, headers={})
|
73
|
+
Request.send('post', uri_path("quotes",id.to_s,"pdf"), params, env, headers)
|
74
|
+
end
|
75
|
+
|
76
|
+
end # ~Quote
|
77
|
+
end # ~ChargeBee
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module ChargeBee
|
2
|
+
class ResourceMigration < Model
|
3
|
+
|
4
|
+
attr_accessor :from_site, :entity_type, :entity_id, :status, :errors, :created_at, :updated_at
|
5
|
+
|
6
|
+
# OPERATIONS
|
7
|
+
#-----------
|
8
|
+
|
9
|
+
def self.retrieve_latest(params, env=nil, headers={})
|
10
|
+
Request.send('get', uri_path("resource_migrations","retrieve_latest"), params, env, headers)
|
11
|
+
end
|
12
|
+
|
13
|
+
end # ~ResourceMigration
|
14
|
+
end # ~ChargeBee
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module ChargeBee
|
2
|
+
class SiteMigrationDetail < Model
|
3
|
+
|
4
|
+
attr_accessor :entity_id, :other_site_name, :entity_id_at_other_site, :migrated_at, :entity_type,
|
5
|
+
:status
|
6
|
+
|
7
|
+
# OPERATIONS
|
8
|
+
#-----------
|
9
|
+
|
10
|
+
def self.list(params={}, env=nil, headers={})
|
11
|
+
Request.send_list_request('get', uri_path("site_migration_details"), params, env, headers)
|
12
|
+
end
|
13
|
+
|
14
|
+
end # ~SiteMigrationDetail
|
15
|
+
end # ~ChargeBee
|
@@ -2,7 +2,15 @@ module ChargeBee
|
|
2
2
|
class Subscription < Model
|
3
3
|
|
4
4
|
class Addon < Model
|
5
|
-
attr_accessor :id, :quantity
|
5
|
+
attr_accessor :id, :quantity, :unit_price, :amount, :trial_end, :remaining_billing_cycles
|
6
|
+
end
|
7
|
+
|
8
|
+
class EventBasedAddon < Model
|
9
|
+
attr_accessor :id, :quantity, :unit_price, :service_period_in_days, :on_event, :charge_once
|
10
|
+
end
|
11
|
+
|
12
|
+
class ChargedEventBasedAddon < Model
|
13
|
+
attr_accessor :id, :last_charged_at
|
6
14
|
end
|
7
15
|
|
8
16
|
class Coupon < Model
|
@@ -10,14 +18,22 @@ module ChargeBee
|
|
10
18
|
end
|
11
19
|
|
12
20
|
class ShippingAddress < Model
|
13
|
-
attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip
|
21
|
+
attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
|
22
|
+
end
|
23
|
+
|
24
|
+
class ReferralInfo < Model
|
25
|
+
attr_accessor :referral_code, :coupon_code, :referrer_id, :external_reference_id, :reward_status, :referral_system, :account_id, :campaign_id, :external_campaign_id, :friend_offer_type, :referrer_reward_type, :notify_referral_system, :destination_url, :post_purchase_widget_enabled
|
14
26
|
end
|
15
27
|
|
16
|
-
attr_accessor :id, :
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
28
|
+
attr_accessor :id, :customer_id, :currency_code, :plan_id, :plan_quantity, :plan_unit_price,
|
29
|
+
:setup_fee, :plan_amount, :billing_period, :billing_period_unit, :plan_free_quantity, :status,
|
30
|
+
:start_date, :trial_start, :trial_end, :current_term_start, :current_term_end, :next_billing_at,
|
31
|
+
:remaining_billing_cycles, :po_number, :created_at, :started_at, :activated_at, :gift_id, :override_relationship,
|
32
|
+
:pause_date, :resume_date, :cancelled_at, :cancel_reason, :affiliate_token, :created_from_ip,
|
33
|
+
:resource_version, :updated_at, :has_scheduled_changes, :payment_source_id, :auto_collection,
|
34
|
+
:due_invoices_count, :due_since, :total_dues, :mrr, :exchange_rate, :base_currency_code, :addons,
|
35
|
+
:event_based_addons, :charged_event_based_addons, :coupon, :coupons, :shipping_address, :referral_info,
|
36
|
+
:invoice_notes, :meta_data, :deleted
|
21
37
|
|
22
38
|
# OPERATIONS
|
23
39
|
#-----------
|
@@ -31,7 +47,7 @@ module ChargeBee
|
|
31
47
|
end
|
32
48
|
|
33
49
|
def self.list(params={}, env=nil, headers={})
|
34
|
-
Request.
|
50
|
+
Request.send_list_request('get', uri_path("subscriptions"), params, env, headers)
|
35
51
|
end
|
36
52
|
|
37
53
|
def self.subscriptions_for_customer(id, params={}, env=nil, headers={})
|
@@ -54,6 +70,10 @@ module ChargeBee
|
|
54
70
|
Request.send('post', uri_path("subscriptions",id.to_s,"remove_scheduled_cancellation"), params, env, headers)
|
55
71
|
end
|
56
72
|
|
73
|
+
def self.remove_coupons(id, params={}, env=nil, headers={})
|
74
|
+
Request.send('post', uri_path("subscriptions",id.to_s,"remove_coupons"), params, env, headers)
|
75
|
+
end
|
76
|
+
|
57
77
|
def self.update(id, params={}, env=nil, headers={})
|
58
78
|
Request.send('post', uri_path("subscriptions",id.to_s), params, env, headers)
|
59
79
|
end
|
@@ -78,9 +98,41 @@ module ChargeBee
|
|
78
98
|
Request.send('post', uri_path("subscriptions",id.to_s,"charge_addon_at_term_end"), params, env, headers)
|
79
99
|
end
|
80
100
|
|
101
|
+
def self.charge_future_renewals(id, params={}, env=nil, headers={})
|
102
|
+
Request.send('post', uri_path("subscriptions",id.to_s,"charge_future_renewals"), params, env, headers)
|
103
|
+
end
|
104
|
+
|
105
|
+
def self.import_subscription(params, env=nil, headers={})
|
106
|
+
Request.send('post', uri_path("subscriptions","import_subscription"), params, env, headers)
|
107
|
+
end
|
108
|
+
|
109
|
+
def self.import_for_customer(id, params, env=nil, headers={})
|
110
|
+
Request.send('post', uri_path("customers",id.to_s,"import_subscription"), params, env, headers)
|
111
|
+
end
|
112
|
+
|
113
|
+
def self.override_billing_profile(id, params={}, env=nil, headers={})
|
114
|
+
Request.send('post', uri_path("subscriptions",id.to_s,"override_billing_profile"), params, env, headers)
|
115
|
+
end
|
116
|
+
|
81
117
|
def self.delete(id, env=nil, headers={})
|
82
118
|
Request.send('post', uri_path("subscriptions",id.to_s,"delete"), {}, env, headers)
|
83
119
|
end
|
84
120
|
|
121
|
+
def self.pause(id, params={}, env=nil, headers={})
|
122
|
+
Request.send('post', uri_path("subscriptions",id.to_s,"pause"), params, env, headers)
|
123
|
+
end
|
124
|
+
|
125
|
+
def self.resume(id, params={}, env=nil, headers={})
|
126
|
+
Request.send('post', uri_path("subscriptions",id.to_s,"resume"), params, env, headers)
|
127
|
+
end
|
128
|
+
|
129
|
+
def self.remove_scheduled_pause(id, env=nil, headers={})
|
130
|
+
Request.send('post', uri_path("subscriptions",id.to_s,"remove_scheduled_pause"), {}, env, headers)
|
131
|
+
end
|
132
|
+
|
133
|
+
def self.remove_scheduled_resumption(id, env=nil, headers={})
|
134
|
+
Request.send('post', uri_path("subscriptions",id.to_s,"remove_scheduled_resumption"), {}, env, headers)
|
135
|
+
end
|
136
|
+
|
85
137
|
end # ~Subscription
|
86
138
|
end # ~ChargeBee
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module ChargeBee
|
2
|
+
class SubscriptionEstimate < Model
|
3
|
+
|
4
|
+
class ShippingAddress < Model
|
5
|
+
attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
|
6
|
+
end
|
7
|
+
|
8
|
+
attr_accessor :id, :currency_code, :status, :next_billing_at, :pause_date, :resume_date, :shipping_address
|
9
|
+
|
10
|
+
# OPERATIONS
|
11
|
+
#-----------
|
12
|
+
|
13
|
+
end # ~SubscriptionEstimate
|
14
|
+
end # ~ChargeBee
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module ChargeBee
|
2
|
+
class TimeMachine < Model
|
3
|
+
|
4
|
+
attr_accessor :name, :time_travel_status, :genesis_time, :destination_time, :failure_code, :failure_reason,
|
5
|
+
:error_json
|
6
|
+
def wait_for_time_travel_completion(env = nil)
|
7
|
+
env = env || ChargeBee.default_env
|
8
|
+
sleeptime = env.time_machine_sleeptime
|
9
|
+
|
10
|
+
tm = (1..30).inject(self) do |time_machine|
|
11
|
+
break time_machine if time_machine.time_travel_status != "in_progress"
|
12
|
+
sleep(sleeptime)
|
13
|
+
self.class.retrieve(self.name, env).time_machine
|
14
|
+
end
|
15
|
+
|
16
|
+
# sync last fetched one with the current instance
|
17
|
+
new_values = tm.instance_variable_get("@values")
|
18
|
+
self.instance_variable_set("@values", new_values)
|
19
|
+
self.load(new_values)
|
20
|
+
|
21
|
+
case tm.time_travel_status
|
22
|
+
when "in_progress"
|
23
|
+
raise Error.new('The time travel is taking too much time')
|
24
|
+
when "failed"
|
25
|
+
json_obj = Util.symbolize_keys(JSON.parse(self.error_json))
|
26
|
+
raise OperationFailedError.new(json_obj[:http_code], json_obj)
|
27
|
+
when "not_enabled", "_unknown"
|
28
|
+
raise Error.new("Time travel status is in wrong state #{self.time_travel_status}")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
# OPERATIONS
|
32
|
+
#-----------
|
33
|
+
|
34
|
+
def self.retrieve(id, env=nil, headers={})
|
35
|
+
Request.send('get', uri_path("time_machines",id.to_s), {}, env, headers)
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.start_afresh(id, params={}, env=nil, headers={})
|
39
|
+
Request.send('post', uri_path("time_machines",id.to_s,"start_afresh"), params, env, headers)
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.travel_forward(id, params={}, env=nil, headers={})
|
43
|
+
Request.send('post', uri_path("time_machines",id.to_s,"travel_forward"), params, env, headers)
|
44
|
+
end
|
45
|
+
|
46
|
+
end # ~TimeMachine
|
47
|
+
end # ~ChargeBee
|
@@ -2,23 +2,42 @@ module ChargeBee
|
|
2
2
|
class Transaction < Model
|
3
3
|
|
4
4
|
class LinkedInvoice < Model
|
5
|
-
attr_accessor :invoice_id, :applied_amount, :applied_at, :invoice_date, :
|
5
|
+
attr_accessor :invoice_id, :applied_amount, :applied_at, :invoice_date, :invoice_total, :invoice_status
|
6
|
+
end
|
7
|
+
|
8
|
+
class LinkedCreditNote < Model
|
9
|
+
attr_accessor :cn_id, :applied_amount, :applied_at, :cn_reason_code, :cn_date, :cn_total, :cn_status, :cn_reference_invoice_id
|
6
10
|
end
|
7
11
|
|
8
12
|
class LinkedRefund < Model
|
9
13
|
attr_accessor :txn_id, :txn_status, :txn_date, :txn_amount
|
10
14
|
end
|
11
15
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
class LinkedPayment < Model
|
17
|
+
attr_accessor :id, :status, :amount, :date
|
18
|
+
end
|
19
|
+
|
20
|
+
attr_accessor :id, :customer_id, :subscription_id, :gateway_account_id, :payment_source_id,
|
21
|
+
:payment_method, :reference_number, :gateway, :type, :date, :settled_at, :currency_code, :amount,
|
22
|
+
:id_at_gateway, :status, :fraud_flag, :initiator_type, :three_d_secure, :authorization_reason,
|
23
|
+
:error_code, :error_text, :voided_at, :resource_version, :updated_at, :fraud_reason, :amount_unused,
|
24
|
+
:masked_card_number, :reference_transaction_id, :refunded_txn_id, :reference_authorization_id,
|
25
|
+
:amount_capturable, :reversal_transaction_id, :linked_invoices, :linked_credit_notes, :linked_refunds,
|
26
|
+
:linked_payments, :deleted
|
16
27
|
|
17
28
|
# OPERATIONS
|
18
29
|
#-----------
|
19
30
|
|
31
|
+
def self.create_authorization(params, env=nil, headers={})
|
32
|
+
Request.send('post', uri_path("transactions","create_authorization"), params, env, headers)
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.void_transaction(id, env=nil, headers={})
|
36
|
+
Request.send('post', uri_path("transactions",id.to_s,"void"), {}, env, headers)
|
37
|
+
end
|
38
|
+
|
20
39
|
def self.list(params={}, env=nil, headers={})
|
21
|
-
Request.
|
40
|
+
Request.send_list_request('get', uri_path("transactions"), params, env, headers)
|
22
41
|
end
|
23
42
|
|
24
43
|
def self.transactions_for_customer(id, params={}, env=nil, headers={})
|
@@ -29,16 +48,16 @@ module ChargeBee
|
|
29
48
|
Request.send('get', uri_path("subscriptions",id.to_s,"transactions"), params, env, headers)
|
30
49
|
end
|
31
50
|
|
32
|
-
def self.
|
33
|
-
Request.send('get', uri_path("invoices",id.to_s,"
|
51
|
+
def self.payments_for_invoice(id, params={}, env=nil, headers={})
|
52
|
+
Request.send('get', uri_path("invoices",id.to_s,"payments"), params, env, headers)
|
34
53
|
end
|
35
54
|
|
36
55
|
def self.retrieve(id, env=nil, headers={})
|
37
56
|
Request.send('get', uri_path("transactions",id.to_s), {}, env, headers)
|
38
57
|
end
|
39
58
|
|
40
|
-
def self.
|
41
|
-
Request.send('post', uri_path("
|
59
|
+
def self.delete_offline_transaction(id, params={}, env=nil, headers={})
|
60
|
+
Request.send('post', uri_path("transactions",id.to_s,"delete_offline_transaction"), params, env, headers)
|
42
61
|
end
|
43
62
|
|
44
63
|
end # ~Transaction
|