dodopayments 1.67.2 → 1.69.0
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 +16 -0
- data/README.md +1 -1
- data/lib/dodopayments/models/checkout_session_request.rb +20 -2
- data/lib/dodopayments/models/payment_create_params.rb +18 -1
- data/lib/dodopayments/models/products/short_link_create_params.rb +35 -0
- data/lib/dodopayments/models/products/short_link_create_response.rb +27 -0
- data/lib/dodopayments/models/products/short_link_list_params.rb +40 -0
- data/lib/dodopayments/models/products/short_link_list_response.rb +43 -0
- data/lib/dodopayments/models/subscription_create_params.rb +18 -1
- data/lib/dodopayments/resources/checkout_sessions.rb +3 -1
- data/lib/dodopayments/resources/payments.rb +5 -1
- data/lib/dodopayments/resources/products/short_links.rb +73 -0
- data/lib/dodopayments/resources/products.rb +4 -0
- data/lib/dodopayments/resources/subscriptions.rb +5 -1
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +5 -0
- data/rbi/dodopayments/models/checkout_session_request.rbi +29 -3
- data/rbi/dodopayments/models/payment_create_params.rbi +21 -0
- data/rbi/dodopayments/models/products/short_link_create_params.rbi +56 -0
- data/rbi/dodopayments/models/products/short_link_create_response.rbi +40 -0
- data/rbi/dodopayments/models/products/short_link_list_params.rbi +73 -0
- data/rbi/dodopayments/models/products/short_link_list_response.rbi +66 -0
- data/rbi/dodopayments/models/subscription_create_params.rbi +21 -0
- data/rbi/dodopayments/resources/checkout_sessions.rbi +3 -0
- data/rbi/dodopayments/resources/payments.rbi +7 -0
- data/rbi/dodopayments/resources/products/short_links.rbi +59 -0
- data/rbi/dodopayments/resources/products.rbi +3 -0
- data/rbi/dodopayments/resources/subscriptions.rbi +7 -0
- data/sig/dodopayments/models/checkout_session_request.rbs +17 -3
- data/sig/dodopayments/models/payment_create_params.rbs +12 -0
- data/sig/dodopayments/models/products/short_link_create_params.rbs +30 -0
- data/sig/dodopayments/models/products/short_link_create_response.rbs +17 -0
- data/sig/dodopayments/models/products/short_link_list_params.rbs +40 -0
- data/sig/dodopayments/models/products/short_link_list_response.rbs +37 -0
- data/sig/dodopayments/models/subscription_create_params.rbs +12 -0
- data/sig/dodopayments/resources/checkout_sessions.rbs +1 -0
- data/sig/dodopayments/resources/payments.rbs +2 -0
- data/sig/dodopayments/resources/products/short_links.rbs +23 -0
- data/sig/dodopayments/resources/products.rbs +2 -0
- data/sig/dodopayments/resources/subscriptions.rbs +2 -0
- metadata +17 -2
|
@@ -69,11 +69,23 @@ module Dodopayments
|
|
|
69
69
|
sig { returns(T.nilable(T::Boolean)) }
|
|
70
70
|
attr_accessor :payment_link
|
|
71
71
|
|
|
72
|
+
# If true, redirects the customer immediately after payment completion False by
|
|
73
|
+
# default
|
|
74
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
75
|
+
attr_reader :redirect_immediately
|
|
76
|
+
|
|
77
|
+
sig { params(redirect_immediately: T::Boolean).void }
|
|
78
|
+
attr_writer :redirect_immediately
|
|
79
|
+
|
|
72
80
|
# Optional URL to redirect the customer after payment. Must be a valid URL if
|
|
73
81
|
# provided.
|
|
74
82
|
sig { returns(T.nilable(String)) }
|
|
75
83
|
attr_accessor :return_url
|
|
76
84
|
|
|
85
|
+
# If true, returns a shortened payment link. Defaults to false if not specified.
|
|
86
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
87
|
+
attr_accessor :short_link
|
|
88
|
+
|
|
77
89
|
# Display saved payment methods of a returning customer False by default
|
|
78
90
|
sig { returns(T.nilable(T::Boolean)) }
|
|
79
91
|
attr_reader :show_saved_payment_methods
|
|
@@ -102,7 +114,9 @@ module Dodopayments
|
|
|
102
114
|
force_3ds: T.nilable(T::Boolean),
|
|
103
115
|
metadata: T::Hash[Symbol, String],
|
|
104
116
|
payment_link: T.nilable(T::Boolean),
|
|
117
|
+
redirect_immediately: T::Boolean,
|
|
105
118
|
return_url: T.nilable(String),
|
|
119
|
+
short_link: T.nilable(T::Boolean),
|
|
106
120
|
show_saved_payment_methods: T::Boolean,
|
|
107
121
|
tax_id: T.nilable(String),
|
|
108
122
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
@@ -134,9 +148,14 @@ module Dodopayments
|
|
|
134
148
|
metadata: nil,
|
|
135
149
|
# Whether to generate a payment link. Defaults to false if not specified.
|
|
136
150
|
payment_link: nil,
|
|
151
|
+
# If true, redirects the customer immediately after payment completion False by
|
|
152
|
+
# default
|
|
153
|
+
redirect_immediately: nil,
|
|
137
154
|
# Optional URL to redirect the customer after payment. Must be a valid URL if
|
|
138
155
|
# provided.
|
|
139
156
|
return_url: nil,
|
|
157
|
+
# If true, returns a shortened payment link. Defaults to false if not specified.
|
|
158
|
+
short_link: nil,
|
|
140
159
|
# Display saved payment methods of a returning customer False by default
|
|
141
160
|
show_saved_payment_methods: nil,
|
|
142
161
|
# Tax ID in case the payment is B2B. If tax id validation fails the payment
|
|
@@ -163,7 +182,9 @@ module Dodopayments
|
|
|
163
182
|
force_3ds: T.nilable(T::Boolean),
|
|
164
183
|
metadata: T::Hash[Symbol, String],
|
|
165
184
|
payment_link: T.nilable(T::Boolean),
|
|
185
|
+
redirect_immediately: T::Boolean,
|
|
166
186
|
return_url: T.nilable(String),
|
|
187
|
+
short_link: T.nilable(T::Boolean),
|
|
167
188
|
show_saved_payment_methods: T::Boolean,
|
|
168
189
|
tax_id: T.nilable(String),
|
|
169
190
|
request_options: Dodopayments::RequestOptions
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
class ShortLinkCreateParams < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Dodopayments::Products::ShortLinkCreateParams,
|
|
14
|
+
Dodopayments::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Slug for the short link.
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :slug
|
|
21
|
+
|
|
22
|
+
# Static Checkout URL parameters to apply to the resulting short URL.
|
|
23
|
+
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
24
|
+
attr_accessor :static_checkout_params
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
params(
|
|
28
|
+
slug: String,
|
|
29
|
+
static_checkout_params: T.nilable(T::Hash[Symbol, String]),
|
|
30
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
31
|
+
).returns(T.attached_class)
|
|
32
|
+
end
|
|
33
|
+
def self.new(
|
|
34
|
+
# Slug for the short link.
|
|
35
|
+
slug:,
|
|
36
|
+
# Static Checkout URL parameters to apply to the resulting short URL.
|
|
37
|
+
static_checkout_params: nil,
|
|
38
|
+
request_options: {}
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
sig do
|
|
43
|
+
override.returns(
|
|
44
|
+
{
|
|
45
|
+
slug: String,
|
|
46
|
+
static_checkout_params: T.nilable(T::Hash[Symbol, String]),
|
|
47
|
+
request_options: Dodopayments::RequestOptions
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
def to_hash
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
class ShortLinkCreateResponse < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
Dodopayments::Models::Products::ShortLinkCreateResponse,
|
|
11
|
+
Dodopayments::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Full URL.
|
|
16
|
+
sig { returns(String) }
|
|
17
|
+
attr_accessor :full_url
|
|
18
|
+
|
|
19
|
+
# Short URL.
|
|
20
|
+
sig { returns(String) }
|
|
21
|
+
attr_accessor :short_url
|
|
22
|
+
|
|
23
|
+
sig do
|
|
24
|
+
params(full_url: String, short_url: String).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(
|
|
27
|
+
# Full URL.
|
|
28
|
+
full_url:,
|
|
29
|
+
# Short URL.
|
|
30
|
+
short_url:
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig { override.returns({ full_url: String, short_url: String }) }
|
|
35
|
+
def to_hash
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
class ShortLinkListParams < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Dodopayments::Products::ShortLinkListParams,
|
|
14
|
+
Dodopayments::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Page number default is 0
|
|
19
|
+
sig { returns(T.nilable(Integer)) }
|
|
20
|
+
attr_reader :page_number
|
|
21
|
+
|
|
22
|
+
sig { params(page_number: Integer).void }
|
|
23
|
+
attr_writer :page_number
|
|
24
|
+
|
|
25
|
+
# Page size default is 10 max is 100
|
|
26
|
+
sig { returns(T.nilable(Integer)) }
|
|
27
|
+
attr_reader :page_size
|
|
28
|
+
|
|
29
|
+
sig { params(page_size: Integer).void }
|
|
30
|
+
attr_writer :page_size
|
|
31
|
+
|
|
32
|
+
# Filter by product ID
|
|
33
|
+
sig { returns(T.nilable(String)) }
|
|
34
|
+
attr_reader :product_id
|
|
35
|
+
|
|
36
|
+
sig { params(product_id: String).void }
|
|
37
|
+
attr_writer :product_id
|
|
38
|
+
|
|
39
|
+
sig do
|
|
40
|
+
params(
|
|
41
|
+
page_number: Integer,
|
|
42
|
+
page_size: Integer,
|
|
43
|
+
product_id: String,
|
|
44
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
45
|
+
).returns(T.attached_class)
|
|
46
|
+
end
|
|
47
|
+
def self.new(
|
|
48
|
+
# Page number default is 0
|
|
49
|
+
page_number: nil,
|
|
50
|
+
# Page size default is 10 max is 100
|
|
51
|
+
page_size: nil,
|
|
52
|
+
# Filter by product ID
|
|
53
|
+
product_id: nil,
|
|
54
|
+
request_options: {}
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
sig do
|
|
59
|
+
override.returns(
|
|
60
|
+
{
|
|
61
|
+
page_number: Integer,
|
|
62
|
+
page_size: Integer,
|
|
63
|
+
product_id: String,
|
|
64
|
+
request_options: Dodopayments::RequestOptions
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
def to_hash
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
class ShortLinkListResponse < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
Dodopayments::Models::Products::ShortLinkListResponse,
|
|
11
|
+
Dodopayments::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# When the short url was created
|
|
16
|
+
sig { returns(Time) }
|
|
17
|
+
attr_accessor :created_at
|
|
18
|
+
|
|
19
|
+
# Full URL the short url redirects to
|
|
20
|
+
sig { returns(String) }
|
|
21
|
+
attr_accessor :full_url
|
|
22
|
+
|
|
23
|
+
# Product ID associated with the short link
|
|
24
|
+
sig { returns(String) }
|
|
25
|
+
attr_accessor :product_id
|
|
26
|
+
|
|
27
|
+
# Short URL
|
|
28
|
+
sig { returns(String) }
|
|
29
|
+
attr_accessor :short_url
|
|
30
|
+
|
|
31
|
+
sig do
|
|
32
|
+
params(
|
|
33
|
+
created_at: Time,
|
|
34
|
+
full_url: String,
|
|
35
|
+
product_id: String,
|
|
36
|
+
short_url: String
|
|
37
|
+
).returns(T.attached_class)
|
|
38
|
+
end
|
|
39
|
+
def self.new(
|
|
40
|
+
# When the short url was created
|
|
41
|
+
created_at:,
|
|
42
|
+
# Full URL the short url redirects to
|
|
43
|
+
full_url:,
|
|
44
|
+
# Product ID associated with the short link
|
|
45
|
+
product_id:,
|
|
46
|
+
# Short URL
|
|
47
|
+
short_url:
|
|
48
|
+
)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
sig do
|
|
52
|
+
override.returns(
|
|
53
|
+
{
|
|
54
|
+
created_at: Time,
|
|
55
|
+
full_url: String,
|
|
56
|
+
product_id: String,
|
|
57
|
+
short_url: String
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
def to_hash
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -91,10 +91,22 @@ module Dodopayments
|
|
|
91
91
|
sig { returns(T.nilable(T::Boolean)) }
|
|
92
92
|
attr_accessor :payment_link
|
|
93
93
|
|
|
94
|
+
# If true, redirects the customer immediately after payment completion False by
|
|
95
|
+
# default
|
|
96
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
97
|
+
attr_reader :redirect_immediately
|
|
98
|
+
|
|
99
|
+
sig { params(redirect_immediately: T::Boolean).void }
|
|
100
|
+
attr_writer :redirect_immediately
|
|
101
|
+
|
|
94
102
|
# Optional URL to redirect after successful subscription creation
|
|
95
103
|
sig { returns(T.nilable(String)) }
|
|
96
104
|
attr_accessor :return_url
|
|
97
105
|
|
|
106
|
+
# If true, returns a shortened payment link. Defaults to false if not specified.
|
|
107
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
108
|
+
attr_accessor :short_link
|
|
109
|
+
|
|
98
110
|
# Display saved payment methods of a returning customer False by default
|
|
99
111
|
sig { returns(T.nilable(T::Boolean)) }
|
|
100
112
|
attr_reader :show_saved_payment_methods
|
|
@@ -133,7 +145,9 @@ module Dodopayments
|
|
|
133
145
|
one_time_product_cart:
|
|
134
146
|
T.nilable(T::Array[Dodopayments::OneTimeProductCartItem::OrHash]),
|
|
135
147
|
payment_link: T.nilable(T::Boolean),
|
|
148
|
+
redirect_immediately: T::Boolean,
|
|
136
149
|
return_url: T.nilable(String),
|
|
150
|
+
short_link: T.nilable(T::Boolean),
|
|
137
151
|
show_saved_payment_methods: T::Boolean,
|
|
138
152
|
tax_id: T.nilable(String),
|
|
139
153
|
trial_period_days: T.nilable(Integer),
|
|
@@ -173,8 +187,13 @@ module Dodopayments
|
|
|
173
187
|
one_time_product_cart: nil,
|
|
174
188
|
# If true, generates a payment link. Defaults to false if not specified.
|
|
175
189
|
payment_link: nil,
|
|
190
|
+
# If true, redirects the customer immediately after payment completion False by
|
|
191
|
+
# default
|
|
192
|
+
redirect_immediately: nil,
|
|
176
193
|
# Optional URL to redirect after successful subscription creation
|
|
177
194
|
return_url: nil,
|
|
195
|
+
# If true, returns a shortened payment link. Defaults to false if not specified.
|
|
196
|
+
short_link: nil,
|
|
178
197
|
# Display saved payment methods of a returning customer False by default
|
|
179
198
|
show_saved_payment_methods: nil,
|
|
180
199
|
# Tax ID in case the payment is B2B. If tax id validation fails the payment
|
|
@@ -209,7 +228,9 @@ module Dodopayments
|
|
|
209
228
|
one_time_product_cart:
|
|
210
229
|
T.nilable(T::Array[Dodopayments::OneTimeProductCartItem]),
|
|
211
230
|
payment_link: T.nilable(T::Boolean),
|
|
231
|
+
redirect_immediately: T::Boolean,
|
|
212
232
|
return_url: T.nilable(String),
|
|
233
|
+
short_link: T.nilable(T::Boolean),
|
|
213
234
|
show_saved_payment_methods: T::Boolean,
|
|
214
235
|
tax_id: T.nilable(String),
|
|
215
236
|
trial_period_days: T.nilable(Integer),
|
|
@@ -31,6 +31,7 @@ module Dodopayments
|
|
|
31
31
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
32
32
|
minimal_address: T::Boolean,
|
|
33
33
|
return_url: T.nilable(String),
|
|
34
|
+
short_link: T::Boolean,
|
|
34
35
|
show_saved_payment_methods: T::Boolean,
|
|
35
36
|
subscription_data:
|
|
36
37
|
T.nilable(
|
|
@@ -71,6 +72,8 @@ module Dodopayments
|
|
|
71
72
|
minimal_address: nil,
|
|
72
73
|
# The url to redirect after payment failure or success.
|
|
73
74
|
return_url: nil,
|
|
75
|
+
# If true, returns a shortened checkout URL. Defaults to false if not specified.
|
|
76
|
+
short_link: nil,
|
|
74
77
|
# Display saved payment methods of a returning customer False by default
|
|
75
78
|
show_saved_payment_methods: nil,
|
|
76
79
|
subscription_data: nil,
|
|
@@ -19,7 +19,9 @@ module Dodopayments
|
|
|
19
19
|
force_3ds: T.nilable(T::Boolean),
|
|
20
20
|
metadata: T::Hash[Symbol, String],
|
|
21
21
|
payment_link: T.nilable(T::Boolean),
|
|
22
|
+
redirect_immediately: T::Boolean,
|
|
22
23
|
return_url: T.nilable(String),
|
|
24
|
+
short_link: T.nilable(T::Boolean),
|
|
23
25
|
show_saved_payment_methods: T::Boolean,
|
|
24
26
|
tax_id: T.nilable(String),
|
|
25
27
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
@@ -51,9 +53,14 @@ module Dodopayments
|
|
|
51
53
|
metadata: nil,
|
|
52
54
|
# Whether to generate a payment link. Defaults to false if not specified.
|
|
53
55
|
payment_link: nil,
|
|
56
|
+
# If true, redirects the customer immediately after payment completion False by
|
|
57
|
+
# default
|
|
58
|
+
redirect_immediately: nil,
|
|
54
59
|
# Optional URL to redirect the customer after payment. Must be a valid URL if
|
|
55
60
|
# provided.
|
|
56
61
|
return_url: nil,
|
|
62
|
+
# If true, returns a shortened payment link. Defaults to false if not specified.
|
|
63
|
+
short_link: nil,
|
|
57
64
|
# Display saved payment methods of a returning customer False by default
|
|
58
65
|
show_saved_payment_methods: nil,
|
|
59
66
|
# Tax ID in case the payment is B2B. If tax id validation fails the payment
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Resources
|
|
5
|
+
class Products
|
|
6
|
+
class ShortLinks
|
|
7
|
+
# Gives a Short Checkout URL with custom slug for a product. Uses a Static
|
|
8
|
+
# Checkout URL under the hood.
|
|
9
|
+
sig do
|
|
10
|
+
params(
|
|
11
|
+
id: String,
|
|
12
|
+
slug: String,
|
|
13
|
+
static_checkout_params: T.nilable(T::Hash[Symbol, String]),
|
|
14
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
15
|
+
).returns(Dodopayments::Models::Products::ShortLinkCreateResponse)
|
|
16
|
+
end
|
|
17
|
+
def create(
|
|
18
|
+
# Product Id
|
|
19
|
+
id,
|
|
20
|
+
# Slug for the short link.
|
|
21
|
+
slug:,
|
|
22
|
+
# Static Checkout URL parameters to apply to the resulting short URL.
|
|
23
|
+
static_checkout_params: nil,
|
|
24
|
+
request_options: {}
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Lists all short links created by the business.
|
|
29
|
+
sig do
|
|
30
|
+
params(
|
|
31
|
+
page_number: Integer,
|
|
32
|
+
page_size: Integer,
|
|
33
|
+
product_id: String,
|
|
34
|
+
request_options: Dodopayments::RequestOptions::OrHash
|
|
35
|
+
).returns(
|
|
36
|
+
Dodopayments::Internal::DefaultPageNumberPagination[
|
|
37
|
+
Dodopayments::Models::Products::ShortLinkListResponse
|
|
38
|
+
]
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
def list(
|
|
42
|
+
# Page number default is 0
|
|
43
|
+
page_number: nil,
|
|
44
|
+
# Page size default is 10 max is 100
|
|
45
|
+
page_size: nil,
|
|
46
|
+
# Filter by product ID
|
|
47
|
+
product_id: nil,
|
|
48
|
+
request_options: {}
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# @api private
|
|
53
|
+
sig { params(client: Dodopayments::Client).returns(T.attached_class) }
|
|
54
|
+
def self.new(client:)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -24,7 +24,9 @@ module Dodopayments
|
|
|
24
24
|
one_time_product_cart:
|
|
25
25
|
T.nilable(T::Array[Dodopayments::OneTimeProductCartItem::OrHash]),
|
|
26
26
|
payment_link: T.nilable(T::Boolean),
|
|
27
|
+
redirect_immediately: T::Boolean,
|
|
27
28
|
return_url: T.nilable(String),
|
|
29
|
+
short_link: T.nilable(T::Boolean),
|
|
28
30
|
show_saved_payment_methods: T::Boolean,
|
|
29
31
|
tax_id: T.nilable(String),
|
|
30
32
|
trial_period_days: T.nilable(Integer),
|
|
@@ -64,8 +66,13 @@ module Dodopayments
|
|
|
64
66
|
one_time_product_cart: nil,
|
|
65
67
|
# If true, generates a payment link. Defaults to false if not specified.
|
|
66
68
|
payment_link: nil,
|
|
69
|
+
# If true, redirects the customer immediately after payment completion False by
|
|
70
|
+
# default
|
|
71
|
+
redirect_immediately: nil,
|
|
67
72
|
# Optional URL to redirect after successful subscription creation
|
|
68
73
|
return_url: nil,
|
|
74
|
+
# If true, returns a shortened payment link. Defaults to false if not specified.
|
|
75
|
+
short_link: nil,
|
|
69
76
|
# Display saved payment methods of a returning customer False by default
|
|
70
77
|
show_saved_payment_methods: nil,
|
|
71
78
|
# Tax ID in case the payment is B2B. If tax id validation fails the payment
|
|
@@ -15,6 +15,7 @@ module Dodopayments
|
|
|
15
15
|
metadata: ::Hash[Symbol, String]?,
|
|
16
16
|
minimal_address: bool,
|
|
17
17
|
return_url: String?,
|
|
18
|
+
short_link: bool,
|
|
18
19
|
show_saved_payment_methods: bool,
|
|
19
20
|
subscription_data: Dodopayments::CheckoutSessionRequest::SubscriptionData?
|
|
20
21
|
}
|
|
@@ -58,6 +59,10 @@ module Dodopayments
|
|
|
58
59
|
|
|
59
60
|
attr_accessor return_url: String?
|
|
60
61
|
|
|
62
|
+
attr_reader short_link: bool?
|
|
63
|
+
|
|
64
|
+
def short_link=: (bool) -> bool
|
|
65
|
+
|
|
61
66
|
attr_reader show_saved_payment_methods: bool?
|
|
62
67
|
|
|
63
68
|
def show_saved_payment_methods=: (bool) -> bool
|
|
@@ -78,6 +83,7 @@ module Dodopayments
|
|
|
78
83
|
?metadata: ::Hash[Symbol, String]?,
|
|
79
84
|
?minimal_address: bool,
|
|
80
85
|
?return_url: String?,
|
|
86
|
+
?short_link: bool,
|
|
81
87
|
?show_saved_payment_methods: bool,
|
|
82
88
|
?subscription_data: Dodopayments::CheckoutSessionRequest::SubscriptionData?
|
|
83
89
|
) -> void
|
|
@@ -96,6 +102,7 @@ module Dodopayments
|
|
|
96
102
|
metadata: ::Hash[Symbol, String]?,
|
|
97
103
|
minimal_address: bool,
|
|
98
104
|
return_url: String?,
|
|
105
|
+
short_link: bool,
|
|
99
106
|
show_saved_payment_methods: bool,
|
|
100
107
|
subscription_data: Dodopayments::CheckoutSessionRequest::SubscriptionData?
|
|
101
108
|
}
|
|
@@ -234,7 +241,8 @@ module Dodopayments
|
|
|
234
241
|
allow_discount_code: bool,
|
|
235
242
|
allow_phone_number_collection: bool,
|
|
236
243
|
allow_tax_id: bool,
|
|
237
|
-
always_create_new_customer: bool
|
|
244
|
+
always_create_new_customer: bool,
|
|
245
|
+
redirect_immediately: bool
|
|
238
246
|
}
|
|
239
247
|
|
|
240
248
|
class FeatureFlags < Dodopayments::Internal::Type::BaseModel
|
|
@@ -286,6 +294,10 @@ module Dodopayments
|
|
|
286
294
|
|
|
287
295
|
def always_create_new_customer=: (bool) -> bool
|
|
288
296
|
|
|
297
|
+
attr_reader redirect_immediately: bool?
|
|
298
|
+
|
|
299
|
+
def redirect_immediately=: (bool) -> bool
|
|
300
|
+
|
|
289
301
|
def initialize: (
|
|
290
302
|
?allow_currency_selection: bool,
|
|
291
303
|
?allow_customer_editing_city: bool,
|
|
@@ -298,7 +310,8 @@ module Dodopayments
|
|
|
298
310
|
?allow_discount_code: bool,
|
|
299
311
|
?allow_phone_number_collection: bool,
|
|
300
312
|
?allow_tax_id: bool,
|
|
301
|
-
?always_create_new_customer: bool
|
|
313
|
+
?always_create_new_customer: bool,
|
|
314
|
+
?redirect_immediately: bool
|
|
302
315
|
) -> void
|
|
303
316
|
|
|
304
317
|
def to_hash: -> {
|
|
@@ -313,7 +326,8 @@ module Dodopayments
|
|
|
313
326
|
allow_discount_code: bool,
|
|
314
327
|
allow_phone_number_collection: bool,
|
|
315
328
|
allow_tax_id: bool,
|
|
316
|
-
always_create_new_customer: bool
|
|
329
|
+
always_create_new_customer: bool,
|
|
330
|
+
redirect_immediately: bool
|
|
317
331
|
}
|
|
318
332
|
end
|
|
319
333
|
|
|
@@ -11,7 +11,9 @@ module Dodopayments
|
|
|
11
11
|
:force_3ds => bool?,
|
|
12
12
|
metadata: ::Hash[Symbol, String],
|
|
13
13
|
payment_link: bool?,
|
|
14
|
+
redirect_immediately: bool,
|
|
14
15
|
return_url: String?,
|
|
16
|
+
short_link: bool?,
|
|
15
17
|
show_saved_payment_methods: bool,
|
|
16
18
|
tax_id: String?
|
|
17
19
|
}
|
|
@@ -41,8 +43,14 @@ module Dodopayments
|
|
|
41
43
|
|
|
42
44
|
attr_accessor payment_link: bool?
|
|
43
45
|
|
|
46
|
+
attr_reader redirect_immediately: bool?
|
|
47
|
+
|
|
48
|
+
def redirect_immediately=: (bool) -> bool
|
|
49
|
+
|
|
44
50
|
attr_accessor return_url: String?
|
|
45
51
|
|
|
52
|
+
attr_accessor short_link: bool?
|
|
53
|
+
|
|
46
54
|
attr_reader show_saved_payment_methods: bool?
|
|
47
55
|
|
|
48
56
|
def show_saved_payment_methods=: (bool) -> bool
|
|
@@ -59,7 +67,9 @@ module Dodopayments
|
|
|
59
67
|
?force_3ds: bool?,
|
|
60
68
|
?metadata: ::Hash[Symbol, String],
|
|
61
69
|
?payment_link: bool?,
|
|
70
|
+
?redirect_immediately: bool,
|
|
62
71
|
?return_url: String?,
|
|
72
|
+
?short_link: bool?,
|
|
63
73
|
?show_saved_payment_methods: bool,
|
|
64
74
|
?tax_id: String?,
|
|
65
75
|
?request_options: Dodopayments::request_opts
|
|
@@ -75,7 +85,9 @@ module Dodopayments
|
|
|
75
85
|
:force_3ds => bool?,
|
|
76
86
|
metadata: ::Hash[Symbol, String],
|
|
77
87
|
payment_link: bool?,
|
|
88
|
+
redirect_immediately: bool,
|
|
78
89
|
return_url: String?,
|
|
90
|
+
short_link: bool?,
|
|
79
91
|
show_saved_payment_methods: bool,
|
|
80
92
|
tax_id: String?,
|
|
81
93
|
request_options: Dodopayments::RequestOptions
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module Dodopayments
|
|
2
|
+
module Models
|
|
3
|
+
module Products
|
|
4
|
+
type short_link_create_params =
|
|
5
|
+
{ slug: String, static_checkout_params: ::Hash[Symbol, String]? }
|
|
6
|
+
& Dodopayments::Internal::Type::request_parameters
|
|
7
|
+
|
|
8
|
+
class ShortLinkCreateParams < Dodopayments::Internal::Type::BaseModel
|
|
9
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
10
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
11
|
+
|
|
12
|
+
attr_accessor slug: String
|
|
13
|
+
|
|
14
|
+
attr_accessor static_checkout_params: ::Hash[Symbol, String]?
|
|
15
|
+
|
|
16
|
+
def initialize: (
|
|
17
|
+
slug: String,
|
|
18
|
+
?static_checkout_params: ::Hash[Symbol, String]?,
|
|
19
|
+
?request_options: Dodopayments::request_opts
|
|
20
|
+
) -> void
|
|
21
|
+
|
|
22
|
+
def to_hash: -> {
|
|
23
|
+
slug: String,
|
|
24
|
+
static_checkout_params: ::Hash[Symbol, String]?,
|
|
25
|
+
request_options: Dodopayments::RequestOptions
|
|
26
|
+
}
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Dodopayments
|
|
2
|
+
module Models
|
|
3
|
+
module Products
|
|
4
|
+
type short_link_create_response = { full_url: String, short_url: String }
|
|
5
|
+
|
|
6
|
+
class ShortLinkCreateResponse < Dodopayments::Internal::Type::BaseModel
|
|
7
|
+
attr_accessor full_url: String
|
|
8
|
+
|
|
9
|
+
attr_accessor short_url: String
|
|
10
|
+
|
|
11
|
+
def initialize: (full_url: String, short_url: String) -> void
|
|
12
|
+
|
|
13
|
+
def to_hash: -> { full_url: String, short_url: String }
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|