dodopayments 2.0.0 → 2.1.1
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 +17 -0
- data/README.md +3 -3
- data/lib/dodopayments/models/addon_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/addon_update_images_params.rb +7 -1
- data/lib/dodopayments/models/addon_update_params.rb +8 -1
- data/lib/dodopayments/models/brand_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/brand_update_images_params.rb +7 -1
- data/lib/dodopayments/models/brand_update_params.rb +8 -1
- data/lib/dodopayments/models/checkout_session_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/credit_entitlement_delete_params.rb +7 -1
- data/lib/dodopayments/models/credit_entitlement_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/credit_entitlement_undelete_params.rb +7 -1
- data/lib/dodopayments/models/credit_entitlement_update_params.rb +8 -1
- data/lib/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rb +8 -1
- data/lib/dodopayments/models/credit_entitlements/balance_list_grants_params.rb +8 -1
- data/lib/dodopayments/models/credit_entitlements/balance_list_ledger_params.rb +8 -1
- data/lib/dodopayments/models/credit_entitlements/balance_list_params.rb +8 -1
- data/lib/dodopayments/models/credit_entitlements/balance_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/customer_list_credit_entitlements_params.rb +7 -1
- data/lib/dodopayments/models/customer_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/customer_retrieve_payment_methods_params.rb +7 -1
- data/lib/dodopayments/models/customer_update_params.rb +8 -1
- data/lib/dodopayments/models/customers/customer_portal_create_params.rb +8 -1
- data/lib/dodopayments/models/customers/wallet_list_params.rb +7 -1
- data/lib/dodopayments/models/customers/wallets/ledger_entry_create_params.rb +8 -1
- data/lib/dodopayments/models/customers/wallets/ledger_entry_list_params.rb +8 -1
- data/lib/dodopayments/models/discount.rb +10 -1
- data/lib/dodopayments/models/discount_create_params.rb +10 -1
- data/lib/dodopayments/models/discount_delete_params.rb +7 -1
- data/lib/dodopayments/models/discount_retrieve_by_code_params.rb +7 -1
- data/lib/dodopayments/models/discount_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/discount_update_params.rb +17 -1
- data/lib/dodopayments/models/dispute_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/invoices/payment_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/invoices/payment_retrieve_refund_params.rb +7 -1
- data/lib/dodopayments/models/license_key_instance_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/license_key_instance_update_params.rb +7 -1
- data/lib/dodopayments/models/license_key_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/license_key_update_params.rb +8 -1
- data/lib/dodopayments/models/meter_archive_params.rb +7 -1
- data/lib/dodopayments/models/meter_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/meter_unarchive_params.rb +7 -1
- data/lib/dodopayments/models/payment_retrieve_line_items_params.rb +7 -1
- data/lib/dodopayments/models/payment_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/product_archive_params.rb +7 -1
- data/lib/dodopayments/models/product_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/product_unarchive_params.rb +7 -1
- data/lib/dodopayments/models/product_update_files_params.rb +7 -1
- data/lib/dodopayments/models/product_update_params.rb +8 -1
- data/lib/dodopayments/models/products/image_update_params.rb +7 -1
- data/lib/dodopayments/models/products/short_link_create_params.rb +8 -1
- data/lib/dodopayments/models/refund_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/subscription_change_plan_params.rb +7 -1
- data/lib/dodopayments/models/subscription_charge_params.rb +8 -1
- data/lib/dodopayments/models/subscription_preview_change_plan_params.rb +7 -1
- data/lib/dodopayments/models/subscription_retrieve_credit_usage_params.rb +7 -1
- data/lib/dodopayments/models/subscription_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/subscription_retrieve_usage_history_params.rb +8 -1
- data/lib/dodopayments/models/subscription_update_params.rb +8 -1
- data/lib/dodopayments/models/subscription_update_payment_method_params.rb +68 -20
- data/lib/dodopayments/models/update_subscription_plan_req.rb +12 -1
- data/lib/dodopayments/models/usage_event_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/webhook_delete_params.rb +7 -1
- data/lib/dodopayments/models/webhook_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/webhook_retrieve_secret_params.rb +7 -1
- data/lib/dodopayments/models/webhook_update_params.rb +8 -1
- data/lib/dodopayments/models/webhooks/header_retrieve_params.rb +7 -1
- data/lib/dodopayments/models/webhooks/header_update_params.rb +8 -1
- data/lib/dodopayments/resources/discounts.rb +6 -2
- data/lib/dodopayments/resources/subscriptions.rb +9 -9
- data/lib/dodopayments/version.rb +1 -1
- data/rbi/dodopayments/models/addon_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/addon_update_images_params.rbi +11 -5
- data/rbi/dodopayments/models/addon_update_params.rbi +6 -0
- data/rbi/dodopayments/models/brand_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/brand_update_images_params.rbi +11 -5
- data/rbi/dodopayments/models/brand_update_params.rbi +6 -0
- data/rbi/dodopayments/models/checkout_session_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/credit_entitlement_delete_params.rbi +11 -5
- data/rbi/dodopayments/models/credit_entitlement_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/credit_entitlement_undelete_params.rbi +11 -5
- data/rbi/dodopayments/models/credit_entitlement_update_params.rbi +6 -0
- data/rbi/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rbi +6 -0
- data/rbi/dodopayments/models/credit_entitlements/balance_list_grants_params.rbi +6 -0
- data/rbi/dodopayments/models/credit_entitlements/balance_list_ledger_params.rbi +6 -0
- data/rbi/dodopayments/models/credit_entitlements/balance_list_params.rbi +6 -0
- data/rbi/dodopayments/models/credit_entitlements/balance_retrieve_params.rbi +6 -1
- data/rbi/dodopayments/models/customer_list_credit_entitlements_params.rbi +11 -5
- data/rbi/dodopayments/models/customer_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/customer_retrieve_payment_methods_params.rbi +11 -5
- data/rbi/dodopayments/models/customer_update_params.rbi +6 -0
- data/rbi/dodopayments/models/customers/customer_portal_create_params.rbi +6 -0
- data/rbi/dodopayments/models/customers/wallet_list_params.rbi +14 -5
- data/rbi/dodopayments/models/customers/wallets/ledger_entry_create_params.rbi +6 -0
- data/rbi/dodopayments/models/customers/wallets/ledger_entry_list_params.rbi +6 -0
- data/rbi/dodopayments/models/discount.rbi +10 -0
- data/rbi/dodopayments/models/discount_create_params.rbi +13 -0
- data/rbi/dodopayments/models/discount_delete_params.rbi +11 -5
- data/rbi/dodopayments/models/discount_retrieve_by_code_params.rbi +11 -5
- data/rbi/dodopayments/models/discount_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/discount_update_params.rbi +16 -0
- data/rbi/dodopayments/models/dispute_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/invoices/payment_retrieve_params.rbi +14 -5
- data/rbi/dodopayments/models/invoices/payment_retrieve_refund_params.rbi +11 -5
- data/rbi/dodopayments/models/license_key_instance_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/license_key_instance_update_params.rbi +10 -2
- data/rbi/dodopayments/models/license_key_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/license_key_update_params.rbi +6 -0
- data/rbi/dodopayments/models/meter_archive_params.rbi +11 -5
- data/rbi/dodopayments/models/meter_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/meter_unarchive_params.rbi +11 -5
- data/rbi/dodopayments/models/payment_retrieve_line_items_params.rbi +11 -5
- data/rbi/dodopayments/models/payment_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/product_archive_params.rbi +11 -5
- data/rbi/dodopayments/models/product_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/product_unarchive_params.rbi +11 -5
- data/rbi/dodopayments/models/product_update_files_params.rbi +10 -2
- data/rbi/dodopayments/models/product_update_params.rbi +6 -0
- data/rbi/dodopayments/models/products/image_update_params.rbi +6 -1
- data/rbi/dodopayments/models/products/short_link_create_params.rbi +6 -0
- data/rbi/dodopayments/models/refund_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/subscription_change_plan_params.rbi +14 -5
- data/rbi/dodopayments/models/subscription_charge_params.rbi +6 -0
- data/rbi/dodopayments/models/subscription_preview_change_plan_params.rbi +14 -5
- data/rbi/dodopayments/models/subscription_retrieve_credit_usage_params.rbi +14 -5
- data/rbi/dodopayments/models/subscription_retrieve_params.rbi +14 -5
- data/rbi/dodopayments/models/subscription_retrieve_usage_history_params.rbi +6 -0
- data/rbi/dodopayments/models/subscription_update_params.rbi +6 -0
- data/rbi/dodopayments/models/subscription_update_payment_method_params.rbi +170 -36
- data/rbi/dodopayments/models/update_subscription_plan_req.rbi +14 -0
- data/rbi/dodopayments/models/usage_event_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/webhook_delete_params.rbi +11 -5
- data/rbi/dodopayments/models/webhook_retrieve_params.rbi +11 -5
- data/rbi/dodopayments/models/webhook_retrieve_secret_params.rbi +11 -5
- data/rbi/dodopayments/models/webhook_update_params.rbi +6 -0
- data/rbi/dodopayments/models/webhooks/header_retrieve_params.rbi +14 -5
- data/rbi/dodopayments/models/webhooks/header_update_params.rbi +6 -0
- data/rbi/dodopayments/resources/discounts.rbi +8 -0
- data/rbi/dodopayments/resources/subscriptions.rbi +18 -7
- data/sig/dodopayments/models/addon_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/addon_update_images_params.rbs +11 -3
- data/sig/dodopayments/models/addon_update_params.rbs +5 -0
- data/sig/dodopayments/models/brand_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/brand_update_images_params.rbs +11 -3
- data/sig/dodopayments/models/brand_update_params.rbs +5 -0
- data/sig/dodopayments/models/checkout_session_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/credit_entitlement_delete_params.rbs +11 -3
- data/sig/dodopayments/models/credit_entitlement_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/credit_entitlement_undelete_params.rbs +11 -3
- data/sig/dodopayments/models/credit_entitlement_update_params.rbs +5 -0
- data/sig/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rbs +5 -0
- data/sig/dodopayments/models/credit_entitlements/balance_list_grants_params.rbs +5 -0
- data/sig/dodopayments/models/credit_entitlements/balance_list_ledger_params.rbs +5 -0
- data/sig/dodopayments/models/credit_entitlements/balance_list_params.rbs +10 -1
- data/sig/dodopayments/models/credit_entitlements/balance_retrieve_params.rbs +5 -1
- data/sig/dodopayments/models/customer_list_credit_entitlements_params.rbs +11 -3
- data/sig/dodopayments/models/customer_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/customer_retrieve_payment_methods_params.rbs +11 -3
- data/sig/dodopayments/models/customer_update_params.rbs +5 -0
- data/sig/dodopayments/models/customers/customer_portal_create_params.rbs +6 -1
- data/sig/dodopayments/models/customers/wallet_list_params.rbs +12 -3
- data/sig/dodopayments/models/customers/wallets/ledger_entry_create_params.rbs +5 -0
- data/sig/dodopayments/models/customers/wallets/ledger_entry_list_params.rbs +5 -0
- data/sig/dodopayments/models/discount.rbs +5 -0
- data/sig/dodopayments/models/discount_create_params.rbs +7 -0
- data/sig/dodopayments/models/discount_delete_params.rbs +11 -3
- data/sig/dodopayments/models/discount_retrieve_by_code_params.rbs +11 -3
- data/sig/dodopayments/models/discount_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/discount_update_params.rbs +10 -0
- data/sig/dodopayments/models/dispute_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/invoices/payment_retrieve_params.rbs +12 -3
- data/sig/dodopayments/models/invoices/payment_retrieve_refund_params.rbs +11 -3
- data/sig/dodopayments/models/license_key_instance_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/license_key_instance_update_params.rbs +6 -1
- data/sig/dodopayments/models/license_key_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/license_key_update_params.rbs +10 -1
- data/sig/dodopayments/models/meter_archive_params.rbs +11 -3
- data/sig/dodopayments/models/meter_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/meter_unarchive_params.rbs +11 -3
- data/sig/dodopayments/models/payment_retrieve_line_items_params.rbs +11 -3
- data/sig/dodopayments/models/payment_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/product_archive_params.rbs +11 -3
- data/sig/dodopayments/models/product_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/product_unarchive_params.rbs +11 -3
- data/sig/dodopayments/models/product_update_files_params.rbs +6 -1
- data/sig/dodopayments/models/product_update_params.rbs +5 -0
- data/sig/dodopayments/models/products/image_update_params.rbs +5 -1
- data/sig/dodopayments/models/products/short_link_create_params.rbs +9 -1
- data/sig/dodopayments/models/refund_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/subscription_change_plan_params.rbs +14 -3
- data/sig/dodopayments/models/subscription_charge_params.rbs +5 -0
- data/sig/dodopayments/models/subscription_preview_change_plan_params.rbs +14 -3
- data/sig/dodopayments/models/subscription_retrieve_credit_usage_params.rbs +12 -3
- data/sig/dodopayments/models/subscription_retrieve_params.rbs +12 -3
- data/sig/dodopayments/models/subscription_retrieve_usage_history_params.rbs +5 -0
- data/sig/dodopayments/models/subscription_update_params.rbs +5 -0
- data/sig/dodopayments/models/subscription_update_payment_method_params.rbs +77 -18
- data/sig/dodopayments/models/update_subscription_plan_req.rbs +5 -0
- data/sig/dodopayments/models/usage_event_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/webhook_delete_params.rbs +11 -3
- data/sig/dodopayments/models/webhook_retrieve_params.rbs +11 -3
- data/sig/dodopayments/models/webhook_retrieve_secret_params.rbs +11 -3
- data/sig/dodopayments/models/webhook_update_params.rbs +5 -0
- data/sig/dodopayments/models/webhooks/header_retrieve_params.rbs +12 -3
- data/sig/dodopayments/models/webhooks/header_update_params.rbs +5 -1
- data/sig/dodopayments/resources/discounts.rbs +2 -0
- data/sig/dodopayments/resources/subscriptions.rbs +3 -3
- metadata +2 -2
|
@@ -14,6 +14,9 @@ module Dodopayments
|
|
|
14
14
|
)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
17
20
|
# Currency for pricing
|
|
18
21
|
sig { returns(T.nilable(Dodopayments::Currency::OrSymbol)) }
|
|
19
22
|
attr_accessor :currency
|
|
@@ -72,6 +75,7 @@ module Dodopayments
|
|
|
72
75
|
|
|
73
76
|
sig do
|
|
74
77
|
params(
|
|
78
|
+
id: String,
|
|
75
79
|
currency: T.nilable(Dodopayments::Currency::OrSymbol),
|
|
76
80
|
description: T.nilable(String),
|
|
77
81
|
expires_after_days: T.nilable(Integer),
|
|
@@ -92,6 +96,7 @@ module Dodopayments
|
|
|
92
96
|
).returns(T.attached_class)
|
|
93
97
|
end
|
|
94
98
|
def self.new(
|
|
99
|
+
id:,
|
|
95
100
|
# Currency for pricing
|
|
96
101
|
currency: nil,
|
|
97
102
|
# Optional description of the credit entitlement
|
|
@@ -127,6 +132,7 @@ module Dodopayments
|
|
|
127
132
|
sig do
|
|
128
133
|
override.returns(
|
|
129
134
|
{
|
|
135
|
+
id: String,
|
|
130
136
|
currency: T.nilable(Dodopayments::Currency::OrSymbol),
|
|
131
137
|
description: T.nilable(String),
|
|
132
138
|
expires_after_days: T.nilable(Integer),
|
|
@@ -18,6 +18,9 @@ module Dodopayments
|
|
|
18
18
|
sig { returns(String) }
|
|
19
19
|
attr_accessor :credit_entitlement_id
|
|
20
20
|
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :customer_id
|
|
23
|
+
|
|
21
24
|
# Amount to credit or debit
|
|
22
25
|
sig { returns(String) }
|
|
23
26
|
attr_accessor :amount
|
|
@@ -48,6 +51,7 @@ module Dodopayments
|
|
|
48
51
|
sig do
|
|
49
52
|
params(
|
|
50
53
|
credit_entitlement_id: String,
|
|
54
|
+
customer_id: String,
|
|
51
55
|
amount: String,
|
|
52
56
|
entry_type:
|
|
53
57
|
Dodopayments::CreditEntitlements::LedgerEntryType::OrSymbol,
|
|
@@ -60,6 +64,7 @@ module Dodopayments
|
|
|
60
64
|
end
|
|
61
65
|
def self.new(
|
|
62
66
|
credit_entitlement_id:,
|
|
67
|
+
customer_id:,
|
|
63
68
|
# Amount to credit or debit
|
|
64
69
|
amount:,
|
|
65
70
|
# Entry type: credit or debit
|
|
@@ -81,6 +86,7 @@ module Dodopayments
|
|
|
81
86
|
override.returns(
|
|
82
87
|
{
|
|
83
88
|
credit_entitlement_id: String,
|
|
89
|
+
customer_id: String,
|
|
84
90
|
amount: String,
|
|
85
91
|
entry_type:
|
|
86
92
|
Dodopayments::CreditEntitlements::LedgerEntryType::OrSymbol,
|
|
@@ -18,6 +18,9 @@ module Dodopayments
|
|
|
18
18
|
sig { returns(String) }
|
|
19
19
|
attr_accessor :credit_entitlement_id
|
|
20
20
|
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :customer_id
|
|
23
|
+
|
|
21
24
|
# Page number default is 0
|
|
22
25
|
sig { returns(T.nilable(Integer)) }
|
|
23
26
|
attr_reader :page_number
|
|
@@ -53,6 +56,7 @@ module Dodopayments
|
|
|
53
56
|
sig do
|
|
54
57
|
params(
|
|
55
58
|
credit_entitlement_id: String,
|
|
59
|
+
customer_id: String,
|
|
56
60
|
page_number: Integer,
|
|
57
61
|
page_size: Integer,
|
|
58
62
|
status:
|
|
@@ -62,6 +66,7 @@ module Dodopayments
|
|
|
62
66
|
end
|
|
63
67
|
def self.new(
|
|
64
68
|
credit_entitlement_id:,
|
|
69
|
+
customer_id:,
|
|
65
70
|
# Page number default is 0
|
|
66
71
|
page_number: nil,
|
|
67
72
|
# Page size default is 10 max is 100
|
|
@@ -76,6 +81,7 @@ module Dodopayments
|
|
|
76
81
|
override.returns(
|
|
77
82
|
{
|
|
78
83
|
credit_entitlement_id: String,
|
|
84
|
+
customer_id: String,
|
|
79
85
|
page_number: Integer,
|
|
80
86
|
page_size: Integer,
|
|
81
87
|
status:
|
|
@@ -18,6 +18,9 @@ module Dodopayments
|
|
|
18
18
|
sig { returns(String) }
|
|
19
19
|
attr_accessor :credit_entitlement_id
|
|
20
20
|
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :customer_id
|
|
23
|
+
|
|
21
24
|
# Filter by end date
|
|
22
25
|
sig { returns(T.nilable(Time)) }
|
|
23
26
|
attr_reader :end_date
|
|
@@ -57,6 +60,7 @@ module Dodopayments
|
|
|
57
60
|
sig do
|
|
58
61
|
params(
|
|
59
62
|
credit_entitlement_id: String,
|
|
63
|
+
customer_id: String,
|
|
60
64
|
end_date: Time,
|
|
61
65
|
page_number: Integer,
|
|
62
66
|
page_size: Integer,
|
|
@@ -67,6 +71,7 @@ module Dodopayments
|
|
|
67
71
|
end
|
|
68
72
|
def self.new(
|
|
69
73
|
credit_entitlement_id:,
|
|
74
|
+
customer_id:,
|
|
70
75
|
# Filter by end date
|
|
71
76
|
end_date: nil,
|
|
72
77
|
# Page number default is 0
|
|
@@ -86,6 +91,7 @@ module Dodopayments
|
|
|
86
91
|
override.returns(
|
|
87
92
|
{
|
|
88
93
|
credit_entitlement_id: String,
|
|
94
|
+
customer_id: String,
|
|
89
95
|
end_date: Time,
|
|
90
96
|
page_number: Integer,
|
|
91
97
|
page_size: Integer,
|
|
@@ -15,6 +15,9 @@ module Dodopayments
|
|
|
15
15
|
)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :credit_entitlement_id
|
|
20
|
+
|
|
18
21
|
# Filter by specific customer ID
|
|
19
22
|
sig { returns(T.nilable(String)) }
|
|
20
23
|
attr_reader :customer_id
|
|
@@ -38,6 +41,7 @@ module Dodopayments
|
|
|
38
41
|
|
|
39
42
|
sig do
|
|
40
43
|
params(
|
|
44
|
+
credit_entitlement_id: String,
|
|
41
45
|
customer_id: String,
|
|
42
46
|
page_number: Integer,
|
|
43
47
|
page_size: Integer,
|
|
@@ -45,6 +49,7 @@ module Dodopayments
|
|
|
45
49
|
).returns(T.attached_class)
|
|
46
50
|
end
|
|
47
51
|
def self.new(
|
|
52
|
+
credit_entitlement_id:,
|
|
48
53
|
# Filter by specific customer ID
|
|
49
54
|
customer_id: nil,
|
|
50
55
|
# Page number default is 0
|
|
@@ -58,6 +63,7 @@ module Dodopayments
|
|
|
58
63
|
sig do
|
|
59
64
|
override.returns(
|
|
60
65
|
{
|
|
66
|
+
credit_entitlement_id: String,
|
|
61
67
|
customer_id: String,
|
|
62
68
|
page_number: Integer,
|
|
63
69
|
page_size: Integer,
|
|
@@ -18,19 +18,24 @@ module Dodopayments
|
|
|
18
18
|
sig { returns(String) }
|
|
19
19
|
attr_accessor :credit_entitlement_id
|
|
20
20
|
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :customer_id
|
|
23
|
+
|
|
21
24
|
sig do
|
|
22
25
|
params(
|
|
23
26
|
credit_entitlement_id: String,
|
|
27
|
+
customer_id: String,
|
|
24
28
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
25
29
|
).returns(T.attached_class)
|
|
26
30
|
end
|
|
27
|
-
def self.new(credit_entitlement_id:, request_options: {})
|
|
31
|
+
def self.new(credit_entitlement_id:, customer_id:, request_options: {})
|
|
28
32
|
end
|
|
29
33
|
|
|
30
34
|
sig do
|
|
31
35
|
override.returns(
|
|
32
36
|
{
|
|
33
37
|
credit_entitlement_id: String,
|
|
38
|
+
customer_id: String,
|
|
34
39
|
request_options: Dodopayments::RequestOptions
|
|
35
40
|
}
|
|
36
41
|
)
|
|
@@ -14,16 +14,22 @@ module Dodopayments
|
|
|
14
14
|
)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :customer_id
|
|
19
|
+
|
|
17
20
|
sig do
|
|
18
|
-
params(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
params(
|
|
22
|
+
customer_id: String,
|
|
23
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
24
|
+
).returns(T.attached_class)
|
|
21
25
|
end
|
|
22
|
-
def self.new(request_options: {})
|
|
26
|
+
def self.new(customer_id:, request_options: {})
|
|
23
27
|
end
|
|
24
28
|
|
|
25
29
|
sig do
|
|
26
|
-
override.returns(
|
|
30
|
+
override.returns(
|
|
31
|
+
{ customer_id: String, request_options: Dodopayments::RequestOptions }
|
|
32
|
+
)
|
|
27
33
|
end
|
|
28
34
|
def to_hash
|
|
29
35
|
end
|
|
@@ -14,16 +14,22 @@ module Dodopayments
|
|
|
14
14
|
)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :customer_id
|
|
19
|
+
|
|
17
20
|
sig do
|
|
18
|
-
params(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
params(
|
|
22
|
+
customer_id: String,
|
|
23
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
24
|
+
).returns(T.attached_class)
|
|
21
25
|
end
|
|
22
|
-
def self.new(request_options: {})
|
|
26
|
+
def self.new(customer_id:, request_options: {})
|
|
23
27
|
end
|
|
24
28
|
|
|
25
29
|
sig do
|
|
26
|
-
override.returns(
|
|
30
|
+
override.returns(
|
|
31
|
+
{ customer_id: String, request_options: Dodopayments::RequestOptions }
|
|
32
|
+
)
|
|
27
33
|
end
|
|
28
34
|
def to_hash
|
|
29
35
|
end
|
|
@@ -14,16 +14,22 @@ module Dodopayments
|
|
|
14
14
|
)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :customer_id
|
|
19
|
+
|
|
17
20
|
sig do
|
|
18
|
-
params(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
params(
|
|
22
|
+
customer_id: String,
|
|
23
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
24
|
+
).returns(T.attached_class)
|
|
21
25
|
end
|
|
22
|
-
def self.new(request_options: {})
|
|
26
|
+
def self.new(customer_id:, request_options: {})
|
|
23
27
|
end
|
|
24
28
|
|
|
25
29
|
sig do
|
|
26
|
-
override.returns(
|
|
30
|
+
override.returns(
|
|
31
|
+
{ customer_id: String, request_options: Dodopayments::RequestOptions }
|
|
32
|
+
)
|
|
27
33
|
end
|
|
28
34
|
def to_hash
|
|
29
35
|
end
|
|
@@ -14,6 +14,9 @@ module Dodopayments
|
|
|
14
14
|
)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :customer_id
|
|
19
|
+
|
|
17
20
|
sig { returns(T.nilable(String)) }
|
|
18
21
|
attr_accessor :email
|
|
19
22
|
|
|
@@ -29,6 +32,7 @@ module Dodopayments
|
|
|
29
32
|
|
|
30
33
|
sig do
|
|
31
34
|
params(
|
|
35
|
+
customer_id: String,
|
|
32
36
|
email: T.nilable(String),
|
|
33
37
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
34
38
|
name: T.nilable(String),
|
|
@@ -37,6 +41,7 @@ module Dodopayments
|
|
|
37
41
|
).returns(T.attached_class)
|
|
38
42
|
end
|
|
39
43
|
def self.new(
|
|
44
|
+
customer_id:,
|
|
40
45
|
email: nil,
|
|
41
46
|
# Additional metadata for the customer
|
|
42
47
|
metadata: nil,
|
|
@@ -49,6 +54,7 @@ module Dodopayments
|
|
|
49
54
|
sig do
|
|
50
55
|
override.returns(
|
|
51
56
|
{
|
|
57
|
+
customer_id: String,
|
|
52
58
|
email: T.nilable(String),
|
|
53
59
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
54
60
|
name: T.nilable(String),
|
|
@@ -15,6 +15,9 @@ module Dodopayments
|
|
|
15
15
|
)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :customer_id
|
|
20
|
+
|
|
18
21
|
# If true, will send link to user.
|
|
19
22
|
sig { returns(T.nilable(T::Boolean)) }
|
|
20
23
|
attr_reader :send_email
|
|
@@ -24,11 +27,13 @@ module Dodopayments
|
|
|
24
27
|
|
|
25
28
|
sig do
|
|
26
29
|
params(
|
|
30
|
+
customer_id: String,
|
|
27
31
|
send_email: T::Boolean,
|
|
28
32
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
29
33
|
).returns(T.attached_class)
|
|
30
34
|
end
|
|
31
35
|
def self.new(
|
|
36
|
+
customer_id:,
|
|
32
37
|
# If true, will send link to user.
|
|
33
38
|
send_email: nil,
|
|
34
39
|
request_options: {}
|
|
@@ -38,6 +43,7 @@ module Dodopayments
|
|
|
38
43
|
sig do
|
|
39
44
|
override.returns(
|
|
40
45
|
{
|
|
46
|
+
customer_id: String,
|
|
41
47
|
send_email: T::Boolean,
|
|
42
48
|
request_options: Dodopayments::RequestOptions
|
|
43
49
|
}
|
|
@@ -15,16 +15,25 @@ module Dodopayments
|
|
|
15
15
|
)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :customer_id
|
|
20
|
+
|
|
18
21
|
sig do
|
|
19
|
-
params(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
params(
|
|
23
|
+
customer_id: String,
|
|
24
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
25
|
+
).returns(T.attached_class)
|
|
22
26
|
end
|
|
23
|
-
def self.new(request_options: {})
|
|
27
|
+
def self.new(customer_id:, request_options: {})
|
|
24
28
|
end
|
|
25
29
|
|
|
26
30
|
sig do
|
|
27
|
-
override.returns(
|
|
31
|
+
override.returns(
|
|
32
|
+
{
|
|
33
|
+
customer_id: String,
|
|
34
|
+
request_options: Dodopayments::RequestOptions
|
|
35
|
+
}
|
|
36
|
+
)
|
|
28
37
|
end
|
|
29
38
|
def to_hash
|
|
30
39
|
end
|
|
@@ -16,6 +16,9 @@ module Dodopayments
|
|
|
16
16
|
)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :customer_id
|
|
21
|
+
|
|
19
22
|
sig { returns(Integer) }
|
|
20
23
|
attr_accessor :amount
|
|
21
24
|
|
|
@@ -40,6 +43,7 @@ module Dodopayments
|
|
|
40
43
|
|
|
41
44
|
sig do
|
|
42
45
|
params(
|
|
46
|
+
customer_id: String,
|
|
43
47
|
amount: Integer,
|
|
44
48
|
currency: Dodopayments::Currency::OrSymbol,
|
|
45
49
|
entry_type:
|
|
@@ -50,6 +54,7 @@ module Dodopayments
|
|
|
50
54
|
).returns(T.attached_class)
|
|
51
55
|
end
|
|
52
56
|
def self.new(
|
|
57
|
+
customer_id:,
|
|
53
58
|
amount:,
|
|
54
59
|
# Currency of the wallet to adjust
|
|
55
60
|
currency:,
|
|
@@ -65,6 +70,7 @@ module Dodopayments
|
|
|
65
70
|
sig do
|
|
66
71
|
override.returns(
|
|
67
72
|
{
|
|
73
|
+
customer_id: String,
|
|
68
74
|
amount: Integer,
|
|
69
75
|
currency: Dodopayments::Currency::OrSymbol,
|
|
70
76
|
entry_type:
|
|
@@ -16,6 +16,9 @@ module Dodopayments
|
|
|
16
16
|
)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :customer_id
|
|
21
|
+
|
|
19
22
|
# Optional currency filter
|
|
20
23
|
sig { returns(T.nilable(Dodopayments::Currency::OrSymbol)) }
|
|
21
24
|
attr_reader :currency
|
|
@@ -37,6 +40,7 @@ module Dodopayments
|
|
|
37
40
|
|
|
38
41
|
sig do
|
|
39
42
|
params(
|
|
43
|
+
customer_id: String,
|
|
40
44
|
currency: Dodopayments::Currency::OrSymbol,
|
|
41
45
|
page_number: Integer,
|
|
42
46
|
page_size: Integer,
|
|
@@ -44,6 +48,7 @@ module Dodopayments
|
|
|
44
48
|
).returns(T.attached_class)
|
|
45
49
|
end
|
|
46
50
|
def self.new(
|
|
51
|
+
customer_id:,
|
|
47
52
|
# Optional currency filter
|
|
48
53
|
currency: nil,
|
|
49
54
|
page_number: nil,
|
|
@@ -55,6 +60,7 @@ module Dodopayments
|
|
|
55
60
|
sig do
|
|
56
61
|
override.returns(
|
|
57
62
|
{
|
|
63
|
+
customer_id: String,
|
|
58
64
|
currency: Dodopayments::Currency::OrSymbol,
|
|
59
65
|
page_number: Integer,
|
|
60
66
|
page_size: Integer,
|
|
@@ -32,6 +32,11 @@ module Dodopayments
|
|
|
32
32
|
sig { returns(String) }
|
|
33
33
|
attr_accessor :discount_id
|
|
34
34
|
|
|
35
|
+
# Whether this discount should be preserved when a subscription changes plans.
|
|
36
|
+
# Default: false (discount is removed on plan change)
|
|
37
|
+
sig { returns(T::Boolean) }
|
|
38
|
+
attr_accessor :preserve_on_plan_change
|
|
39
|
+
|
|
35
40
|
# List of product IDs to which this discount is restricted.
|
|
36
41
|
sig { returns(T::Array[String]) }
|
|
37
42
|
attr_accessor :restricted_to
|
|
@@ -69,6 +74,7 @@ module Dodopayments
|
|
|
69
74
|
code: String,
|
|
70
75
|
created_at: Time,
|
|
71
76
|
discount_id: String,
|
|
77
|
+
preserve_on_plan_change: T::Boolean,
|
|
72
78
|
restricted_to: T::Array[String],
|
|
73
79
|
times_used: Integer,
|
|
74
80
|
type: Dodopayments::DiscountType::OrSymbol,
|
|
@@ -93,6 +99,9 @@ module Dodopayments
|
|
|
93
99
|
created_at:,
|
|
94
100
|
# The unique discount ID
|
|
95
101
|
discount_id:,
|
|
102
|
+
# Whether this discount should be preserved when a subscription changes plans.
|
|
103
|
+
# Default: false (discount is removed on plan change)
|
|
104
|
+
preserve_on_plan_change:,
|
|
96
105
|
# List of product IDs to which this discount is restricted.
|
|
97
106
|
restricted_to:,
|
|
98
107
|
# How many times this discount has been used.
|
|
@@ -120,6 +129,7 @@ module Dodopayments
|
|
|
120
129
|
code: String,
|
|
121
130
|
created_at: Time,
|
|
122
131
|
discount_id: String,
|
|
132
|
+
preserve_on_plan_change: T::Boolean,
|
|
123
133
|
restricted_to: T::Array[String],
|
|
124
134
|
times_used: Integer,
|
|
125
135
|
type: Dodopayments::DiscountType::TaggedSymbol,
|
|
@@ -43,6 +43,14 @@ module Dodopayments
|
|
|
43
43
|
sig { returns(T.nilable(String)) }
|
|
44
44
|
attr_accessor :name
|
|
45
45
|
|
|
46
|
+
# Whether this discount should be preserved when a subscription changes plans.
|
|
47
|
+
# Default: false (discount is removed on plan change)
|
|
48
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
49
|
+
attr_reader :preserve_on_plan_change
|
|
50
|
+
|
|
51
|
+
sig { params(preserve_on_plan_change: T::Boolean).void }
|
|
52
|
+
attr_writer :preserve_on_plan_change
|
|
53
|
+
|
|
46
54
|
# List of product IDs to restrict usage (if any).
|
|
47
55
|
sig { returns(T.nilable(T::Array[String])) }
|
|
48
56
|
attr_accessor :restricted_to
|
|
@@ -64,6 +72,7 @@ module Dodopayments
|
|
|
64
72
|
code: T.nilable(String),
|
|
65
73
|
expires_at: T.nilable(Time),
|
|
66
74
|
name: T.nilable(String),
|
|
75
|
+
preserve_on_plan_change: T::Boolean,
|
|
67
76
|
restricted_to: T.nilable(T::Array[String]),
|
|
68
77
|
subscription_cycles: T.nilable(Integer),
|
|
69
78
|
usage_limit: T.nilable(Integer),
|
|
@@ -90,6 +99,9 @@ module Dodopayments
|
|
|
90
99
|
# When the discount expires, if ever.
|
|
91
100
|
expires_at: nil,
|
|
92
101
|
name: nil,
|
|
102
|
+
# Whether this discount should be preserved when a subscription changes plans.
|
|
103
|
+
# Default: false (discount is removed on plan change)
|
|
104
|
+
preserve_on_plan_change: nil,
|
|
93
105
|
# List of product IDs to restrict usage (if any).
|
|
94
106
|
restricted_to: nil,
|
|
95
107
|
# Number of subscription billing cycles this discount is valid for. If not
|
|
@@ -110,6 +122,7 @@ module Dodopayments
|
|
|
110
122
|
code: T.nilable(String),
|
|
111
123
|
expires_at: T.nilable(Time),
|
|
112
124
|
name: T.nilable(String),
|
|
125
|
+
preserve_on_plan_change: T::Boolean,
|
|
113
126
|
restricted_to: T.nilable(T::Array[String]),
|
|
114
127
|
subscription_cycles: T.nilable(Integer),
|
|
115
128
|
usage_limit: T.nilable(Integer),
|
|
@@ -14,16 +14,22 @@ module Dodopayments
|
|
|
14
14
|
)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :discount_id
|
|
19
|
+
|
|
17
20
|
sig do
|
|
18
|
-
params(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
params(
|
|
22
|
+
discount_id: String,
|
|
23
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
24
|
+
).returns(T.attached_class)
|
|
21
25
|
end
|
|
22
|
-
def self.new(request_options: {})
|
|
26
|
+
def self.new(discount_id:, request_options: {})
|
|
23
27
|
end
|
|
24
28
|
|
|
25
29
|
sig do
|
|
26
|
-
override.returns(
|
|
30
|
+
override.returns(
|
|
31
|
+
{ discount_id: String, request_options: Dodopayments::RequestOptions }
|
|
32
|
+
)
|
|
27
33
|
end
|
|
28
34
|
def to_hash
|
|
29
35
|
end
|
|
@@ -14,16 +14,22 @@ module Dodopayments
|
|
|
14
14
|
)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :code
|
|
19
|
+
|
|
17
20
|
sig do
|
|
18
|
-
params(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
params(
|
|
22
|
+
code: String,
|
|
23
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
24
|
+
).returns(T.attached_class)
|
|
21
25
|
end
|
|
22
|
-
def self.new(request_options: {})
|
|
26
|
+
def self.new(code:, request_options: {})
|
|
23
27
|
end
|
|
24
28
|
|
|
25
29
|
sig do
|
|
26
|
-
override.returns(
|
|
30
|
+
override.returns(
|
|
31
|
+
{ code: String, request_options: Dodopayments::RequestOptions }
|
|
32
|
+
)
|
|
27
33
|
end
|
|
28
34
|
def to_hash
|
|
29
35
|
end
|
|
@@ -14,16 +14,22 @@ module Dodopayments
|
|
|
14
14
|
)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :discount_id
|
|
19
|
+
|
|
17
20
|
sig do
|
|
18
|
-
params(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
params(
|
|
22
|
+
discount_id: String,
|
|
23
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
24
|
+
).returns(T.attached_class)
|
|
21
25
|
end
|
|
22
|
-
def self.new(request_options: {})
|
|
26
|
+
def self.new(discount_id:, request_options: {})
|
|
23
27
|
end
|
|
24
28
|
|
|
25
29
|
sig do
|
|
26
|
-
override.returns(
|
|
30
|
+
override.returns(
|
|
31
|
+
{ discount_id: String, request_options: Dodopayments::RequestOptions }
|
|
32
|
+
)
|
|
27
33
|
end
|
|
28
34
|
def to_hash
|
|
29
35
|
end
|
|
@@ -14,6 +14,9 @@ module Dodopayments
|
|
|
14
14
|
)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :discount_id
|
|
19
|
+
|
|
17
20
|
# If present, update the discount amount:
|
|
18
21
|
#
|
|
19
22
|
# - If `discount_type` is `percentage`, this represents **basis points** (e.g.,
|
|
@@ -34,6 +37,11 @@ module Dodopayments
|
|
|
34
37
|
sig { returns(T.nilable(String)) }
|
|
35
38
|
attr_accessor :name
|
|
36
39
|
|
|
40
|
+
# Whether this discount should be preserved when a subscription changes plans. If
|
|
41
|
+
# not provided, the existing value is kept.
|
|
42
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
43
|
+
attr_accessor :preserve_on_plan_change
|
|
44
|
+
|
|
37
45
|
# If present, replaces all restricted product IDs with this new set. To remove all
|
|
38
46
|
# restrictions, send empty array
|
|
39
47
|
sig { returns(T.nilable(T::Array[String])) }
|
|
@@ -54,10 +62,12 @@ module Dodopayments
|
|
|
54
62
|
|
|
55
63
|
sig do
|
|
56
64
|
params(
|
|
65
|
+
discount_id: String,
|
|
57
66
|
amount: T.nilable(Integer),
|
|
58
67
|
code: T.nilable(String),
|
|
59
68
|
expires_at: T.nilable(Time),
|
|
60
69
|
name: T.nilable(String),
|
|
70
|
+
preserve_on_plan_change: T.nilable(T::Boolean),
|
|
61
71
|
restricted_to: T.nilable(T::Array[String]),
|
|
62
72
|
subscription_cycles: T.nilable(Integer),
|
|
63
73
|
type: T.nilable(Dodopayments::DiscountType::OrSymbol),
|
|
@@ -66,6 +76,7 @@ module Dodopayments
|
|
|
66
76
|
).returns(T.attached_class)
|
|
67
77
|
end
|
|
68
78
|
def self.new(
|
|
79
|
+
discount_id:,
|
|
69
80
|
# If present, update the discount amount:
|
|
70
81
|
#
|
|
71
82
|
# - If `discount_type` is `percentage`, this represents **basis points** (e.g.,
|
|
@@ -78,6 +89,9 @@ module Dodopayments
|
|
|
78
89
|
code: nil,
|
|
79
90
|
expires_at: nil,
|
|
80
91
|
name: nil,
|
|
92
|
+
# Whether this discount should be preserved when a subscription changes plans. If
|
|
93
|
+
# not provided, the existing value is kept.
|
|
94
|
+
preserve_on_plan_change: nil,
|
|
81
95
|
# If present, replaces all restricted product IDs with this new set. To remove all
|
|
82
96
|
# restrictions, send empty array
|
|
83
97
|
restricted_to: nil,
|
|
@@ -95,10 +109,12 @@ module Dodopayments
|
|
|
95
109
|
sig do
|
|
96
110
|
override.returns(
|
|
97
111
|
{
|
|
112
|
+
discount_id: String,
|
|
98
113
|
amount: T.nilable(Integer),
|
|
99
114
|
code: T.nilable(String),
|
|
100
115
|
expires_at: T.nilable(Time),
|
|
101
116
|
name: T.nilable(String),
|
|
117
|
+
preserve_on_plan_change: T.nilable(T::Boolean),
|
|
102
118
|
restricted_to: T.nilable(T::Array[String]),
|
|
103
119
|
subscription_cycles: T.nilable(Integer),
|
|
104
120
|
type: T.nilable(Dodopayments::DiscountType::OrSymbol),
|