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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fbc15aac4003caa6999329abf8f850019c1a060baa5f63dd8fa54b750a28ce22
|
|
4
|
+
data.tar.gz: 2824c3ce1a598275daee61e42e359514603e3d7484ba4eaa202c4d1c57ca5cbb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd280f7ac3569ebeb254d5401e7dd299581a97ce40fb8d1fda64d0eb9d12c98da51e909e4ec94bead4f9b74e1e5475b5dfa880b8f8935949cf4264c02568b366
|
|
7
|
+
data.tar.gz: 6f0c878bdc2ab7f47cc3ae11fba94f4fa71d42b0b42cb7a8949b0c2a03f5854972882845a00ea61281c0b029222ccb6853dfdf1b68ad603bd4b34430ac6975e0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.69.0 (2025-12-23)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.68.0...v1.69.0](https://github.com/dodopayments/dodopayments-ruby/compare/v1.68.0...v1.69.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([702b110](https://github.com/dodopayments/dodopayments-ruby/commit/702b110a222abca719163c70b74ac5be66bee79f))
|
|
10
|
+
|
|
11
|
+
## 1.68.0 (2025-12-19)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v1.67.2...v1.68.0](https://github.com/dodopayments/dodopayments-ruby/compare/v1.67.2...v1.68.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** updated openapi spec to v1.68.4 ([668ee05](https://github.com/dodopayments/dodopayments-ruby/commit/668ee05b1a74d277f8cf208a29f987d11f549ee0))
|
|
18
|
+
|
|
3
19
|
## 1.67.2 (2025-12-19)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v1.67.1...v1.67.2](https://github.com/dodopayments/dodopayments-ruby/compare/v1.67.1...v1.67.2)
|
data/README.md
CHANGED
|
@@ -89,6 +89,12 @@ module Dodopayments
|
|
|
89
89
|
# @return [String, nil]
|
|
90
90
|
optional :return_url, String, nil?: true
|
|
91
91
|
|
|
92
|
+
# @!attribute short_link
|
|
93
|
+
# If true, returns a shortened checkout URL. Defaults to false if not specified.
|
|
94
|
+
#
|
|
95
|
+
# @return [Boolean, nil]
|
|
96
|
+
optional :short_link, Dodopayments::Internal::Type::Boolean
|
|
97
|
+
|
|
92
98
|
# @!attribute show_saved_payment_methods
|
|
93
99
|
# Display saved payment methods of a returning customer False by default
|
|
94
100
|
#
|
|
@@ -100,7 +106,7 @@ module Dodopayments
|
|
|
100
106
|
# @return [Dodopayments::Models::CheckoutSessionRequest::SubscriptionData, nil]
|
|
101
107
|
optional :subscription_data, -> { Dodopayments::CheckoutSessionRequest::SubscriptionData }, nil?: true
|
|
102
108
|
|
|
103
|
-
# @!method initialize(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, confirm: nil, customer: nil, customization: nil, discount_code: nil, feature_flags: nil, force_3ds: nil, metadata: nil, minimal_address: nil, return_url: nil, show_saved_payment_methods: nil, subscription_data: nil)
|
|
109
|
+
# @!method initialize(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, confirm: nil, customer: nil, customization: nil, discount_code: nil, feature_flags: nil, force_3ds: nil, metadata: nil, minimal_address: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, subscription_data: nil)
|
|
104
110
|
# Some parameter documentations has been truncated, see
|
|
105
111
|
# {Dodopayments::Models::CheckoutSessionRequest} for more details.
|
|
106
112
|
#
|
|
@@ -130,6 +136,8 @@ module Dodopayments
|
|
|
130
136
|
#
|
|
131
137
|
# @param return_url [String, nil] The url to redirect after payment failure or success.
|
|
132
138
|
#
|
|
139
|
+
# @param short_link [Boolean] If true, returns a shortened checkout URL.
|
|
140
|
+
#
|
|
133
141
|
# @param show_saved_payment_methods [Boolean] Display saved payment methods of a returning customer False by default
|
|
134
142
|
#
|
|
135
143
|
# @param subscription_data [Dodopayments::Models::CheckoutSessionRequest::SubscriptionData, nil]
|
|
@@ -364,7 +372,15 @@ module Dodopayments
|
|
|
364
372
|
# @return [Boolean, nil]
|
|
365
373
|
optional :always_create_new_customer, Dodopayments::Internal::Type::Boolean
|
|
366
374
|
|
|
367
|
-
# @!
|
|
375
|
+
# @!attribute redirect_immediately
|
|
376
|
+
# If true, redirects the customer immediately after payment completion
|
|
377
|
+
#
|
|
378
|
+
# Default is false
|
|
379
|
+
#
|
|
380
|
+
# @return [Boolean, nil]
|
|
381
|
+
optional :redirect_immediately, Dodopayments::Internal::Type::Boolean
|
|
382
|
+
|
|
383
|
+
# @!method initialize(allow_currency_selection: nil, allow_customer_editing_city: nil, allow_customer_editing_country: nil, allow_customer_editing_email: nil, allow_customer_editing_name: nil, allow_customer_editing_state: nil, allow_customer_editing_street: nil, allow_customer_editing_zipcode: nil, allow_discount_code: nil, allow_phone_number_collection: nil, allow_tax_id: nil, always_create_new_customer: nil, redirect_immediately: nil)
|
|
368
384
|
# Some parameter documentations has been truncated, see
|
|
369
385
|
# {Dodopayments::Models::CheckoutSessionRequest::FeatureFlags} for more details.
|
|
370
386
|
#
|
|
@@ -391,6 +407,8 @@ module Dodopayments
|
|
|
391
407
|
# @param allow_tax_id [Boolean] If the customer is allowed to add tax id, set it to true
|
|
392
408
|
#
|
|
393
409
|
# @param always_create_new_customer [Boolean] Set to true if a new customer object should be created.
|
|
410
|
+
#
|
|
411
|
+
# @param redirect_immediately [Boolean] If true, redirects the customer immediately after payment completion
|
|
394
412
|
end
|
|
395
413
|
|
|
396
414
|
# @see Dodopayments::Models::CheckoutSessionRequest#subscription_data
|
|
@@ -70,6 +70,13 @@ module Dodopayments
|
|
|
70
70
|
# @return [Boolean, nil]
|
|
71
71
|
optional :payment_link, Dodopayments::Internal::Type::Boolean, nil?: true
|
|
72
72
|
|
|
73
|
+
# @!attribute redirect_immediately
|
|
74
|
+
# If true, redirects the customer immediately after payment completion False by
|
|
75
|
+
# default
|
|
76
|
+
#
|
|
77
|
+
# @return [Boolean, nil]
|
|
78
|
+
optional :redirect_immediately, Dodopayments::Internal::Type::Boolean
|
|
79
|
+
|
|
73
80
|
# @!attribute return_url
|
|
74
81
|
# Optional URL to redirect the customer after payment. Must be a valid URL if
|
|
75
82
|
# provided.
|
|
@@ -77,6 +84,12 @@ module Dodopayments
|
|
|
77
84
|
# @return [String, nil]
|
|
78
85
|
optional :return_url, String, nil?: true
|
|
79
86
|
|
|
87
|
+
# @!attribute short_link
|
|
88
|
+
# If true, returns a shortened payment link. Defaults to false if not specified.
|
|
89
|
+
#
|
|
90
|
+
# @return [Boolean, nil]
|
|
91
|
+
optional :short_link, Dodopayments::Internal::Type::Boolean, nil?: true
|
|
92
|
+
|
|
80
93
|
# @!attribute show_saved_payment_methods
|
|
81
94
|
# Display saved payment methods of a returning customer False by default
|
|
82
95
|
#
|
|
@@ -90,7 +103,7 @@ module Dodopayments
|
|
|
90
103
|
# @return [String, nil]
|
|
91
104
|
optional :tax_id, String, nil?: true
|
|
92
105
|
|
|
93
|
-
# @!method initialize(billing:, customer:, product_cart:, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, metadata: nil, payment_link: nil, return_url: nil, show_saved_payment_methods: nil, tax_id: nil, request_options: {})
|
|
106
|
+
# @!method initialize(billing:, customer:, product_cart:, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, metadata: nil, payment_link: nil, redirect_immediately: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, tax_id: nil, request_options: {})
|
|
94
107
|
# Some parameter documentations has been truncated, see
|
|
95
108
|
# {Dodopayments::Models::PaymentCreateParams} for more details.
|
|
96
109
|
#
|
|
@@ -112,8 +125,12 @@ module Dodopayments
|
|
|
112
125
|
#
|
|
113
126
|
# @param payment_link [Boolean, nil] Whether to generate a payment link. Defaults to false if not specified.
|
|
114
127
|
#
|
|
128
|
+
# @param redirect_immediately [Boolean] If true, redirects the customer immediately after payment completion
|
|
129
|
+
#
|
|
115
130
|
# @param return_url [String, nil] Optional URL to redirect the customer after payment.
|
|
116
131
|
#
|
|
132
|
+
# @param short_link [Boolean, nil] If true, returns a shortened payment link.
|
|
133
|
+
#
|
|
117
134
|
# @param show_saved_payment_methods [Boolean] Display saved payment methods of a returning customer
|
|
118
135
|
#
|
|
119
136
|
# @param tax_id [String, nil] Tax ID in case the payment is B2B. If tax id validation fails the payment creati
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
# @see Dodopayments::Resources::Products::ShortLinks#create
|
|
7
|
+
class ShortLinkCreateParams < Dodopayments::Internal::Type::BaseModel
|
|
8
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute slug
|
|
12
|
+
# Slug for the short link.
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :slug, String
|
|
16
|
+
|
|
17
|
+
# @!attribute static_checkout_params
|
|
18
|
+
# Static Checkout URL parameters to apply to the resulting short URL.
|
|
19
|
+
#
|
|
20
|
+
# @return [Hash{Symbol=>String}, nil]
|
|
21
|
+
optional :static_checkout_params, Dodopayments::Internal::Type::HashOf[String], nil?: true
|
|
22
|
+
|
|
23
|
+
# @!method initialize(slug:, static_checkout_params: nil, request_options: {})
|
|
24
|
+
# Some parameter documentations has been truncated, see
|
|
25
|
+
# {Dodopayments::Models::Products::ShortLinkCreateParams} for more details.
|
|
26
|
+
#
|
|
27
|
+
# @param slug [String] Slug for the short link.
|
|
28
|
+
#
|
|
29
|
+
# @param static_checkout_params [Hash{Symbol=>String}, nil] Static Checkout URL parameters to apply to the resulting
|
|
30
|
+
#
|
|
31
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
# @see Dodopayments::Resources::Products::ShortLinks#create
|
|
7
|
+
class ShortLinkCreateResponse < Dodopayments::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute full_url
|
|
9
|
+
# Full URL.
|
|
10
|
+
#
|
|
11
|
+
# @return [String]
|
|
12
|
+
required :full_url, String
|
|
13
|
+
|
|
14
|
+
# @!attribute short_url
|
|
15
|
+
# Short URL.
|
|
16
|
+
#
|
|
17
|
+
# @return [String]
|
|
18
|
+
required :short_url, String
|
|
19
|
+
|
|
20
|
+
# @!method initialize(full_url:, short_url:)
|
|
21
|
+
# @param full_url [String] Full URL.
|
|
22
|
+
#
|
|
23
|
+
# @param short_url [String] Short URL.
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
# @see Dodopayments::Resources::Products::ShortLinks#list
|
|
7
|
+
class ShortLinkListParams < Dodopayments::Internal::Type::BaseModel
|
|
8
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute page_number
|
|
12
|
+
# Page number default is 0
|
|
13
|
+
#
|
|
14
|
+
# @return [Integer, nil]
|
|
15
|
+
optional :page_number, Integer
|
|
16
|
+
|
|
17
|
+
# @!attribute page_size
|
|
18
|
+
# Page size default is 10 max is 100
|
|
19
|
+
#
|
|
20
|
+
# @return [Integer, nil]
|
|
21
|
+
optional :page_size, Integer
|
|
22
|
+
|
|
23
|
+
# @!attribute product_id
|
|
24
|
+
# Filter by product ID
|
|
25
|
+
#
|
|
26
|
+
# @return [String, nil]
|
|
27
|
+
optional :product_id, String
|
|
28
|
+
|
|
29
|
+
# @!method initialize(page_number: nil, page_size: nil, product_id: nil, request_options: {})
|
|
30
|
+
# @param page_number [Integer] Page number default is 0
|
|
31
|
+
#
|
|
32
|
+
# @param page_size [Integer] Page size default is 10 max is 100
|
|
33
|
+
#
|
|
34
|
+
# @param product_id [String] Filter by product ID
|
|
35
|
+
#
|
|
36
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
module Products
|
|
6
|
+
# @see Dodopayments::Resources::Products::ShortLinks#list
|
|
7
|
+
class ShortLinkListResponse < Dodopayments::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute created_at
|
|
9
|
+
# When the short url was created
|
|
10
|
+
#
|
|
11
|
+
# @return [Time]
|
|
12
|
+
required :created_at, Time
|
|
13
|
+
|
|
14
|
+
# @!attribute full_url
|
|
15
|
+
# Full URL the short url redirects to
|
|
16
|
+
#
|
|
17
|
+
# @return [String]
|
|
18
|
+
required :full_url, String
|
|
19
|
+
|
|
20
|
+
# @!attribute product_id
|
|
21
|
+
# Product ID associated with the short link
|
|
22
|
+
#
|
|
23
|
+
# @return [String]
|
|
24
|
+
required :product_id, String
|
|
25
|
+
|
|
26
|
+
# @!attribute short_url
|
|
27
|
+
# Short URL
|
|
28
|
+
#
|
|
29
|
+
# @return [String]
|
|
30
|
+
required :short_url, String
|
|
31
|
+
|
|
32
|
+
# @!method initialize(created_at:, full_url:, product_id:, short_url:)
|
|
33
|
+
# @param created_at [Time] When the short url was created
|
|
34
|
+
#
|
|
35
|
+
# @param full_url [String] Full URL the short url redirects to
|
|
36
|
+
#
|
|
37
|
+
# @param product_id [String] Product ID associated with the short link
|
|
38
|
+
#
|
|
39
|
+
# @param short_url [String] Short URL
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -95,12 +95,25 @@ module Dodopayments
|
|
|
95
95
|
# @return [Boolean, nil]
|
|
96
96
|
optional :payment_link, Dodopayments::Internal::Type::Boolean, nil?: true
|
|
97
97
|
|
|
98
|
+
# @!attribute redirect_immediately
|
|
99
|
+
# If true, redirects the customer immediately after payment completion False by
|
|
100
|
+
# default
|
|
101
|
+
#
|
|
102
|
+
# @return [Boolean, nil]
|
|
103
|
+
optional :redirect_immediately, Dodopayments::Internal::Type::Boolean
|
|
104
|
+
|
|
98
105
|
# @!attribute return_url
|
|
99
106
|
# Optional URL to redirect after successful subscription creation
|
|
100
107
|
#
|
|
101
108
|
# @return [String, nil]
|
|
102
109
|
optional :return_url, String, nil?: true
|
|
103
110
|
|
|
111
|
+
# @!attribute short_link
|
|
112
|
+
# If true, returns a shortened payment link. Defaults to false if not specified.
|
|
113
|
+
#
|
|
114
|
+
# @return [Boolean, nil]
|
|
115
|
+
optional :short_link, Dodopayments::Internal::Type::Boolean, nil?: true
|
|
116
|
+
|
|
104
117
|
# @!attribute show_saved_payment_methods
|
|
105
118
|
# Display saved payment methods of a returning customer False by default
|
|
106
119
|
#
|
|
@@ -121,7 +134,7 @@ module Dodopayments
|
|
|
121
134
|
# @return [Integer, nil]
|
|
122
135
|
optional :trial_period_days, Integer, nil?: true
|
|
123
136
|
|
|
124
|
-
# @!method initialize(billing:, customer:, product_id:, quantity:, addons: nil, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, metadata: nil, on_demand: nil, one_time_product_cart: nil, payment_link: nil, return_url: nil, show_saved_payment_methods: nil, tax_id: nil, trial_period_days: nil, request_options: {})
|
|
137
|
+
# @!method initialize(billing:, customer:, product_id:, quantity:, addons: nil, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, metadata: nil, on_demand: nil, one_time_product_cart: nil, payment_link: nil, redirect_immediately: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, tax_id: nil, trial_period_days: nil, request_options: {})
|
|
125
138
|
# Some parameter documentations has been truncated, see
|
|
126
139
|
# {Dodopayments::Models::SubscriptionCreateParams} for more details.
|
|
127
140
|
#
|
|
@@ -151,8 +164,12 @@ module Dodopayments
|
|
|
151
164
|
#
|
|
152
165
|
# @param payment_link [Boolean, nil] If true, generates a payment link.
|
|
153
166
|
#
|
|
167
|
+
# @param redirect_immediately [Boolean] If true, redirects the customer immediately after payment completion
|
|
168
|
+
#
|
|
154
169
|
# @param return_url [String, nil] Optional URL to redirect after successful subscription creation
|
|
155
170
|
#
|
|
171
|
+
# @param short_link [Boolean, nil] If true, returns a shortened payment link.
|
|
172
|
+
#
|
|
156
173
|
# @param show_saved_payment_methods [Boolean] Display saved payment methods of a returning customer
|
|
157
174
|
#
|
|
158
175
|
# @param tax_id [String, nil] Tax ID in case the payment is B2B. If tax id validation fails the payment creati
|
|
@@ -6,7 +6,7 @@ module Dodopayments
|
|
|
6
6
|
# Some parameter documentations has been truncated, see
|
|
7
7
|
# {Dodopayments::Models::CheckoutSessionCreateParams} for more details.
|
|
8
8
|
#
|
|
9
|
-
# @overload create(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, confirm: nil, customer: nil, customization: nil, discount_code: nil, feature_flags: nil, force_3ds: nil, metadata: nil, minimal_address: nil, return_url: nil, show_saved_payment_methods: nil, subscription_data: nil, request_options: {})
|
|
9
|
+
# @overload create(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, confirm: nil, customer: nil, customization: nil, discount_code: nil, feature_flags: nil, force_3ds: nil, metadata: nil, minimal_address: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, subscription_data: nil, request_options: {})
|
|
10
10
|
#
|
|
11
11
|
# @param product_cart [Array<Dodopayments::Models::CheckoutSessionRequest::ProductCart>]
|
|
12
12
|
#
|
|
@@ -34,6 +34,8 @@ module Dodopayments
|
|
|
34
34
|
#
|
|
35
35
|
# @param return_url [String, nil] The url to redirect after payment failure or success.
|
|
36
36
|
#
|
|
37
|
+
# @param short_link [Boolean] If true, returns a shortened checkout URL.
|
|
38
|
+
#
|
|
37
39
|
# @param show_saved_payment_methods [Boolean] Display saved payment methods of a returning customer False by default
|
|
38
40
|
#
|
|
39
41
|
# @param subscription_data [Dodopayments::Models::CheckoutSessionRequest::SubscriptionData, nil]
|
|
@@ -8,7 +8,7 @@ module Dodopayments
|
|
|
8
8
|
# Some parameter documentations has been truncated, see
|
|
9
9
|
# {Dodopayments::Models::PaymentCreateParams} for more details.
|
|
10
10
|
#
|
|
11
|
-
# @overload create(billing:, customer:, product_cart:, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, metadata: nil, payment_link: nil, return_url: nil, show_saved_payment_methods: nil, tax_id: nil, request_options: {})
|
|
11
|
+
# @overload create(billing:, customer:, product_cart:, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, metadata: nil, payment_link: nil, redirect_immediately: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, tax_id: nil, request_options: {})
|
|
12
12
|
#
|
|
13
13
|
# @param billing [Dodopayments::Models::BillingAddress] Billing address details for the payment
|
|
14
14
|
#
|
|
@@ -28,8 +28,12 @@ module Dodopayments
|
|
|
28
28
|
#
|
|
29
29
|
# @param payment_link [Boolean, nil] Whether to generate a payment link. Defaults to false if not specified.
|
|
30
30
|
#
|
|
31
|
+
# @param redirect_immediately [Boolean] If true, redirects the customer immediately after payment completion
|
|
32
|
+
#
|
|
31
33
|
# @param return_url [String, nil] Optional URL to redirect the customer after payment.
|
|
32
34
|
#
|
|
35
|
+
# @param short_link [Boolean, nil] If true, returns a shortened payment link.
|
|
36
|
+
#
|
|
33
37
|
# @param show_saved_payment_methods [Boolean] Display saved payment methods of a returning customer
|
|
34
38
|
#
|
|
35
39
|
# @param tax_id [String, nil] Tax ID in case the payment is B2B. If tax id validation fails the payment creati
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Resources
|
|
5
|
+
class Products
|
|
6
|
+
class ShortLinks
|
|
7
|
+
# Some parameter documentations has been truncated, see
|
|
8
|
+
# {Dodopayments::Models::Products::ShortLinkCreateParams} for more details.
|
|
9
|
+
#
|
|
10
|
+
# Gives a Short Checkout URL with custom slug for a product. Uses a Static
|
|
11
|
+
# Checkout URL under the hood.
|
|
12
|
+
#
|
|
13
|
+
# @overload create(id, slug:, static_checkout_params: nil, request_options: {})
|
|
14
|
+
#
|
|
15
|
+
# @param id [String] Product Id
|
|
16
|
+
#
|
|
17
|
+
# @param slug [String] Slug for the short link.
|
|
18
|
+
#
|
|
19
|
+
# @param static_checkout_params [Hash{Symbol=>String}, nil] Static Checkout URL parameters to apply to the resulting
|
|
20
|
+
#
|
|
21
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
22
|
+
#
|
|
23
|
+
# @return [Dodopayments::Models::Products::ShortLinkCreateResponse]
|
|
24
|
+
#
|
|
25
|
+
# @see Dodopayments::Models::Products::ShortLinkCreateParams
|
|
26
|
+
def create(id, params)
|
|
27
|
+
parsed, options = Dodopayments::Products::ShortLinkCreateParams.dump_request(params)
|
|
28
|
+
@client.request(
|
|
29
|
+
method: :post,
|
|
30
|
+
path: ["products/%1$s/short_links", id],
|
|
31
|
+
body: parsed,
|
|
32
|
+
model: Dodopayments::Models::Products::ShortLinkCreateResponse,
|
|
33
|
+
options: options
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Lists all short links created by the business.
|
|
38
|
+
#
|
|
39
|
+
# @overload list(page_number: nil, page_size: nil, product_id: nil, request_options: {})
|
|
40
|
+
#
|
|
41
|
+
# @param page_number [Integer] Page number default is 0
|
|
42
|
+
#
|
|
43
|
+
# @param page_size [Integer] Page size default is 10 max is 100
|
|
44
|
+
#
|
|
45
|
+
# @param product_id [String] Filter by product ID
|
|
46
|
+
#
|
|
47
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
48
|
+
#
|
|
49
|
+
# @return [Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::Products::ShortLinkListResponse>]
|
|
50
|
+
#
|
|
51
|
+
# @see Dodopayments::Models::Products::ShortLinkListParams
|
|
52
|
+
def list(params = {})
|
|
53
|
+
parsed, options = Dodopayments::Products::ShortLinkListParams.dump_request(params)
|
|
54
|
+
@client.request(
|
|
55
|
+
method: :get,
|
|
56
|
+
path: "products/short_links",
|
|
57
|
+
query: parsed,
|
|
58
|
+
page: Dodopayments::Internal::DefaultPageNumberPagination,
|
|
59
|
+
model: Dodopayments::Models::Products::ShortLinkListResponse,
|
|
60
|
+
options: options
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# @api private
|
|
65
|
+
#
|
|
66
|
+
# @param client [Dodopayments::Client]
|
|
67
|
+
def initialize(client:)
|
|
68
|
+
@client = client
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -6,6 +6,9 @@ module Dodopayments
|
|
|
6
6
|
# @return [Dodopayments::Resources::Products::Images]
|
|
7
7
|
attr_reader :images
|
|
8
8
|
|
|
9
|
+
# @return [Dodopayments::Resources::Products::ShortLinks]
|
|
10
|
+
attr_reader :short_links
|
|
11
|
+
|
|
9
12
|
# Some parameter documentations has been truncated, see
|
|
10
13
|
# {Dodopayments::Models::ProductCreateParams} for more details.
|
|
11
14
|
#
|
|
@@ -212,6 +215,7 @@ module Dodopayments
|
|
|
212
215
|
def initialize(client:)
|
|
213
216
|
@client = client
|
|
214
217
|
@images = Dodopayments::Resources::Products::Images.new(client: client)
|
|
218
|
+
@short_links = Dodopayments::Resources::Products::ShortLinks.new(client: client)
|
|
215
219
|
end
|
|
216
220
|
end
|
|
217
221
|
end
|
|
@@ -8,7 +8,7 @@ module Dodopayments
|
|
|
8
8
|
# Some parameter documentations has been truncated, see
|
|
9
9
|
# {Dodopayments::Models::SubscriptionCreateParams} for more details.
|
|
10
10
|
#
|
|
11
|
-
# @overload create(billing:, customer:, product_id:, quantity:, addons: nil, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, metadata: nil, on_demand: nil, one_time_product_cart: nil, payment_link: nil, return_url: nil, show_saved_payment_methods: nil, tax_id: nil, trial_period_days: nil, request_options: {})
|
|
11
|
+
# @overload create(billing:, customer:, product_id:, quantity:, addons: nil, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, metadata: nil, on_demand: nil, one_time_product_cart: nil, payment_link: nil, redirect_immediately: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, tax_id: nil, trial_period_days: nil, request_options: {})
|
|
12
12
|
#
|
|
13
13
|
# @param billing [Dodopayments::Models::BillingAddress] Billing address information for the subscription
|
|
14
14
|
#
|
|
@@ -36,8 +36,12 @@ module Dodopayments
|
|
|
36
36
|
#
|
|
37
37
|
# @param payment_link [Boolean, nil] If true, generates a payment link.
|
|
38
38
|
#
|
|
39
|
+
# @param redirect_immediately [Boolean] If true, redirects the customer immediately after payment completion
|
|
40
|
+
#
|
|
39
41
|
# @param return_url [String, nil] Optional URL to redirect after successful subscription creation
|
|
40
42
|
#
|
|
43
|
+
# @param short_link [Boolean, nil] If true, returns a shortened payment link.
|
|
44
|
+
#
|
|
41
45
|
# @param show_saved_payment_methods [Boolean] Display saved payment methods of a returning customer
|
|
42
46
|
#
|
|
43
47
|
# @param tax_id [String, nil] Tax ID in case the payment is B2B. If tax id validation fails the payment creati
|
data/lib/dodopayments/version.rb
CHANGED
data/lib/dodopayments.rb
CHANGED
|
@@ -192,6 +192,10 @@ require_relative "dodopayments/models/product_list_response"
|
|
|
192
192
|
require_relative "dodopayments/models/product_retrieve_params"
|
|
193
193
|
require_relative "dodopayments/models/products/image_update_params"
|
|
194
194
|
require_relative "dodopayments/models/products/image_update_response"
|
|
195
|
+
require_relative "dodopayments/models/products/short_link_create_params"
|
|
196
|
+
require_relative "dodopayments/models/products/short_link_create_response"
|
|
197
|
+
require_relative "dodopayments/models/products/short_link_list_params"
|
|
198
|
+
require_relative "dodopayments/models/products/short_link_list_response"
|
|
195
199
|
require_relative "dodopayments/models/product_unarchive_params"
|
|
196
200
|
require_relative "dodopayments/models/product_update_files_params"
|
|
197
201
|
require_relative "dodopayments/models/product_update_files_response"
|
|
@@ -281,6 +285,7 @@ require_relative "dodopayments/resources/payments"
|
|
|
281
285
|
require_relative "dodopayments/resources/payouts"
|
|
282
286
|
require_relative "dodopayments/resources/products"
|
|
283
287
|
require_relative "dodopayments/resources/products/images"
|
|
288
|
+
require_relative "dodopayments/resources/products/short_links"
|
|
284
289
|
require_relative "dodopayments/resources/refunds"
|
|
285
290
|
require_relative "dodopayments/resources/subscriptions"
|
|
286
291
|
require_relative "dodopayments/resources/usage_events"
|
|
@@ -119,6 +119,13 @@ module Dodopayments
|
|
|
119
119
|
sig { returns(T.nilable(String)) }
|
|
120
120
|
attr_accessor :return_url
|
|
121
121
|
|
|
122
|
+
# If true, returns a shortened checkout URL. Defaults to false if not specified.
|
|
123
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
124
|
+
attr_reader :short_link
|
|
125
|
+
|
|
126
|
+
sig { params(short_link: T::Boolean).void }
|
|
127
|
+
attr_writer :short_link
|
|
128
|
+
|
|
122
129
|
# Display saved payment methods of a returning customer False by default
|
|
123
130
|
sig { returns(T.nilable(T::Boolean)) }
|
|
124
131
|
attr_reader :show_saved_payment_methods
|
|
@@ -171,6 +178,7 @@ module Dodopayments
|
|
|
171
178
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
172
179
|
minimal_address: T::Boolean,
|
|
173
180
|
return_url: T.nilable(String),
|
|
181
|
+
short_link: T::Boolean,
|
|
174
182
|
show_saved_payment_methods: T::Boolean,
|
|
175
183
|
subscription_data:
|
|
176
184
|
T.nilable(
|
|
@@ -210,6 +218,8 @@ module Dodopayments
|
|
|
210
218
|
minimal_address: nil,
|
|
211
219
|
# The url to redirect after payment failure or success.
|
|
212
220
|
return_url: nil,
|
|
221
|
+
# If true, returns a shortened checkout URL. Defaults to false if not specified.
|
|
222
|
+
short_link: nil,
|
|
213
223
|
# Display saved payment methods of a returning customer False by default
|
|
214
224
|
show_saved_payment_methods: nil,
|
|
215
225
|
subscription_data: nil
|
|
@@ -241,6 +251,7 @@ module Dodopayments
|
|
|
241
251
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
242
252
|
minimal_address: T::Boolean,
|
|
243
253
|
return_url: T.nilable(String),
|
|
254
|
+
short_link: T::Boolean,
|
|
244
255
|
show_saved_payment_methods: T::Boolean,
|
|
245
256
|
subscription_data:
|
|
246
257
|
T.nilable(Dodopayments::CheckoutSessionRequest::SubscriptionData)
|
|
@@ -620,6 +631,15 @@ module Dodopayments
|
|
|
620
631
|
sig { params(always_create_new_customer: T::Boolean).void }
|
|
621
632
|
attr_writer :always_create_new_customer
|
|
622
633
|
|
|
634
|
+
# If true, redirects the customer immediately after payment completion
|
|
635
|
+
#
|
|
636
|
+
# Default is false
|
|
637
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
638
|
+
attr_reader :redirect_immediately
|
|
639
|
+
|
|
640
|
+
sig { params(redirect_immediately: T::Boolean).void }
|
|
641
|
+
attr_writer :redirect_immediately
|
|
642
|
+
|
|
623
643
|
sig do
|
|
624
644
|
params(
|
|
625
645
|
allow_currency_selection: T::Boolean,
|
|
@@ -633,7 +653,8 @@ module Dodopayments
|
|
|
633
653
|
allow_discount_code: T::Boolean,
|
|
634
654
|
allow_phone_number_collection: T::Boolean,
|
|
635
655
|
allow_tax_id: T::Boolean,
|
|
636
|
-
always_create_new_customer: T::Boolean
|
|
656
|
+
always_create_new_customer: T::Boolean,
|
|
657
|
+
redirect_immediately: T::Boolean
|
|
637
658
|
).returns(T.attached_class)
|
|
638
659
|
end
|
|
639
660
|
def self.new(
|
|
@@ -664,7 +685,11 @@ module Dodopayments
|
|
|
664
685
|
# to find an existing customer to attach the session to
|
|
665
686
|
#
|
|
666
687
|
# Default is false
|
|
667
|
-
always_create_new_customer: nil
|
|
688
|
+
always_create_new_customer: nil,
|
|
689
|
+
# If true, redirects the customer immediately after payment completion
|
|
690
|
+
#
|
|
691
|
+
# Default is false
|
|
692
|
+
redirect_immediately: nil
|
|
668
693
|
)
|
|
669
694
|
end
|
|
670
695
|
|
|
@@ -682,7 +707,8 @@ module Dodopayments
|
|
|
682
707
|
allow_discount_code: T::Boolean,
|
|
683
708
|
allow_phone_number_collection: T::Boolean,
|
|
684
709
|
allow_tax_id: T::Boolean,
|
|
685
|
-
always_create_new_customer: T::Boolean
|
|
710
|
+
always_create_new_customer: T::Boolean,
|
|
711
|
+
redirect_immediately: T::Boolean
|
|
686
712
|
}
|
|
687
713
|
)
|
|
688
714
|
end
|