checkout-intents 0.0.2
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 +7 -0
- data/.ignore +2 -0
- data/CHANGELOG.md +16 -0
- data/README.md +358 -0
- data/SECURITY.md +27 -0
- data/lib/checkout_intents/client.rb +100 -0
- data/lib/checkout_intents/errors.rb +228 -0
- data/lib/checkout_intents/file_part.rb +58 -0
- data/lib/checkout_intents/internal/cursor_pagination.rb +125 -0
- data/lib/checkout_intents/internal/transport/base_client.rb +577 -0
- data/lib/checkout_intents/internal/transport/pooled_net_requester.rb +210 -0
- data/lib/checkout_intents/internal/type/array_of.rb +168 -0
- data/lib/checkout_intents/internal/type/base_model.rb +536 -0
- data/lib/checkout_intents/internal/type/base_page.rb +55 -0
- data/lib/checkout_intents/internal/type/boolean.rb +77 -0
- data/lib/checkout_intents/internal/type/converter.rb +327 -0
- data/lib/checkout_intents/internal/type/enum.rb +131 -0
- data/lib/checkout_intents/internal/type/file_input.rb +111 -0
- data/lib/checkout_intents/internal/type/hash_of.rb +188 -0
- data/lib/checkout_intents/internal/type/request_parameters.rb +42 -0
- data/lib/checkout_intents/internal/type/union.rb +258 -0
- data/lib/checkout_intents/internal/type/unknown.rb +81 -0
- data/lib/checkout_intents/internal/util.rb +920 -0
- data/lib/checkout_intents/internal.rb +20 -0
- data/lib/checkout_intents/models/base_checkout_intent.rb +76 -0
- data/lib/checkout_intents/models/betas/checkout_session_create_params.rb +148 -0
- data/lib/checkout_intents/models/brand_retrieve_params.rb +14 -0
- data/lib/checkout_intents/models/brand_retrieve_response.rb +52 -0
- data/lib/checkout_intents/models/buyer.rb +69 -0
- data/lib/checkout_intents/models/checkout_intent.rb +230 -0
- data/lib/checkout_intents/models/checkout_intent_add_payment_params.rb +20 -0
- data/lib/checkout_intents/models/checkout_intent_confirm_params.rb +20 -0
- data/lib/checkout_intents/models/checkout_intent_create_params.rb +68 -0
- data/lib/checkout_intents/models/checkout_intent_list_params.rb +58 -0
- data/lib/checkout_intents/models/checkout_intent_purchase_params.rb +74 -0
- data/lib/checkout_intents/models/checkout_intent_retrieve_params.rb +14 -0
- data/lib/checkout_intents/models/checkout_session.rb +23 -0
- data/lib/checkout_intents/models/money.rb +21 -0
- data/lib/checkout_intents/models/offer.rb +113 -0
- data/lib/checkout_intents/models/payment_method.rb +120 -0
- data/lib/checkout_intents/models/variant_selection.rb +33 -0
- data/lib/checkout_intents/models.rb +76 -0
- data/lib/checkout_intents/request_options.rb +78 -0
- data/lib/checkout_intents/resources/betas/checkout_sessions.rb +54 -0
- data/lib/checkout_intents/resources/betas.rb +18 -0
- data/lib/checkout_intents/resources/brands.rb +37 -0
- data/lib/checkout_intents/resources/checkout_intents.rb +173 -0
- data/lib/checkout_intents/version.rb +5 -0
- data/lib/checkout_intents.rb +77 -0
- data/manifest.yaml +17 -0
- data/rbi/checkout_intents/client.rbi +74 -0
- data/rbi/checkout_intents/errors.rbi +205 -0
- data/rbi/checkout_intents/file_part.rbi +37 -0
- data/rbi/checkout_intents/internal/cursor_pagination.rbi +74 -0
- data/rbi/checkout_intents/internal/transport/base_client.rbi +309 -0
- data/rbi/checkout_intents/internal/transport/pooled_net_requester.rbi +84 -0
- data/rbi/checkout_intents/internal/type/array_of.rbi +108 -0
- data/rbi/checkout_intents/internal/type/base_model.rbi +314 -0
- data/rbi/checkout_intents/internal/type/base_page.rbi +43 -0
- data/rbi/checkout_intents/internal/type/boolean.rbi +58 -0
- data/rbi/checkout_intents/internal/type/converter.rbi +225 -0
- data/rbi/checkout_intents/internal/type/enum.rbi +82 -0
- data/rbi/checkout_intents/internal/type/file_input.rbi +59 -0
- data/rbi/checkout_intents/internal/type/hash_of.rbi +108 -0
- data/rbi/checkout_intents/internal/type/request_parameters.rbi +31 -0
- data/rbi/checkout_intents/internal/type/union.rbi +134 -0
- data/rbi/checkout_intents/internal/type/unknown.rbi +58 -0
- data/rbi/checkout_intents/internal/util.rbi +487 -0
- data/rbi/checkout_intents/internal.rbi +18 -0
- data/rbi/checkout_intents/models/base_checkout_intent.rbi +142 -0
- data/rbi/checkout_intents/models/betas/checkout_session_create_params.rbi +281 -0
- data/rbi/checkout_intents/models/brand_retrieve_params.rbi +32 -0
- data/rbi/checkout_intents/models/brand_retrieve_response.rbi +109 -0
- data/rbi/checkout_intents/models/buyer.rbi +92 -0
- data/rbi/checkout_intents/models/checkout_intent.rbi +653 -0
- data/rbi/checkout_intents/models/checkout_intent_add_payment_params.rbi +59 -0
- data/rbi/checkout_intents/models/checkout_intent_confirm_params.rbi +59 -0
- data/rbi/checkout_intents/models/checkout_intent_create_params.rbi +141 -0
- data/rbi/checkout_intents/models/checkout_intent_list_params.rbi +146 -0
- data/rbi/checkout_intents/models/checkout_intent_purchase_params.rbi +165 -0
- data/rbi/checkout_intents/models/checkout_intent_retrieve_params.rbi +32 -0
- data/rbi/checkout_intents/models/checkout_session.rbi +36 -0
- data/rbi/checkout_intents/models/money.rbi +32 -0
- data/rbi/checkout_intents/models/offer.rbi +225 -0
- data/rbi/checkout_intents/models/payment_method.rbi +292 -0
- data/rbi/checkout_intents/models/variant_selection.rbi +55 -0
- data/rbi/checkout_intents/models.rbi +40 -0
- data/rbi/checkout_intents/request_options.rbi +64 -0
- data/rbi/checkout_intents/resources/betas/checkout_sessions.rbi +47 -0
- data/rbi/checkout_intents/resources/betas.rbi +15 -0
- data/rbi/checkout_intents/resources/brands.rbi +29 -0
- data/rbi/checkout_intents/resources/checkout_intents.rbi +165 -0
- data/rbi/checkout_intents/version.rbi +5 -0
- data/sig/checkout_intents/client.rbs +36 -0
- data/sig/checkout_intents/errors.rbs +117 -0
- data/sig/checkout_intents/file_part.rbs +21 -0
- data/sig/checkout_intents/internal/cursor_pagination.rbs +48 -0
- data/sig/checkout_intents/internal/transport/base_client.rbs +133 -0
- data/sig/checkout_intents/internal/transport/pooled_net_requester.rbs +48 -0
- data/sig/checkout_intents/internal/type/array_of.rbs +48 -0
- data/sig/checkout_intents/internal/type/base_model.rbs +104 -0
- data/sig/checkout_intents/internal/type/base_page.rbs +24 -0
- data/sig/checkout_intents/internal/type/boolean.rbs +26 -0
- data/sig/checkout_intents/internal/type/converter.rbs +79 -0
- data/sig/checkout_intents/internal/type/enum.rbs +32 -0
- data/sig/checkout_intents/internal/type/file_input.rbs +25 -0
- data/sig/checkout_intents/internal/type/hash_of.rbs +48 -0
- data/sig/checkout_intents/internal/type/request_parameters.rbs +20 -0
- data/sig/checkout_intents/internal/type/union.rbs +52 -0
- data/sig/checkout_intents/internal/type/unknown.rbs +26 -0
- data/sig/checkout_intents/internal/util.rbs +185 -0
- data/sig/checkout_intents/internal.rbs +10 -0
- data/sig/checkout_intents/models/base_checkout_intent.rbs +88 -0
- data/sig/checkout_intents/models/betas/checkout_session_create_params.rbs +172 -0
- data/sig/checkout_intents/models/brand_retrieve_params.rbs +15 -0
- data/sig/checkout_intents/models/brand_retrieve_response.rbs +43 -0
- data/sig/checkout_intents/models/buyer.rbs +67 -0
- data/sig/checkout_intents/models/checkout_intent.rbs +324 -0
- data/sig/checkout_intents/models/checkout_intent_add_payment_params.rbs +24 -0
- data/sig/checkout_intents/models/checkout_intent_confirm_params.rbs +24 -0
- data/sig/checkout_intents/models/checkout_intent_create_params.rbs +84 -0
- data/sig/checkout_intents/models/checkout_intent_list_params.rbs +77 -0
- data/sig/checkout_intents/models/checkout_intent_purchase_params.rbs +89 -0
- data/sig/checkout_intents/models/checkout_intent_retrieve_params.rbs +15 -0
- data/sig/checkout_intents/models/checkout_session.rbs +13 -0
- data/sig/checkout_intents/models/money.rbs +15 -0
- data/sig/checkout_intents/models/offer.rbs +135 -0
- data/sig/checkout_intents/models/payment_method.rbs +127 -0
- data/sig/checkout_intents/models/variant_selection.rbs +30 -0
- data/sig/checkout_intents/models.rbs +33 -0
- data/sig/checkout_intents/request_options.rbs +36 -0
- data/sig/checkout_intents/resources/betas/checkout_sessions.rbs +19 -0
- data/sig/checkout_intents/resources/betas.rbs +9 -0
- data/sig/checkout_intents/resources/brands.rbs +12 -0
- data/sig/checkout_intents/resources/checkout_intents.rbs +54 -0
- data/sig/checkout_intents/version.rbs +3 -0
- metadata +194 -0
|
@@ -0,0 +1,653 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module CheckoutIntents
|
|
4
|
+
module Models
|
|
5
|
+
module CheckoutIntent
|
|
6
|
+
extend CheckoutIntents::Internal::Type::Union
|
|
7
|
+
|
|
8
|
+
Variants =
|
|
9
|
+
T.type_alias do
|
|
10
|
+
T.any(
|
|
11
|
+
CheckoutIntents::CheckoutIntent::RetrievingOfferCheckoutIntent,
|
|
12
|
+
CheckoutIntents::CheckoutIntent::AwaitingConfirmationCheckoutIntent,
|
|
13
|
+
CheckoutIntents::CheckoutIntent::PlacingOrderCheckoutIntent,
|
|
14
|
+
CheckoutIntents::CheckoutIntent::CompletedCheckoutIntent,
|
|
15
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class RetrievingOfferCheckoutIntent < CheckoutIntents::Models::BaseCheckoutIntent
|
|
20
|
+
OrHash =
|
|
21
|
+
T.type_alias do
|
|
22
|
+
T.any(
|
|
23
|
+
CheckoutIntents::CheckoutIntent::RetrievingOfferCheckoutIntent,
|
|
24
|
+
CheckoutIntents::Internal::AnyHash
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
sig do
|
|
29
|
+
returns(
|
|
30
|
+
CheckoutIntents::CheckoutIntent::RetrievingOfferCheckoutIntent::State::TaggedSymbol
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
attr_accessor :state
|
|
34
|
+
|
|
35
|
+
sig do
|
|
36
|
+
params(
|
|
37
|
+
state:
|
|
38
|
+
CheckoutIntents::CheckoutIntent::RetrievingOfferCheckoutIntent::State::OrSymbol
|
|
39
|
+
).returns(T.attached_class)
|
|
40
|
+
end
|
|
41
|
+
def self.new(state:)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
sig do
|
|
45
|
+
override.returns(
|
|
46
|
+
{
|
|
47
|
+
state:
|
|
48
|
+
CheckoutIntents::CheckoutIntent::RetrievingOfferCheckoutIntent::State::TaggedSymbol
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
def to_hash
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
module State
|
|
56
|
+
extend CheckoutIntents::Internal::Type::Enum
|
|
57
|
+
|
|
58
|
+
TaggedSymbol =
|
|
59
|
+
T.type_alias do
|
|
60
|
+
T.all(
|
|
61
|
+
Symbol,
|
|
62
|
+
CheckoutIntents::CheckoutIntent::RetrievingOfferCheckoutIntent::State
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
66
|
+
|
|
67
|
+
RETRIEVING_OFFER =
|
|
68
|
+
T.let(
|
|
69
|
+
:retrieving_offer,
|
|
70
|
+
CheckoutIntents::CheckoutIntent::RetrievingOfferCheckoutIntent::State::TaggedSymbol
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
sig do
|
|
74
|
+
override.returns(
|
|
75
|
+
T::Array[
|
|
76
|
+
CheckoutIntents::CheckoutIntent::RetrievingOfferCheckoutIntent::State::TaggedSymbol
|
|
77
|
+
]
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
def self.values
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
class AwaitingConfirmationCheckoutIntent < CheckoutIntents::Models::BaseCheckoutIntent
|
|
86
|
+
OrHash =
|
|
87
|
+
T.type_alias do
|
|
88
|
+
T.any(
|
|
89
|
+
CheckoutIntents::CheckoutIntent::AwaitingConfirmationCheckoutIntent,
|
|
90
|
+
CheckoutIntents::Internal::AnyHash
|
|
91
|
+
)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
sig { returns(CheckoutIntents::Offer) }
|
|
95
|
+
attr_reader :offer
|
|
96
|
+
|
|
97
|
+
sig { params(offer: CheckoutIntents::Offer::OrHash).void }
|
|
98
|
+
attr_writer :offer
|
|
99
|
+
|
|
100
|
+
sig do
|
|
101
|
+
returns(
|
|
102
|
+
CheckoutIntents::CheckoutIntent::AwaitingConfirmationCheckoutIntent::State::TaggedSymbol
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
attr_accessor :state
|
|
106
|
+
|
|
107
|
+
sig { returns(T.nilable(CheckoutIntents::PaymentMethod::Variants)) }
|
|
108
|
+
attr_reader :payment_method
|
|
109
|
+
|
|
110
|
+
sig do
|
|
111
|
+
params(
|
|
112
|
+
payment_method:
|
|
113
|
+
T.any(
|
|
114
|
+
CheckoutIntents::PaymentMethod::StripeTokenPaymentMethod::OrHash,
|
|
115
|
+
CheckoutIntents::PaymentMethod::BasisTheoryPaymentMethod::OrHash,
|
|
116
|
+
CheckoutIntents::PaymentMethod::NekudaPaymentMethod::OrHash
|
|
117
|
+
)
|
|
118
|
+
).void
|
|
119
|
+
end
|
|
120
|
+
attr_writer :payment_method
|
|
121
|
+
|
|
122
|
+
sig do
|
|
123
|
+
params(
|
|
124
|
+
offer: CheckoutIntents::Offer::OrHash,
|
|
125
|
+
state:
|
|
126
|
+
CheckoutIntents::CheckoutIntent::AwaitingConfirmationCheckoutIntent::State::OrSymbol,
|
|
127
|
+
payment_method:
|
|
128
|
+
T.any(
|
|
129
|
+
CheckoutIntents::PaymentMethod::StripeTokenPaymentMethod::OrHash,
|
|
130
|
+
CheckoutIntents::PaymentMethod::BasisTheoryPaymentMethod::OrHash,
|
|
131
|
+
CheckoutIntents::PaymentMethod::NekudaPaymentMethod::OrHash
|
|
132
|
+
)
|
|
133
|
+
).returns(T.attached_class)
|
|
134
|
+
end
|
|
135
|
+
def self.new(offer:, state:, payment_method: nil)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
sig do
|
|
139
|
+
override.returns(
|
|
140
|
+
{
|
|
141
|
+
offer: CheckoutIntents::Offer,
|
|
142
|
+
state:
|
|
143
|
+
CheckoutIntents::CheckoutIntent::AwaitingConfirmationCheckoutIntent::State::TaggedSymbol,
|
|
144
|
+
payment_method: CheckoutIntents::PaymentMethod::Variants
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
end
|
|
148
|
+
def to_hash
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
module State
|
|
152
|
+
extend CheckoutIntents::Internal::Type::Enum
|
|
153
|
+
|
|
154
|
+
TaggedSymbol =
|
|
155
|
+
T.type_alias do
|
|
156
|
+
T.all(
|
|
157
|
+
Symbol,
|
|
158
|
+
CheckoutIntents::CheckoutIntent::AwaitingConfirmationCheckoutIntent::State
|
|
159
|
+
)
|
|
160
|
+
end
|
|
161
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
162
|
+
|
|
163
|
+
AWAITING_CONFIRMATION =
|
|
164
|
+
T.let(
|
|
165
|
+
:awaiting_confirmation,
|
|
166
|
+
CheckoutIntents::CheckoutIntent::AwaitingConfirmationCheckoutIntent::State::TaggedSymbol
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
sig do
|
|
170
|
+
override.returns(
|
|
171
|
+
T::Array[
|
|
172
|
+
CheckoutIntents::CheckoutIntent::AwaitingConfirmationCheckoutIntent::State::TaggedSymbol
|
|
173
|
+
]
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
def self.values
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
class PlacingOrderCheckoutIntent < CheckoutIntents::Models::BaseCheckoutIntent
|
|
182
|
+
OrHash =
|
|
183
|
+
T.type_alias do
|
|
184
|
+
T.any(
|
|
185
|
+
CheckoutIntents::CheckoutIntent::PlacingOrderCheckoutIntent,
|
|
186
|
+
CheckoutIntents::Internal::AnyHash
|
|
187
|
+
)
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
sig { returns(CheckoutIntents::Offer) }
|
|
191
|
+
attr_reader :offer
|
|
192
|
+
|
|
193
|
+
sig { params(offer: CheckoutIntents::Offer::OrHash).void }
|
|
194
|
+
attr_writer :offer
|
|
195
|
+
|
|
196
|
+
sig { returns(CheckoutIntents::PaymentMethod::Variants) }
|
|
197
|
+
attr_accessor :payment_method
|
|
198
|
+
|
|
199
|
+
sig do
|
|
200
|
+
returns(
|
|
201
|
+
CheckoutIntents::CheckoutIntent::PlacingOrderCheckoutIntent::State::TaggedSymbol
|
|
202
|
+
)
|
|
203
|
+
end
|
|
204
|
+
attr_accessor :state
|
|
205
|
+
|
|
206
|
+
sig do
|
|
207
|
+
params(
|
|
208
|
+
offer: CheckoutIntents::Offer::OrHash,
|
|
209
|
+
payment_method:
|
|
210
|
+
T.any(
|
|
211
|
+
CheckoutIntents::PaymentMethod::StripeTokenPaymentMethod::OrHash,
|
|
212
|
+
CheckoutIntents::PaymentMethod::BasisTheoryPaymentMethod::OrHash,
|
|
213
|
+
CheckoutIntents::PaymentMethod::NekudaPaymentMethod::OrHash
|
|
214
|
+
),
|
|
215
|
+
state:
|
|
216
|
+
CheckoutIntents::CheckoutIntent::PlacingOrderCheckoutIntent::State::OrSymbol
|
|
217
|
+
).returns(T.attached_class)
|
|
218
|
+
end
|
|
219
|
+
def self.new(offer:, payment_method:, state:)
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
sig do
|
|
223
|
+
override.returns(
|
|
224
|
+
{
|
|
225
|
+
offer: CheckoutIntents::Offer,
|
|
226
|
+
payment_method: CheckoutIntents::PaymentMethod::Variants,
|
|
227
|
+
state:
|
|
228
|
+
CheckoutIntents::CheckoutIntent::PlacingOrderCheckoutIntent::State::TaggedSymbol
|
|
229
|
+
}
|
|
230
|
+
)
|
|
231
|
+
end
|
|
232
|
+
def to_hash
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
module State
|
|
236
|
+
extend CheckoutIntents::Internal::Type::Enum
|
|
237
|
+
|
|
238
|
+
TaggedSymbol =
|
|
239
|
+
T.type_alias do
|
|
240
|
+
T.all(
|
|
241
|
+
Symbol,
|
|
242
|
+
CheckoutIntents::CheckoutIntent::PlacingOrderCheckoutIntent::State
|
|
243
|
+
)
|
|
244
|
+
end
|
|
245
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
246
|
+
|
|
247
|
+
PLACING_ORDER =
|
|
248
|
+
T.let(
|
|
249
|
+
:placing_order,
|
|
250
|
+
CheckoutIntents::CheckoutIntent::PlacingOrderCheckoutIntent::State::TaggedSymbol
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
sig do
|
|
254
|
+
override.returns(
|
|
255
|
+
T::Array[
|
|
256
|
+
CheckoutIntents::CheckoutIntent::PlacingOrderCheckoutIntent::State::TaggedSymbol
|
|
257
|
+
]
|
|
258
|
+
)
|
|
259
|
+
end
|
|
260
|
+
def self.values
|
|
261
|
+
end
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
class CompletedCheckoutIntent < CheckoutIntents::Models::BaseCheckoutIntent
|
|
266
|
+
OrHash =
|
|
267
|
+
T.type_alias do
|
|
268
|
+
T.any(
|
|
269
|
+
CheckoutIntents::CheckoutIntent::CompletedCheckoutIntent,
|
|
270
|
+
CheckoutIntents::Internal::AnyHash
|
|
271
|
+
)
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
sig { returns(CheckoutIntents::Offer) }
|
|
275
|
+
attr_reader :offer
|
|
276
|
+
|
|
277
|
+
sig { params(offer: CheckoutIntents::Offer::OrHash).void }
|
|
278
|
+
attr_writer :offer
|
|
279
|
+
|
|
280
|
+
sig { returns(T.nilable(String)) }
|
|
281
|
+
attr_accessor :order_id
|
|
282
|
+
|
|
283
|
+
sig { returns(CheckoutIntents::PaymentMethod::Variants) }
|
|
284
|
+
attr_accessor :payment_method
|
|
285
|
+
|
|
286
|
+
sig do
|
|
287
|
+
returns(
|
|
288
|
+
CheckoutIntents::CheckoutIntent::CompletedCheckoutIntent::State::TaggedSymbol
|
|
289
|
+
)
|
|
290
|
+
end
|
|
291
|
+
attr_accessor :state
|
|
292
|
+
|
|
293
|
+
sig do
|
|
294
|
+
params(
|
|
295
|
+
offer: CheckoutIntents::Offer::OrHash,
|
|
296
|
+
order_id: T.nilable(String),
|
|
297
|
+
payment_method:
|
|
298
|
+
T.any(
|
|
299
|
+
CheckoutIntents::PaymentMethod::StripeTokenPaymentMethod::OrHash,
|
|
300
|
+
CheckoutIntents::PaymentMethod::BasisTheoryPaymentMethod::OrHash,
|
|
301
|
+
CheckoutIntents::PaymentMethod::NekudaPaymentMethod::OrHash
|
|
302
|
+
),
|
|
303
|
+
state:
|
|
304
|
+
CheckoutIntents::CheckoutIntent::CompletedCheckoutIntent::State::OrSymbol
|
|
305
|
+
).returns(T.attached_class)
|
|
306
|
+
end
|
|
307
|
+
def self.new(offer:, order_id:, payment_method:, state:)
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
sig do
|
|
311
|
+
override.returns(
|
|
312
|
+
{
|
|
313
|
+
offer: CheckoutIntents::Offer,
|
|
314
|
+
order_id: T.nilable(String),
|
|
315
|
+
payment_method: CheckoutIntents::PaymentMethod::Variants,
|
|
316
|
+
state:
|
|
317
|
+
CheckoutIntents::CheckoutIntent::CompletedCheckoutIntent::State::TaggedSymbol
|
|
318
|
+
}
|
|
319
|
+
)
|
|
320
|
+
end
|
|
321
|
+
def to_hash
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
module State
|
|
325
|
+
extend CheckoutIntents::Internal::Type::Enum
|
|
326
|
+
|
|
327
|
+
TaggedSymbol =
|
|
328
|
+
T.type_alias do
|
|
329
|
+
T.all(
|
|
330
|
+
Symbol,
|
|
331
|
+
CheckoutIntents::CheckoutIntent::CompletedCheckoutIntent::State
|
|
332
|
+
)
|
|
333
|
+
end
|
|
334
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
335
|
+
|
|
336
|
+
COMPLETED =
|
|
337
|
+
T.let(
|
|
338
|
+
:completed,
|
|
339
|
+
CheckoutIntents::CheckoutIntent::CompletedCheckoutIntent::State::TaggedSymbol
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
sig do
|
|
343
|
+
override.returns(
|
|
344
|
+
T::Array[
|
|
345
|
+
CheckoutIntents::CheckoutIntent::CompletedCheckoutIntent::State::TaggedSymbol
|
|
346
|
+
]
|
|
347
|
+
)
|
|
348
|
+
end
|
|
349
|
+
def self.values
|
|
350
|
+
end
|
|
351
|
+
end
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
class FailedCheckoutIntent < CheckoutIntents::Models::BaseCheckoutIntent
|
|
355
|
+
OrHash =
|
|
356
|
+
T.type_alias do
|
|
357
|
+
T.any(
|
|
358
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent,
|
|
359
|
+
CheckoutIntents::Internal::AnyHash
|
|
360
|
+
)
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
sig do
|
|
364
|
+
returns(
|
|
365
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason
|
|
366
|
+
)
|
|
367
|
+
end
|
|
368
|
+
attr_reader :failure_reason
|
|
369
|
+
|
|
370
|
+
sig do
|
|
371
|
+
params(
|
|
372
|
+
failure_reason:
|
|
373
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::OrHash
|
|
374
|
+
).void
|
|
375
|
+
end
|
|
376
|
+
attr_writer :failure_reason
|
|
377
|
+
|
|
378
|
+
sig do
|
|
379
|
+
returns(
|
|
380
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::State::TaggedSymbol
|
|
381
|
+
)
|
|
382
|
+
end
|
|
383
|
+
attr_accessor :state
|
|
384
|
+
|
|
385
|
+
sig { returns(T.nilable(CheckoutIntents::Offer)) }
|
|
386
|
+
attr_reader :offer
|
|
387
|
+
|
|
388
|
+
sig { params(offer: CheckoutIntents::Offer::OrHash).void }
|
|
389
|
+
attr_writer :offer
|
|
390
|
+
|
|
391
|
+
sig { returns(T.nilable(CheckoutIntents::PaymentMethod::Variants)) }
|
|
392
|
+
attr_reader :payment_method
|
|
393
|
+
|
|
394
|
+
sig do
|
|
395
|
+
params(
|
|
396
|
+
payment_method:
|
|
397
|
+
T.any(
|
|
398
|
+
CheckoutIntents::PaymentMethod::StripeTokenPaymentMethod::OrHash,
|
|
399
|
+
CheckoutIntents::PaymentMethod::BasisTheoryPaymentMethod::OrHash,
|
|
400
|
+
CheckoutIntents::PaymentMethod::NekudaPaymentMethod::OrHash
|
|
401
|
+
)
|
|
402
|
+
).void
|
|
403
|
+
end
|
|
404
|
+
attr_writer :payment_method
|
|
405
|
+
|
|
406
|
+
sig do
|
|
407
|
+
params(
|
|
408
|
+
failure_reason:
|
|
409
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::OrHash,
|
|
410
|
+
state:
|
|
411
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::State::OrSymbol,
|
|
412
|
+
offer: CheckoutIntents::Offer::OrHash,
|
|
413
|
+
payment_method:
|
|
414
|
+
T.any(
|
|
415
|
+
CheckoutIntents::PaymentMethod::StripeTokenPaymentMethod::OrHash,
|
|
416
|
+
CheckoutIntents::PaymentMethod::BasisTheoryPaymentMethod::OrHash,
|
|
417
|
+
CheckoutIntents::PaymentMethod::NekudaPaymentMethod::OrHash
|
|
418
|
+
)
|
|
419
|
+
).returns(T.attached_class)
|
|
420
|
+
end
|
|
421
|
+
def self.new(failure_reason:, state:, offer: nil, payment_method: nil)
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
sig do
|
|
425
|
+
override.returns(
|
|
426
|
+
{
|
|
427
|
+
failure_reason:
|
|
428
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason,
|
|
429
|
+
state:
|
|
430
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::State::TaggedSymbol,
|
|
431
|
+
offer: CheckoutIntents::Offer,
|
|
432
|
+
payment_method: CheckoutIntents::PaymentMethod::Variants
|
|
433
|
+
}
|
|
434
|
+
)
|
|
435
|
+
end
|
|
436
|
+
def to_hash
|
|
437
|
+
end
|
|
438
|
+
|
|
439
|
+
class FailureReason < CheckoutIntents::Internal::Type::BaseModel
|
|
440
|
+
OrHash =
|
|
441
|
+
T.type_alias do
|
|
442
|
+
T.any(
|
|
443
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason,
|
|
444
|
+
CheckoutIntents::Internal::AnyHash
|
|
445
|
+
)
|
|
446
|
+
end
|
|
447
|
+
|
|
448
|
+
# Type derived from runtime array - always in sync
|
|
449
|
+
sig do
|
|
450
|
+
returns(
|
|
451
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
452
|
+
)
|
|
453
|
+
end
|
|
454
|
+
attr_accessor :code
|
|
455
|
+
|
|
456
|
+
sig { returns(String) }
|
|
457
|
+
attr_accessor :message
|
|
458
|
+
|
|
459
|
+
sig do
|
|
460
|
+
params(
|
|
461
|
+
code:
|
|
462
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::OrSymbol,
|
|
463
|
+
message: String
|
|
464
|
+
).returns(T.attached_class)
|
|
465
|
+
end
|
|
466
|
+
def self.new(
|
|
467
|
+
# Type derived from runtime array - always in sync
|
|
468
|
+
code:,
|
|
469
|
+
message:
|
|
470
|
+
)
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
sig do
|
|
474
|
+
override.returns(
|
|
475
|
+
{
|
|
476
|
+
code:
|
|
477
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol,
|
|
478
|
+
message: String
|
|
479
|
+
}
|
|
480
|
+
)
|
|
481
|
+
end
|
|
482
|
+
def to_hash
|
|
483
|
+
end
|
|
484
|
+
|
|
485
|
+
# Type derived from runtime array - always in sync
|
|
486
|
+
module Code
|
|
487
|
+
extend CheckoutIntents::Internal::Type::Enum
|
|
488
|
+
|
|
489
|
+
TaggedSymbol =
|
|
490
|
+
T.type_alias do
|
|
491
|
+
T.all(
|
|
492
|
+
Symbol,
|
|
493
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code
|
|
494
|
+
)
|
|
495
|
+
end
|
|
496
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
497
|
+
|
|
498
|
+
CHECKOUT_INTENT_EXPIRED =
|
|
499
|
+
T.let(
|
|
500
|
+
:checkout_intent_expired,
|
|
501
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
502
|
+
)
|
|
503
|
+
PAYMENT_FAILED =
|
|
504
|
+
T.let(
|
|
505
|
+
:payment_failed,
|
|
506
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
507
|
+
)
|
|
508
|
+
INSUFFICIENT_STOCK =
|
|
509
|
+
T.let(
|
|
510
|
+
:insufficient_stock,
|
|
511
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
512
|
+
)
|
|
513
|
+
PRODUCT_OUT_OF_STOCK =
|
|
514
|
+
T.let(
|
|
515
|
+
:product_out_of_stock,
|
|
516
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
517
|
+
)
|
|
518
|
+
OFFER_RETRIEVAL_FAILED =
|
|
519
|
+
T.let(
|
|
520
|
+
:offer_retrieval_failed,
|
|
521
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
522
|
+
)
|
|
523
|
+
ORDER_PLACEMENT_FAILED =
|
|
524
|
+
T.let(
|
|
525
|
+
:order_placement_failed,
|
|
526
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
527
|
+
)
|
|
528
|
+
DEVELOPER_NOT_FOUND =
|
|
529
|
+
T.let(
|
|
530
|
+
:developer_not_found,
|
|
531
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
532
|
+
)
|
|
533
|
+
MISSING_SHIPPING_METHOD =
|
|
534
|
+
T.let(
|
|
535
|
+
:missing_shipping_method,
|
|
536
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
537
|
+
)
|
|
538
|
+
UNSUPPORTED_CURRENCY =
|
|
539
|
+
T.let(
|
|
540
|
+
:unsupported_currency,
|
|
541
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
542
|
+
)
|
|
543
|
+
INVALID_INPUT =
|
|
544
|
+
T.let(
|
|
545
|
+
:invalid_input,
|
|
546
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
547
|
+
)
|
|
548
|
+
INCORRECT_COST_BREAKDOWN =
|
|
549
|
+
T.let(
|
|
550
|
+
:incorrect_cost_breakdown,
|
|
551
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
552
|
+
)
|
|
553
|
+
UNSUPPORTED_STORE_NO_GUEST_CHECKOUT =
|
|
554
|
+
T.let(
|
|
555
|
+
:unsupported_store_no_guest_checkout,
|
|
556
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
557
|
+
)
|
|
558
|
+
WORKFLOW_INVOCATION_FAILED =
|
|
559
|
+
T.let(
|
|
560
|
+
:workflow_invocation_failed,
|
|
561
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
562
|
+
)
|
|
563
|
+
VARIANT_SELECTIONS_INVALID =
|
|
564
|
+
T.let(
|
|
565
|
+
:variant_selections_invalid,
|
|
566
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
567
|
+
)
|
|
568
|
+
VARIANT_SELECTIONS_REQUIRED =
|
|
569
|
+
T.let(
|
|
570
|
+
:variant_selections_required,
|
|
571
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
572
|
+
)
|
|
573
|
+
FORM_VALIDATION_ERROR =
|
|
574
|
+
T.let(
|
|
575
|
+
:form_validation_error,
|
|
576
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
577
|
+
)
|
|
578
|
+
CAPTCHA_BLOCKED =
|
|
579
|
+
T.let(
|
|
580
|
+
:captcha_blocked,
|
|
581
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
582
|
+
)
|
|
583
|
+
BOT_PROTECTION_BLOCKED =
|
|
584
|
+
T.let(
|
|
585
|
+
:bot_protection_blocked,
|
|
586
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
587
|
+
)
|
|
588
|
+
CONSTRAINT_TOTAL_PRICE_EXCEEDED =
|
|
589
|
+
T.let(
|
|
590
|
+
:constraint_total_price_exceeded,
|
|
591
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
592
|
+
)
|
|
593
|
+
CONSTRAINT_SHIPPING_COST_EXCEEDED =
|
|
594
|
+
T.let(
|
|
595
|
+
:constraint_shipping_cost_exceeded,
|
|
596
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
597
|
+
)
|
|
598
|
+
UNKNOWN =
|
|
599
|
+
T.let(
|
|
600
|
+
:unknown,
|
|
601
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
602
|
+
)
|
|
603
|
+
|
|
604
|
+
sig do
|
|
605
|
+
override.returns(
|
|
606
|
+
T::Array[
|
|
607
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::FailureReason::Code::TaggedSymbol
|
|
608
|
+
]
|
|
609
|
+
)
|
|
610
|
+
end
|
|
611
|
+
def self.values
|
|
612
|
+
end
|
|
613
|
+
end
|
|
614
|
+
end
|
|
615
|
+
|
|
616
|
+
module State
|
|
617
|
+
extend CheckoutIntents::Internal::Type::Enum
|
|
618
|
+
|
|
619
|
+
TaggedSymbol =
|
|
620
|
+
T.type_alias do
|
|
621
|
+
T.all(
|
|
622
|
+
Symbol,
|
|
623
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::State
|
|
624
|
+
)
|
|
625
|
+
end
|
|
626
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
627
|
+
|
|
628
|
+
FAILED =
|
|
629
|
+
T.let(
|
|
630
|
+
:failed,
|
|
631
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::State::TaggedSymbol
|
|
632
|
+
)
|
|
633
|
+
|
|
634
|
+
sig do
|
|
635
|
+
override.returns(
|
|
636
|
+
T::Array[
|
|
637
|
+
CheckoutIntents::CheckoutIntent::FailedCheckoutIntent::State::TaggedSymbol
|
|
638
|
+
]
|
|
639
|
+
)
|
|
640
|
+
end
|
|
641
|
+
def self.values
|
|
642
|
+
end
|
|
643
|
+
end
|
|
644
|
+
end
|
|
645
|
+
|
|
646
|
+
sig do
|
|
647
|
+
override.returns(T::Array[CheckoutIntents::CheckoutIntent::Variants])
|
|
648
|
+
end
|
|
649
|
+
def self.variants
|
|
650
|
+
end
|
|
651
|
+
end
|
|
652
|
+
end
|
|
653
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module CheckoutIntents
|
|
4
|
+
module Models
|
|
5
|
+
class CheckoutIntentAddPaymentParams < CheckoutIntents::Internal::Type::BaseModel
|
|
6
|
+
extend CheckoutIntents::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include CheckoutIntents::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
CheckoutIntents::CheckoutIntentAddPaymentParams,
|
|
13
|
+
CheckoutIntents::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
returns(
|
|
19
|
+
T.any(
|
|
20
|
+
CheckoutIntents::PaymentMethod::StripeTokenPaymentMethod,
|
|
21
|
+
CheckoutIntents::PaymentMethod::BasisTheoryPaymentMethod,
|
|
22
|
+
CheckoutIntents::PaymentMethod::NekudaPaymentMethod
|
|
23
|
+
)
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
attr_accessor :payment_method
|
|
27
|
+
|
|
28
|
+
sig do
|
|
29
|
+
params(
|
|
30
|
+
payment_method:
|
|
31
|
+
T.any(
|
|
32
|
+
CheckoutIntents::PaymentMethod::StripeTokenPaymentMethod::OrHash,
|
|
33
|
+
CheckoutIntents::PaymentMethod::BasisTheoryPaymentMethod::OrHash,
|
|
34
|
+
CheckoutIntents::PaymentMethod::NekudaPaymentMethod::OrHash
|
|
35
|
+
),
|
|
36
|
+
request_options: CheckoutIntents::RequestOptions::OrHash
|
|
37
|
+
).returns(T.attached_class)
|
|
38
|
+
end
|
|
39
|
+
def self.new(payment_method:, request_options: {})
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
sig do
|
|
43
|
+
override.returns(
|
|
44
|
+
{
|
|
45
|
+
payment_method:
|
|
46
|
+
T.any(
|
|
47
|
+
CheckoutIntents::PaymentMethod::StripeTokenPaymentMethod,
|
|
48
|
+
CheckoutIntents::PaymentMethod::BasisTheoryPaymentMethod,
|
|
49
|
+
CheckoutIntents::PaymentMethod::NekudaPaymentMethod
|
|
50
|
+
),
|
|
51
|
+
request_options: CheckoutIntents::RequestOptions
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
def to_hash
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|