dodopayments 1.18.0 → 1.18.3
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 +26 -0
- data/README.md +1 -1
- data/lib/dodopayments/file_part.rb +55 -0
- data/lib/dodopayments/internal/transport/base_client.rb +3 -3
- data/lib/dodopayments/internal/transport/pooled_net_requester.rb +1 -1
- data/lib/dodopayments/internal/type/converter.rb +1 -1
- data/lib/dodopayments/internal/type/{io_like.rb → file_input.rb} +8 -4
- data/lib/dodopayments/internal/util.rb +69 -61
- data/lib/dodopayments/models/billing_address.rb +9 -5
- data/lib/dodopayments/models/create_new_customer.rb +8 -1
- data/lib/dodopayments/models/customer_limited_details.rb +5 -3
- data/lib/dodopayments/models/customer_list_params.rb +4 -2
- data/lib/dodopayments/models/customers/customer_portal_create_params.rb +2 -1
- data/lib/dodopayments/models/discount.rb +23 -10
- data/lib/dodopayments/models/discount_create_params.rb +15 -5
- data/lib/dodopayments/models/discount_list_params.rb +4 -2
- data/lib/dodopayments/models/discount_update_params.rb +13 -3
- data/lib/dodopayments/models/dispute.rb +17 -6
- data/lib/dodopayments/models/dispute_list_params.rb +14 -7
- data/lib/dodopayments/models/license_key.rb +26 -11
- data/lib/dodopayments/models/license_key_instance_list_params.rb +6 -3
- data/lib/dodopayments/models/license_key_list_params.rb +10 -5
- data/lib/dodopayments/models/license_key_update_params.rb +9 -3
- data/lib/dodopayments/models/one_time_product_cart_item.rb +7 -1
- data/lib/dodopayments/models/payment.rb +53 -17
- data/lib/dodopayments/models/payment_create_params.rb +22 -7
- data/lib/dodopayments/models/payment_create_response.rb +16 -6
- data/lib/dodopayments/models/payment_list_params.rb +14 -7
- data/lib/dodopayments/models/payout_list_params.rb +4 -2
- data/lib/dodopayments/models/payout_list_response.rb +27 -13
- data/lib/dodopayments/models/price.rb +38 -13
- data/lib/dodopayments/models/product.rb +31 -13
- data/lib/dodopayments/models/product_create_params.rb +20 -7
- data/lib/dodopayments/models/product_list_params.rb +11 -4
- data/lib/dodopayments/models/product_list_response.rb +27 -11
- data/lib/dodopayments/models/product_update_params.rb +22 -8
- data/lib/dodopayments/models/refund.rb +13 -6
- data/lib/dodopayments/models/refund_create_params.rb +4 -2
- data/lib/dodopayments/models/refund_list_params.rb +12 -6
- data/lib/dodopayments/models/subscription.rb +37 -13
- data/lib/dodopayments/models/subscription_change_plan_params.rb +5 -2
- data/lib/dodopayments/models/subscription_charge_params.rb +6 -1
- data/lib/dodopayments/models/subscription_create_params.rb +34 -11
- data/lib/dodopayments/models/subscription_create_response.rb +15 -5
- data/lib/dodopayments/models/subscription_list_params.rb +12 -6
- data/lib/dodopayments/models/webhook_event_list_params.rb +16 -6
- data/lib/dodopayments/resources/customers/customer_portal.rb +4 -2
- data/lib/dodopayments/resources/customers.rb +10 -4
- data/lib/dodopayments/resources/discounts.rb +38 -13
- data/lib/dodopayments/resources/disputes.rb +16 -8
- data/lib/dodopayments/resources/license_key_instances.rb +11 -5
- data/lib/dodopayments/resources/license_keys.rb +23 -10
- data/lib/dodopayments/resources/payments.rb +38 -15
- data/lib/dodopayments/resources/payouts.rb +4 -2
- data/lib/dodopayments/resources/products/images.rb +3 -1
- data/lib/dodopayments/resources/products.rb +56 -20
- data/lib/dodopayments/resources/refunds.rb +18 -9
- data/lib/dodopayments/resources/subscriptions.rb +62 -22
- data/lib/dodopayments/resources/webhook_events.rb +16 -6
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +2 -1
- data/rbi/lib/dodopayments/file_part.rbi +34 -0
- data/rbi/lib/dodopayments/internal/transport/base_client.rbi +17 -3
- data/rbi/lib/dodopayments/internal/type/{io_like.rbi → file_input.rbi} +6 -2
- data/rbi/lib/dodopayments/internal/util.rbi +24 -19
- data/rbi/lib/dodopayments/models/billing_address.rbi +12 -2
- data/rbi/lib/dodopayments/models/create_new_customer.rbi +9 -2
- data/rbi/lib/dodopayments/models/customer_limited_details.rbi +8 -2
- data/rbi/lib/dodopayments/models/customer_list_params.rbi +7 -2
- data/rbi/lib/dodopayments/models/customers/customer_portal_create_params.rbi +5 -2
- data/rbi/lib/dodopayments/models/discount.rbi +14 -0
- data/rbi/lib/dodopayments/models/discount_create_params.rbi +15 -0
- data/rbi/lib/dodopayments/models/discount_list_params.rbi +7 -2
- data/rbi/lib/dodopayments/models/discount_update_params.rbi +10 -0
- data/rbi/lib/dodopayments/models/dispute.rbi +8 -3
- data/rbi/lib/dodopayments/models/dispute_list_params.rbi +7 -0
- data/rbi/lib/dodopayments/models/license_key.rbi +12 -0
- data/rbi/lib/dodopayments/models/license_key_instance_list_params.rbi +9 -2
- data/rbi/lib/dodopayments/models/license_key_list_params.rbi +6 -3
- data/rbi/lib/dodopayments/models/license_key_update_params.rbi +12 -2
- data/rbi/lib/dodopayments/models/one_time_product_cart_item.rbi +8 -2
- data/rbi/lib/dodopayments/models/payment.rbi +31 -0
- data/rbi/lib/dodopayments/models/payment_create_params.rbi +14 -0
- data/rbi/lib/dodopayments/models/payment_create_response.rbi +7 -0
- data/rbi/lib/dodopayments/models/payment_list_params.rbi +7 -0
- data/rbi/lib/dodopayments/models/payout_list_params.rbi +7 -2
- data/rbi/lib/dodopayments/models/payout_list_response.rbi +13 -0
- data/rbi/lib/dodopayments/models/price.rbi +25 -0
- data/rbi/lib/dodopayments/models/product.rbi +14 -0
- data/rbi/lib/dodopayments/models/product_create_params.rbi +8 -0
- data/rbi/lib/dodopayments/models/product_list_params.rbi +15 -2
- data/rbi/lib/dodopayments/models/product_list_response.rbi +21 -0
- data/rbi/lib/dodopayments/models/product_update_params.rbi +18 -0
- data/rbi/lib/dodopayments/models/refund.rbi +7 -3
- data/rbi/lib/dodopayments/models/refund_create_params.rbi +7 -2
- data/rbi/lib/dodopayments/models/refund_list_params.rbi +6 -0
- data/rbi/lib/dodopayments/models/subscription.rbi +15 -0
- data/rbi/lib/dodopayments/models/subscription_change_plan_params.rbi +8 -2
- data/rbi/lib/dodopayments/models/subscription_charge_params.rbi +6 -2
- data/rbi/lib/dodopayments/models/subscription_create_params.rbi +25 -2
- data/rbi/lib/dodopayments/models/subscription_create_response.rbi +7 -0
- data/rbi/lib/dodopayments/models/subscription_list_params.rbi +6 -0
- data/rbi/lib/dodopayments/models/webhook_event_list_params.rbi +6 -0
- data/sig/dodopayments/file_part.rbs +21 -0
- data/sig/dodopayments/internal/transport/base_client.rbs +9 -3
- data/sig/dodopayments/internal/type/{io_like.rbs → file_input.rbs} +1 -1
- data/sig/dodopayments/internal/util.rbs +14 -12
- data/sig/dodopayments/models/payment.rbs +4 -0
- metadata +8 -5
@@ -16,8 +16,14 @@ module Dodopayments
|
|
16
16
|
attr_accessor :name
|
17
17
|
|
18
18
|
sig { params(customer_id: String, email: String, name: String).returns(T.attached_class) }
|
19
|
-
def self.new(
|
20
|
-
|
19
|
+
def self.new(
|
20
|
+
# Unique identifier for the customer
|
21
|
+
customer_id:,
|
22
|
+
# Email address of the customer
|
23
|
+
email:,
|
24
|
+
# Full name of the customer
|
25
|
+
name:
|
26
|
+
); end
|
21
27
|
sig { override.returns({customer_id: String, email: String, name: String}) }
|
22
28
|
def to_hash; end
|
23
29
|
end
|
@@ -22,8 +22,13 @@ module Dodopayments
|
|
22
22
|
)
|
23
23
|
.returns(T.attached_class)
|
24
24
|
end
|
25
|
-
def self.new(
|
26
|
-
|
25
|
+
def self.new(
|
26
|
+
# Page number default is 0
|
27
|
+
page_number: nil,
|
28
|
+
# Page size default is 10 max is 100
|
29
|
+
page_size: nil,
|
30
|
+
request_options: {}
|
31
|
+
); end
|
27
32
|
sig do
|
28
33
|
override
|
29
34
|
.returns(
|
@@ -18,8 +18,11 @@ module Dodopayments
|
|
18
18
|
)
|
19
19
|
.returns(T.attached_class)
|
20
20
|
end
|
21
|
-
def self.new(
|
22
|
-
|
21
|
+
def self.new(
|
22
|
+
# If true, will send link to user.
|
23
|
+
send_email: nil,
|
24
|
+
request_options: {}
|
25
|
+
); end
|
23
26
|
sig do
|
24
27
|
override.returns({send_email: T.nilable(T::Boolean), request_options: Dodopayments::RequestOptions})
|
25
28
|
end
|
@@ -67,16 +67,30 @@ module Dodopayments
|
|
67
67
|
.returns(T.attached_class)
|
68
68
|
end
|
69
69
|
def self.new(
|
70
|
+
# The discount amount.
|
71
|
+
#
|
72
|
+
# - If `discount_type` is `percentage`, this is in **basis points** (e.g., 540 =>
|
73
|
+
# 5.4%).
|
74
|
+
# - Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).
|
70
75
|
amount:,
|
76
|
+
# The business this discount belongs to.
|
71
77
|
business_id:,
|
78
|
+
# The discount code (up to 16 chars).
|
72
79
|
code:,
|
80
|
+
# Timestamp when the discount is created
|
73
81
|
created_at:,
|
82
|
+
# The unique discount ID
|
74
83
|
discount_id:,
|
84
|
+
# List of product IDs to which this discount is restricted.
|
75
85
|
restricted_to:,
|
86
|
+
# How many times this discount has been used.
|
76
87
|
times_used:,
|
77
88
|
type:,
|
89
|
+
# Optional date/time after which discount is expired.
|
78
90
|
expires_at: nil,
|
91
|
+
# Name for the Discount
|
79
92
|
name: nil,
|
93
|
+
# Usage limit for this discount, if any.
|
80
94
|
usage_limit: nil
|
81
95
|
); end
|
82
96
|
sig do
|
@@ -56,12 +56,27 @@ module Dodopayments
|
|
56
56
|
.returns(T.attached_class)
|
57
57
|
end
|
58
58
|
def self.new(
|
59
|
+
# The discount amount.
|
60
|
+
#
|
61
|
+
# - If `discount_type` is **not** `percentage`, `amount` is in **USD cents**. For
|
62
|
+
# example, `100` means `$1.00`. Only USD is allowed.
|
63
|
+
# - If `discount_type` **is** `percentage`, `amount` is in **basis points**. For
|
64
|
+
# example, `540` means `5.4%`.
|
65
|
+
#
|
66
|
+
# Must be at least 1.
|
59
67
|
amount:,
|
60
68
|
type:,
|
69
|
+
# Optionally supply a code (will be uppercased).
|
70
|
+
#
|
71
|
+
# - Must be at least 3 characters if provided.
|
72
|
+
# - If omitted, a random 16-character code is generated.
|
61
73
|
code: nil,
|
74
|
+
# When the discount expires, if ever.
|
62
75
|
expires_at: nil,
|
63
76
|
name: nil,
|
77
|
+
# List of product IDs to restrict usage (if any).
|
64
78
|
restricted_to: nil,
|
79
|
+
# How many times this discount can be used (if any). Must be >= 1 if provided.
|
65
80
|
usage_limit: nil,
|
66
81
|
request_options: {}
|
67
82
|
); end
|
@@ -22,8 +22,13 @@ module Dodopayments
|
|
22
22
|
)
|
23
23
|
.returns(T.attached_class)
|
24
24
|
end
|
25
|
-
def self.new(
|
26
|
-
|
25
|
+
def self.new(
|
26
|
+
# Page number (default = 0).
|
27
|
+
page_number: nil,
|
28
|
+
# Page size (default = 10, max = 100).
|
29
|
+
page_size: nil,
|
30
|
+
request_options: {}
|
31
|
+
); end
|
27
32
|
sig do
|
28
33
|
override
|
29
34
|
.returns(
|
@@ -51,10 +51,20 @@ module Dodopayments
|
|
51
51
|
.returns(T.attached_class)
|
52
52
|
end
|
53
53
|
def self.new(
|
54
|
+
# If present, update the discount amount:
|
55
|
+
#
|
56
|
+
# - If `discount_type` is `percentage`, this represents **basis points** (e.g.,
|
57
|
+
# `540` = `5.4%`).
|
58
|
+
# - Otherwise, this represents **USD cents** (e.g., `100` = `$1.00`).
|
59
|
+
#
|
60
|
+
# Must be at least 1 if provided.
|
54
61
|
amount: nil,
|
62
|
+
# If present, update the discount code (uppercase).
|
55
63
|
code: nil,
|
56
64
|
expires_at: nil,
|
57
65
|
name: nil,
|
66
|
+
# If present, replaces all restricted product IDs with this new set. To remove all
|
67
|
+
# restrictions, send empty array
|
58
68
|
restricted_to: nil,
|
59
69
|
type: nil,
|
60
70
|
usage_limit: nil,
|
@@ -48,17 +48,22 @@ module Dodopayments
|
|
48
48
|
.returns(T.attached_class)
|
49
49
|
end
|
50
50
|
def self.new(
|
51
|
+
# The amount involved in the dispute, represented as a string to accommodate
|
52
|
+
# precision.
|
51
53
|
amount:,
|
54
|
+
# The unique identifier of the business involved in the dispute.
|
52
55
|
business_id:,
|
56
|
+
# The timestamp of when the dispute was created, in UTC.
|
53
57
|
created_at:,
|
58
|
+
# The currency of the disputed amount, represented as an ISO 4217 currency code.
|
54
59
|
currency:,
|
60
|
+
# The unique identifier of the dispute.
|
55
61
|
dispute_id:,
|
56
62
|
dispute_stage:,
|
57
63
|
dispute_status:,
|
64
|
+
# The unique identifier of the payment associated with the dispute.
|
58
65
|
payment_id:
|
59
|
-
)
|
60
|
-
end
|
61
|
-
|
66
|
+
); end
|
62
67
|
sig do
|
63
68
|
override
|
64
69
|
.returns(
|
@@ -48,12 +48,19 @@ module Dodopayments
|
|
48
48
|
.returns(T.attached_class)
|
49
49
|
end
|
50
50
|
def self.new(
|
51
|
+
# Get events after this created time
|
51
52
|
created_at_gte: nil,
|
53
|
+
# Get events created before this time
|
52
54
|
created_at_lte: nil,
|
55
|
+
# Filter by customer_id
|
53
56
|
customer_id: nil,
|
57
|
+
# Filter by dispute stage
|
54
58
|
dispute_stage: nil,
|
59
|
+
# Filter by dispute status
|
55
60
|
dispute_status: nil,
|
61
|
+
# Page number default is 0
|
56
62
|
page_number: nil,
|
63
|
+
# Page size default is 10 max is 100
|
57
64
|
page_size: nil,
|
58
65
|
request_options: {}
|
59
66
|
); end
|
@@ -69,17 +69,29 @@ module Dodopayments
|
|
69
69
|
.returns(T.attached_class)
|
70
70
|
end
|
71
71
|
def self.new(
|
72
|
+
# The unique identifier of the license key.
|
72
73
|
id:,
|
74
|
+
# The unique identifier of the business associated with the license key.
|
73
75
|
business_id:,
|
76
|
+
# The timestamp indicating when the license key was created, in UTC.
|
74
77
|
created_at:,
|
78
|
+
# The unique identifier of the customer associated with the license key.
|
75
79
|
customer_id:,
|
80
|
+
# The current number of instances activated for this license key.
|
76
81
|
instances_count:,
|
82
|
+
# The license key string.
|
77
83
|
key:,
|
84
|
+
# The unique identifier of the payment associated with the license key.
|
78
85
|
payment_id:,
|
86
|
+
# The unique identifier of the product associated with the license key.
|
79
87
|
product_id:,
|
80
88
|
status:,
|
89
|
+
# The maximum number of activations allowed for this license key.
|
81
90
|
activations_limit: nil,
|
91
|
+
# The timestamp indicating when the license key expires, in UTC.
|
82
92
|
expires_at: nil,
|
93
|
+
# The unique identifier of the subscription associated with the license key, if
|
94
|
+
# any.
|
83
95
|
subscription_id: nil
|
84
96
|
); end
|
85
97
|
sig do
|
@@ -27,8 +27,15 @@ module Dodopayments
|
|
27
27
|
)
|
28
28
|
.returns(T.attached_class)
|
29
29
|
end
|
30
|
-
def self.new(
|
31
|
-
|
30
|
+
def self.new(
|
31
|
+
# Filter by license key ID
|
32
|
+
license_key_id: nil,
|
33
|
+
# Page number default is 0
|
34
|
+
page_number: nil,
|
35
|
+
# Page size default is 10 max is 100
|
36
|
+
page_size: nil,
|
37
|
+
request_options: {}
|
38
|
+
); end
|
32
39
|
sig do
|
33
40
|
override
|
34
41
|
.returns(
|
@@ -38,15 +38,18 @@ module Dodopayments
|
|
38
38
|
.returns(T.attached_class)
|
39
39
|
end
|
40
40
|
def self.new(
|
41
|
+
# Filter by customer ID
|
41
42
|
customer_id: nil,
|
43
|
+
# Page number default is 0
|
42
44
|
page_number: nil,
|
45
|
+
# Page size default is 10 max is 100
|
43
46
|
page_size: nil,
|
47
|
+
# Filter by product ID
|
44
48
|
product_id: nil,
|
49
|
+
# Filter by license key status
|
45
50
|
status: nil,
|
46
51
|
request_options: {}
|
47
|
-
)
|
48
|
-
end
|
49
|
-
|
52
|
+
); end
|
50
53
|
sig do
|
51
54
|
override
|
52
55
|
.returns(
|
@@ -30,8 +30,18 @@ module Dodopayments
|
|
30
30
|
)
|
31
31
|
.returns(T.attached_class)
|
32
32
|
end
|
33
|
-
def self.new(
|
34
|
-
|
33
|
+
def self.new(
|
34
|
+
# The updated activation limit for the license key. Use `null` to remove the
|
35
|
+
# limit, or omit this field to leave it unchanged.
|
36
|
+
activations_limit: nil,
|
37
|
+
# Indicates whether the license key should be disabled. A value of `true` disables
|
38
|
+
# the key, while `false` enables it. Omit this field to leave it unchanged.
|
39
|
+
disabled: nil,
|
40
|
+
# The updated expiration timestamp for the license key in UTC. Use `null` to
|
41
|
+
# remove the expiration date, or omit this field to leave it unchanged.
|
42
|
+
expires_at: nil,
|
43
|
+
request_options: {}
|
44
|
+
); end
|
35
45
|
sig do
|
36
46
|
override
|
37
47
|
.returns(
|
@@ -18,8 +18,14 @@ module Dodopayments
|
|
18
18
|
sig do
|
19
19
|
params(product_id: String, quantity: Integer, amount: T.nilable(Integer)).returns(T.attached_class)
|
20
20
|
end
|
21
|
-
def self.new(
|
22
|
-
|
21
|
+
def self.new(
|
22
|
+
product_id:,
|
23
|
+
quantity:,
|
24
|
+
# Amount the customer pays if pay_what_you_want is enabled. If disabled then
|
25
|
+
# amount will be ignored Represented in the lowest denomination of the currency
|
26
|
+
# (e.g., cents for USD). For example, to charge $1.00, pass `100`.
|
27
|
+
amount: nil
|
28
|
+
); end
|
23
29
|
sig { override.returns({product_id: String, quantity: Integer, amount: T.nilable(Integer)}) }
|
24
30
|
def to_hash; end
|
25
31
|
end
|
@@ -75,6 +75,12 @@ module Dodopayments
|
|
75
75
|
sig { returns(T.nilable(T::Array[Dodopayments::Models::Payment::ProductCart])) }
|
76
76
|
attr_accessor :product_cart
|
77
77
|
|
78
|
+
# This represents the portion of settlement_amount that corresponds to taxes
|
79
|
+
# collected. Especially relevant for adaptive pricing where the tax component must
|
80
|
+
# be tracked separately in your Dodo balance.
|
81
|
+
sig { returns(T.nilable(Integer)) }
|
82
|
+
attr_accessor :settlement_tax
|
83
|
+
|
78
84
|
sig { returns(T.nilable(Dodopayments::Models::IntentStatus::TaggedSymbol)) }
|
79
85
|
attr_accessor :status
|
80
86
|
|
@@ -109,6 +115,7 @@ module Dodopayments
|
|
109
115
|
payment_method: T.nilable(String),
|
110
116
|
payment_method_type: T.nilable(String),
|
111
117
|
product_cart: T.nilable(T::Array[T.any(Dodopayments::Models::Payment::ProductCart, Dodopayments::Internal::AnyHash)]),
|
118
|
+
settlement_tax: T.nilable(Integer),
|
112
119
|
status: T.nilable(Dodopayments::Models::IntentStatus::OrSymbol),
|
113
120
|
subscription_id: T.nilable(String),
|
114
121
|
tax: T.nilable(Integer),
|
@@ -117,26 +124,49 @@ module Dodopayments
|
|
117
124
|
.returns(T.attached_class)
|
118
125
|
end
|
119
126
|
def self.new(
|
127
|
+
# Identifier of the business associated with the payment
|
120
128
|
business_id:,
|
129
|
+
# Timestamp when the payment was created
|
121
130
|
created_at:,
|
122
131
|
currency:,
|
123
132
|
customer:,
|
133
|
+
# List of disputes associated with this payment
|
124
134
|
disputes:,
|
125
135
|
metadata:,
|
136
|
+
# Unique identifier for the payment
|
126
137
|
payment_id:,
|
138
|
+
# List of refunds issued for this payment
|
127
139
|
refunds:,
|
140
|
+
# The amount that will be credited to your Dodo balance after currency conversion
|
141
|
+
# and processing. Especially relevant for adaptive pricing where the customer's
|
142
|
+
# payment currency differs from your settlement currency.
|
128
143
|
settlement_amount:,
|
129
144
|
settlement_currency:,
|
145
|
+
# Total amount charged to the customer including tax, in smallest currency unit
|
146
|
+
# (e.g. cents)
|
130
147
|
total_amount:,
|
148
|
+
# The discount id if discount is applied
|
131
149
|
discount_id: nil,
|
150
|
+
# An error message if the payment failed
|
132
151
|
error_message: nil,
|
152
|
+
# Checkout URL
|
133
153
|
payment_link: nil,
|
154
|
+
# Payment method used by customer (e.g. "card", "bank_transfer")
|
134
155
|
payment_method: nil,
|
156
|
+
# Specific type of payment method (e.g. "visa", "mastercard")
|
135
157
|
payment_method_type: nil,
|
158
|
+
# List of products purchased in a one-time payment
|
136
159
|
product_cart: nil,
|
160
|
+
# This represents the portion of settlement_amount that corresponds to taxes
|
161
|
+
# collected. Especially relevant for adaptive pricing where the tax component must
|
162
|
+
# be tracked separately in your Dodo balance.
|
163
|
+
settlement_tax: nil,
|
137
164
|
status: nil,
|
165
|
+
# Identifier of the subscription if payment is part of a subscription
|
138
166
|
subscription_id: nil,
|
167
|
+
# Amount of tax collected in smallest currency unit (e.g. cents)
|
139
168
|
tax: nil,
|
169
|
+
# Timestamp when the payment was last updated
|
140
170
|
updated_at: nil
|
141
171
|
); end
|
142
172
|
sig do
|
@@ -160,6 +190,7 @@ module Dodopayments
|
|
160
190
|
payment_method: T.nilable(String),
|
161
191
|
payment_method_type: T.nilable(String),
|
162
192
|
product_cart: T.nilable(T::Array[Dodopayments::Models::Payment::ProductCart]),
|
193
|
+
settlement_tax: T.nilable(Integer),
|
163
194
|
status: T.nilable(Dodopayments::Models::IntentStatus::TaggedSymbol),
|
164
195
|
subscription_id: T.nilable(String),
|
165
196
|
tax: T.nilable(Integer),
|
@@ -90,14 +90,28 @@ module Dodopayments
|
|
90
90
|
def self.new(
|
91
91
|
billing:,
|
92
92
|
customer:,
|
93
|
+
# List of products in the cart. Must contain at least 1 and at most 100 items.
|
93
94
|
product_cart:,
|
95
|
+
# List of payment methods allowed during checkout.
|
96
|
+
#
|
97
|
+
# Customers will **never** see payment methods that are **not** in this list.
|
98
|
+
# However, adding a method here **does not guarantee** customers will see it.
|
99
|
+
# Availability still depends on other factors (e.g., customer location, merchant
|
100
|
+
# settings).
|
94
101
|
allowed_payment_method_types: nil,
|
95
102
|
billing_currency: nil,
|
103
|
+
# Discount Code to apply to the transaction
|
96
104
|
discount_code: nil,
|
97
105
|
metadata: nil,
|
106
|
+
# Whether to generate a payment link. Defaults to false if not specified.
|
98
107
|
payment_link: nil,
|
108
|
+
# Optional URL to redirect the customer after payment. Must be a valid URL if
|
109
|
+
# provided.
|
99
110
|
return_url: nil,
|
111
|
+
# Display saved payment methods of a returning customer False by default
|
100
112
|
show_saved_payment_methods: nil,
|
113
|
+
# Tax ID in case the payment is B2B. If tax id validation fails the payment
|
114
|
+
# creation will fail
|
101
115
|
tax_id: nil,
|
102
116
|
request_options: {}
|
103
117
|
); end
|
@@ -53,13 +53,20 @@ module Dodopayments
|
|
53
53
|
.returns(T.attached_class)
|
54
54
|
end
|
55
55
|
def self.new(
|
56
|
+
# Client secret used to load Dodo checkout SDK NOTE : Dodo checkout SDK will be
|
57
|
+
# coming soon
|
56
58
|
client_secret:,
|
57
59
|
customer:,
|
58
60
|
metadata:,
|
61
|
+
# Unique identifier for the payment
|
59
62
|
payment_id:,
|
63
|
+
# Total amount of the payment in smallest currency unit (e.g. cents)
|
60
64
|
total_amount:,
|
65
|
+
# The discount id if discount is applied
|
61
66
|
discount_id: nil,
|
67
|
+
# Optional URL to a hosted payment page
|
62
68
|
payment_link: nil,
|
69
|
+
# Optional list of products included in the payment
|
63
70
|
product_cart: nil
|
64
71
|
); end
|
65
72
|
sig do
|
@@ -48,12 +48,19 @@ module Dodopayments
|
|
48
48
|
.returns(T.attached_class)
|
49
49
|
end
|
50
50
|
def self.new(
|
51
|
+
# Get events after this created time
|
51
52
|
created_at_gte: nil,
|
53
|
+
# Get events created before this time
|
52
54
|
created_at_lte: nil,
|
55
|
+
# Filter by customer id
|
53
56
|
customer_id: nil,
|
57
|
+
# Page number default is 0
|
54
58
|
page_number: nil,
|
59
|
+
# Page size default is 10 max is 100
|
55
60
|
page_size: nil,
|
61
|
+
# Filter by status
|
56
62
|
status: nil,
|
63
|
+
# Filter by subscription id
|
57
64
|
subscription_id: nil,
|
58
65
|
request_options: {}
|
59
66
|
); end
|
@@ -22,8 +22,13 @@ module Dodopayments
|
|
22
22
|
)
|
23
23
|
.returns(T.attached_class)
|
24
24
|
end
|
25
|
-
def self.new(
|
26
|
-
|
25
|
+
def self.new(
|
26
|
+
# Page number default is 0
|
27
|
+
page_number: nil,
|
28
|
+
# Page size default is 10 max is 100
|
29
|
+
page_size: nil,
|
30
|
+
request_options: {}
|
31
|
+
); end
|
27
32
|
sig do
|
28
33
|
override
|
29
34
|
.returns(
|
@@ -82,20 +82,33 @@ module Dodopayments
|
|
82
82
|
.returns(T.attached_class)
|
83
83
|
end
|
84
84
|
def self.new(
|
85
|
+
# The total amount of the payout.
|
85
86
|
amount:,
|
87
|
+
# The unique identifier of the business associated with the payout.
|
86
88
|
business_id:,
|
89
|
+
# The total value of chargebacks associated with the payout.
|
87
90
|
chargebacks:,
|
91
|
+
# The timestamp when the payout was created, in UTC.
|
88
92
|
created_at:,
|
89
93
|
currency:,
|
94
|
+
# The fee charged for processing the payout.
|
90
95
|
fee:,
|
96
|
+
# The payment method used for the payout (e.g., bank transfer, card, etc.).
|
91
97
|
payment_method:,
|
98
|
+
# The unique identifier of the payout.
|
92
99
|
payout_id:,
|
100
|
+
# The total value of refunds associated with the payout.
|
93
101
|
refunds:,
|
94
102
|
status:,
|
103
|
+
# The tax applied to the payout.
|
95
104
|
tax:,
|
105
|
+
# The timestamp when the payout was last updated, in UTC.
|
96
106
|
updated_at:,
|
107
|
+
# The name of the payout recipient or purpose.
|
97
108
|
name: nil,
|
109
|
+
# The URL of the document associated with the payout.
|
98
110
|
payout_document_url: nil,
|
111
|
+
# Any additional remarks or notes associated with the payout.
|
99
112
|
remarks: nil
|
100
113
|
); end
|
101
114
|
sig do
|
@@ -62,11 +62,25 @@ module Dodopayments
|
|
62
62
|
end
|
63
63
|
def self.new(
|
64
64
|
currency:,
|
65
|
+
# Discount applied to the price, represented as a percentage (0 to 100).
|
65
66
|
discount:,
|
67
|
+
# The payment amount, in the smallest denomination of the currency (e.g., cents
|
68
|
+
# for USD). For example, to charge $1.00, pass `100`.
|
69
|
+
#
|
70
|
+
# If [`pay_what_you_want`](Self::pay_what_you_want) is set to `true`, this field
|
71
|
+
# represents the **minimum** amount the customer must pay.
|
66
72
|
price:,
|
73
|
+
# Indicates if purchasing power parity adjustments are applied to the price.
|
74
|
+
# Purchasing power parity feature is not available as of now.
|
67
75
|
purchasing_power_parity:,
|
76
|
+
# Indicates whether the customer can pay any amount they choose. If set to `true`,
|
77
|
+
# the [`price`](Self::price) field is the minimum amount.
|
68
78
|
pay_what_you_want: nil,
|
79
|
+
# A suggested price for the user to pay. This value is only considered if
|
80
|
+
# [`pay_what_you_want`](Self::pay_what_you_want) is `true`. Otherwise, it is
|
81
|
+
# ignored.
|
69
82
|
suggested_price: nil,
|
83
|
+
# Indicates if the price is tax inclusive.
|
70
84
|
tax_inclusive: nil,
|
71
85
|
type: :one_time_price
|
72
86
|
); end
|
@@ -310,14 +324,25 @@ module Dodopayments
|
|
310
324
|
end
|
311
325
|
def self.new(
|
312
326
|
currency:,
|
327
|
+
# Discount applied to the price, represented as a percentage (0 to 100).
|
313
328
|
discount:,
|
329
|
+
# Number of units for the payment frequency. For example, a value of `1` with a
|
330
|
+
# `payment_frequency_interval` of `month` represents monthly payments.
|
314
331
|
payment_frequency_count:,
|
315
332
|
payment_frequency_interval:,
|
333
|
+
# The payment amount. Represented in the lowest denomination of the currency
|
334
|
+
# (e.g., cents for USD). For example, to charge $1.00, pass `100`.
|
316
335
|
price:,
|
336
|
+
# Indicates if purchasing power parity adjustments are applied to the price.
|
337
|
+
# Purchasing power parity feature is not available as of now
|
317
338
|
purchasing_power_parity:,
|
339
|
+
# Number of units for the subscription period. For example, a value of `12` with a
|
340
|
+
# `subscription_period_interval` of `month` represents a one-year subscription.
|
318
341
|
subscription_period_count:,
|
319
342
|
subscription_period_interval:,
|
343
|
+
# Indicates if the price is tax inclusive
|
320
344
|
tax_inclusive: nil,
|
345
|
+
# Number of days for the trial period. A value of `0` indicates no trial period.
|
321
346
|
trial_period_days: nil,
|
322
347
|
type: :recurring_price
|
323
348
|
); end
|
@@ -95,20 +95,34 @@ module Dodopayments
|
|
95
95
|
.returns(T.attached_class)
|
96
96
|
end
|
97
97
|
def self.new(
|
98
|
+
# Unique identifier for the business to which the product belongs.
|
98
99
|
business_id:,
|
100
|
+
# Timestamp when the product was created.
|
99
101
|
created_at:,
|
102
|
+
# Indicates if the product is recurring (e.g., subscriptions).
|
100
103
|
is_recurring:,
|
104
|
+
# Indicates whether the product requires a license key.
|
101
105
|
license_key_enabled:,
|
102
106
|
price:,
|
107
|
+
# Unique identifier for the product.
|
103
108
|
product_id:,
|
109
|
+
# Represents the different categories of taxation applicable to various products
|
110
|
+
# and services.
|
104
111
|
tax_category:,
|
112
|
+
# Timestamp when the product was last updated.
|
105
113
|
updated_at:,
|
114
|
+
# Available Addons for subscription products
|
106
115
|
addons: nil,
|
116
|
+
# Description of the product, optional.
|
107
117
|
description: nil,
|
118
|
+
# URL of the product image, optional.
|
108
119
|
image: nil,
|
120
|
+
# Message sent upon license key activation, if applicable.
|
109
121
|
license_key_activation_message: nil,
|
122
|
+
# Limit on the number of activations for the license key, if enabled.
|
110
123
|
license_key_activations_limit: nil,
|
111
124
|
license_key_duration: nil,
|
125
|
+
# Name of the product, optional.
|
112
126
|
name: nil
|
113
127
|
); end
|
114
128
|
sig do
|
@@ -70,13 +70,21 @@ module Dodopayments
|
|
70
70
|
end
|
71
71
|
def self.new(
|
72
72
|
price:,
|
73
|
+
# Represents the different categories of taxation applicable to various products
|
74
|
+
# and services.
|
73
75
|
tax_category:,
|
76
|
+
# Addons available for subscription product
|
74
77
|
addons: nil,
|
78
|
+
# Optional description of the product
|
75
79
|
description: nil,
|
80
|
+
# Optional message displayed during license key activation
|
76
81
|
license_key_activation_message: nil,
|
82
|
+
# The number of times the license key can be activated. Must be 0 or greater
|
77
83
|
license_key_activations_limit: nil,
|
78
84
|
license_key_duration: nil,
|
85
|
+
# When true, generates and sends a license key to your customer. Defaults to false
|
79
86
|
license_key_enabled: nil,
|
87
|
+
# Optional name of the product
|
80
88
|
name: nil,
|
81
89
|
request_options: {}
|
82
90
|
); end
|
@@ -39,8 +39,21 @@ module Dodopayments
|
|
39
39
|
)
|
40
40
|
.returns(T.attached_class)
|
41
41
|
end
|
42
|
-
def self.new(
|
43
|
-
|
42
|
+
def self.new(
|
43
|
+
# List archived products
|
44
|
+
archived: nil,
|
45
|
+
# Page number default is 0
|
46
|
+
page_number: nil,
|
47
|
+
# Page size default is 10 max is 100
|
48
|
+
page_size: nil,
|
49
|
+
# Filter products by pricing type:
|
50
|
+
#
|
51
|
+
# - `true`: Show only recurring pricing products (e.g. subscriptions)
|
52
|
+
# - `false`: Show only one-time price products
|
53
|
+
# - `null` or absent: Show both types of products
|
54
|
+
recurring: nil,
|
55
|
+
request_options: {}
|
56
|
+
); end
|
44
57
|
sig do
|
45
58
|
override
|
46
59
|
.returns(
|