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,59 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module CheckoutIntents
|
|
4
|
+
module Models
|
|
5
|
+
class CheckoutIntentConfirmParams < 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::CheckoutIntentConfirmParams,
|
|
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
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module CheckoutIntents
|
|
4
|
+
module Models
|
|
5
|
+
class CheckoutIntentCreateParams < 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::CheckoutIntentCreateParams,
|
|
13
|
+
CheckoutIntents::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(CheckoutIntents::Buyer) }
|
|
18
|
+
attr_reader :buyer
|
|
19
|
+
|
|
20
|
+
sig { params(buyer: CheckoutIntents::Buyer::OrHash).void }
|
|
21
|
+
attr_writer :buyer
|
|
22
|
+
|
|
23
|
+
sig { returns(String) }
|
|
24
|
+
attr_accessor :product_url
|
|
25
|
+
|
|
26
|
+
sig { returns(Float) }
|
|
27
|
+
attr_accessor :quantity
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
returns(
|
|
31
|
+
T.nilable(CheckoutIntents::CheckoutIntentCreateParams::Constraints)
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
attr_reader :constraints
|
|
35
|
+
|
|
36
|
+
sig do
|
|
37
|
+
params(
|
|
38
|
+
constraints:
|
|
39
|
+
CheckoutIntents::CheckoutIntentCreateParams::Constraints::OrHash
|
|
40
|
+
).void
|
|
41
|
+
end
|
|
42
|
+
attr_writer :constraints
|
|
43
|
+
|
|
44
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
45
|
+
attr_reader :promo_codes
|
|
46
|
+
|
|
47
|
+
sig { params(promo_codes: T::Array[String]).void }
|
|
48
|
+
attr_writer :promo_codes
|
|
49
|
+
|
|
50
|
+
sig { returns(T.nilable(T::Array[CheckoutIntents::VariantSelection])) }
|
|
51
|
+
attr_reader :variant_selections
|
|
52
|
+
|
|
53
|
+
sig do
|
|
54
|
+
params(
|
|
55
|
+
variant_selections:
|
|
56
|
+
T::Array[CheckoutIntents::VariantSelection::OrHash]
|
|
57
|
+
).void
|
|
58
|
+
end
|
|
59
|
+
attr_writer :variant_selections
|
|
60
|
+
|
|
61
|
+
sig do
|
|
62
|
+
params(
|
|
63
|
+
buyer: CheckoutIntents::Buyer::OrHash,
|
|
64
|
+
product_url: String,
|
|
65
|
+
quantity: Float,
|
|
66
|
+
constraints:
|
|
67
|
+
CheckoutIntents::CheckoutIntentCreateParams::Constraints::OrHash,
|
|
68
|
+
promo_codes: T::Array[String],
|
|
69
|
+
variant_selections:
|
|
70
|
+
T::Array[CheckoutIntents::VariantSelection::OrHash],
|
|
71
|
+
request_options: CheckoutIntents::RequestOptions::OrHash
|
|
72
|
+
).returns(T.attached_class)
|
|
73
|
+
end
|
|
74
|
+
def self.new(
|
|
75
|
+
buyer:,
|
|
76
|
+
product_url:,
|
|
77
|
+
quantity:,
|
|
78
|
+
constraints: nil,
|
|
79
|
+
promo_codes: nil,
|
|
80
|
+
variant_selections: nil,
|
|
81
|
+
request_options: {}
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
sig do
|
|
86
|
+
override.returns(
|
|
87
|
+
{
|
|
88
|
+
buyer: CheckoutIntents::Buyer,
|
|
89
|
+
product_url: String,
|
|
90
|
+
quantity: Float,
|
|
91
|
+
constraints:
|
|
92
|
+
CheckoutIntents::CheckoutIntentCreateParams::Constraints,
|
|
93
|
+
promo_codes: T::Array[String],
|
|
94
|
+
variant_selections: T::Array[CheckoutIntents::VariantSelection],
|
|
95
|
+
request_options: CheckoutIntents::RequestOptions
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
end
|
|
99
|
+
def to_hash
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
class Constraints < CheckoutIntents::Internal::Type::BaseModel
|
|
103
|
+
OrHash =
|
|
104
|
+
T.type_alias do
|
|
105
|
+
T.any(
|
|
106
|
+
CheckoutIntents::CheckoutIntentCreateParams::Constraints,
|
|
107
|
+
CheckoutIntents::Internal::AnyHash
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
sig { returns(T.nilable(Integer)) }
|
|
112
|
+
attr_reader :max_shipping_price
|
|
113
|
+
|
|
114
|
+
sig { params(max_shipping_price: Integer).void }
|
|
115
|
+
attr_writer :max_shipping_price
|
|
116
|
+
|
|
117
|
+
sig { returns(T.nilable(Integer)) }
|
|
118
|
+
attr_reader :max_total_price
|
|
119
|
+
|
|
120
|
+
sig { params(max_total_price: Integer).void }
|
|
121
|
+
attr_writer :max_total_price
|
|
122
|
+
|
|
123
|
+
sig do
|
|
124
|
+
params(max_shipping_price: Integer, max_total_price: Integer).returns(
|
|
125
|
+
T.attached_class
|
|
126
|
+
)
|
|
127
|
+
end
|
|
128
|
+
def self.new(max_shipping_price: nil, max_total_price: nil)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
sig do
|
|
132
|
+
override.returns(
|
|
133
|
+
{ max_shipping_price: Integer, max_total_price: Integer }
|
|
134
|
+
)
|
|
135
|
+
end
|
|
136
|
+
def to_hash
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module CheckoutIntents
|
|
4
|
+
module Models
|
|
5
|
+
class CheckoutIntentListParams < 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::CheckoutIntentListParams,
|
|
13
|
+
CheckoutIntents::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
18
|
+
attr_reader :id
|
|
19
|
+
|
|
20
|
+
sig { params(id: T::Array[String]).void }
|
|
21
|
+
attr_writer :id
|
|
22
|
+
|
|
23
|
+
sig { returns(T.nilable(String)) }
|
|
24
|
+
attr_reader :after
|
|
25
|
+
|
|
26
|
+
sig { params(after: String).void }
|
|
27
|
+
attr_writer :after
|
|
28
|
+
|
|
29
|
+
sig { returns(T.nilable(String)) }
|
|
30
|
+
attr_reader :before
|
|
31
|
+
|
|
32
|
+
sig { params(before: String).void }
|
|
33
|
+
attr_writer :before
|
|
34
|
+
|
|
35
|
+
sig { returns(T.nilable(Float)) }
|
|
36
|
+
attr_reader :limit
|
|
37
|
+
|
|
38
|
+
sig { params(limit: Float).void }
|
|
39
|
+
attr_writer :limit
|
|
40
|
+
|
|
41
|
+
sig do
|
|
42
|
+
returns(
|
|
43
|
+
T.nilable(
|
|
44
|
+
T::Array[CheckoutIntents::CheckoutIntentListParams::State::OrSymbol]
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
end
|
|
48
|
+
attr_reader :state
|
|
49
|
+
|
|
50
|
+
sig do
|
|
51
|
+
params(
|
|
52
|
+
state:
|
|
53
|
+
T::Array[CheckoutIntents::CheckoutIntentListParams::State::OrSymbol]
|
|
54
|
+
).void
|
|
55
|
+
end
|
|
56
|
+
attr_writer :state
|
|
57
|
+
|
|
58
|
+
sig do
|
|
59
|
+
params(
|
|
60
|
+
id: T::Array[String],
|
|
61
|
+
after: String,
|
|
62
|
+
before: String,
|
|
63
|
+
limit: Float,
|
|
64
|
+
state:
|
|
65
|
+
T::Array[
|
|
66
|
+
CheckoutIntents::CheckoutIntentListParams::State::OrSymbol
|
|
67
|
+
],
|
|
68
|
+
request_options: CheckoutIntents::RequestOptions::OrHash
|
|
69
|
+
).returns(T.attached_class)
|
|
70
|
+
end
|
|
71
|
+
def self.new(
|
|
72
|
+
id: nil,
|
|
73
|
+
after: nil,
|
|
74
|
+
before: nil,
|
|
75
|
+
limit: nil,
|
|
76
|
+
state: nil,
|
|
77
|
+
request_options: {}
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
sig do
|
|
82
|
+
override.returns(
|
|
83
|
+
{
|
|
84
|
+
id: T::Array[String],
|
|
85
|
+
after: String,
|
|
86
|
+
before: String,
|
|
87
|
+
limit: Float,
|
|
88
|
+
state:
|
|
89
|
+
T::Array[
|
|
90
|
+
CheckoutIntents::CheckoutIntentListParams::State::OrSymbol
|
|
91
|
+
],
|
|
92
|
+
request_options: CheckoutIntents::RequestOptions
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
end
|
|
96
|
+
def to_hash
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
module State
|
|
100
|
+
extend CheckoutIntents::Internal::Type::Enum
|
|
101
|
+
|
|
102
|
+
TaggedSymbol =
|
|
103
|
+
T.type_alias do
|
|
104
|
+
T.all(Symbol, CheckoutIntents::CheckoutIntentListParams::State)
|
|
105
|
+
end
|
|
106
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
107
|
+
|
|
108
|
+
RETRIEVING_OFFER =
|
|
109
|
+
T.let(
|
|
110
|
+
:retrieving_offer,
|
|
111
|
+
CheckoutIntents::CheckoutIntentListParams::State::TaggedSymbol
|
|
112
|
+
)
|
|
113
|
+
AWAITING_CONFIRMATION =
|
|
114
|
+
T.let(
|
|
115
|
+
:awaiting_confirmation,
|
|
116
|
+
CheckoutIntents::CheckoutIntentListParams::State::TaggedSymbol
|
|
117
|
+
)
|
|
118
|
+
PLACING_ORDER =
|
|
119
|
+
T.let(
|
|
120
|
+
:placing_order,
|
|
121
|
+
CheckoutIntents::CheckoutIntentListParams::State::TaggedSymbol
|
|
122
|
+
)
|
|
123
|
+
COMPLETED =
|
|
124
|
+
T.let(
|
|
125
|
+
:completed,
|
|
126
|
+
CheckoutIntents::CheckoutIntentListParams::State::TaggedSymbol
|
|
127
|
+
)
|
|
128
|
+
FAILED =
|
|
129
|
+
T.let(
|
|
130
|
+
:failed,
|
|
131
|
+
CheckoutIntents::CheckoutIntentListParams::State::TaggedSymbol
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
sig do
|
|
135
|
+
override.returns(
|
|
136
|
+
T::Array[
|
|
137
|
+
CheckoutIntents::CheckoutIntentListParams::State::TaggedSymbol
|
|
138
|
+
]
|
|
139
|
+
)
|
|
140
|
+
end
|
|
141
|
+
def self.values
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module CheckoutIntents
|
|
4
|
+
module Models
|
|
5
|
+
class CheckoutIntentPurchaseParams < 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::CheckoutIntentPurchaseParams,
|
|
13
|
+
CheckoutIntents::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(CheckoutIntents::Buyer) }
|
|
18
|
+
attr_reader :buyer
|
|
19
|
+
|
|
20
|
+
sig { params(buyer: CheckoutIntents::Buyer::OrHash).void }
|
|
21
|
+
attr_writer :buyer
|
|
22
|
+
|
|
23
|
+
sig do
|
|
24
|
+
returns(
|
|
25
|
+
T.any(
|
|
26
|
+
CheckoutIntents::PaymentMethod::StripeTokenPaymentMethod,
|
|
27
|
+
CheckoutIntents::PaymentMethod::BasisTheoryPaymentMethod,
|
|
28
|
+
CheckoutIntents::PaymentMethod::NekudaPaymentMethod
|
|
29
|
+
)
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
attr_accessor :payment_method
|
|
33
|
+
|
|
34
|
+
sig { returns(String) }
|
|
35
|
+
attr_accessor :product_url
|
|
36
|
+
|
|
37
|
+
sig { returns(Float) }
|
|
38
|
+
attr_accessor :quantity
|
|
39
|
+
|
|
40
|
+
sig do
|
|
41
|
+
returns(
|
|
42
|
+
T.nilable(CheckoutIntents::CheckoutIntentPurchaseParams::Constraints)
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
attr_reader :constraints
|
|
46
|
+
|
|
47
|
+
sig do
|
|
48
|
+
params(
|
|
49
|
+
constraints:
|
|
50
|
+
CheckoutIntents::CheckoutIntentPurchaseParams::Constraints::OrHash
|
|
51
|
+
).void
|
|
52
|
+
end
|
|
53
|
+
attr_writer :constraints
|
|
54
|
+
|
|
55
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
56
|
+
attr_reader :promo_codes
|
|
57
|
+
|
|
58
|
+
sig { params(promo_codes: T::Array[String]).void }
|
|
59
|
+
attr_writer :promo_codes
|
|
60
|
+
|
|
61
|
+
sig { returns(T.nilable(T::Array[CheckoutIntents::VariantSelection])) }
|
|
62
|
+
attr_reader :variant_selections
|
|
63
|
+
|
|
64
|
+
sig do
|
|
65
|
+
params(
|
|
66
|
+
variant_selections:
|
|
67
|
+
T::Array[CheckoutIntents::VariantSelection::OrHash]
|
|
68
|
+
).void
|
|
69
|
+
end
|
|
70
|
+
attr_writer :variant_selections
|
|
71
|
+
|
|
72
|
+
sig do
|
|
73
|
+
params(
|
|
74
|
+
buyer: CheckoutIntents::Buyer::OrHash,
|
|
75
|
+
payment_method:
|
|
76
|
+
T.any(
|
|
77
|
+
CheckoutIntents::PaymentMethod::StripeTokenPaymentMethod::OrHash,
|
|
78
|
+
CheckoutIntents::PaymentMethod::BasisTheoryPaymentMethod::OrHash,
|
|
79
|
+
CheckoutIntents::PaymentMethod::NekudaPaymentMethod::OrHash
|
|
80
|
+
),
|
|
81
|
+
product_url: String,
|
|
82
|
+
quantity: Float,
|
|
83
|
+
constraints:
|
|
84
|
+
CheckoutIntents::CheckoutIntentPurchaseParams::Constraints::OrHash,
|
|
85
|
+
promo_codes: T::Array[String],
|
|
86
|
+
variant_selections:
|
|
87
|
+
T::Array[CheckoutIntents::VariantSelection::OrHash],
|
|
88
|
+
request_options: CheckoutIntents::RequestOptions::OrHash
|
|
89
|
+
).returns(T.attached_class)
|
|
90
|
+
end
|
|
91
|
+
def self.new(
|
|
92
|
+
buyer:,
|
|
93
|
+
payment_method:,
|
|
94
|
+
product_url:,
|
|
95
|
+
quantity:,
|
|
96
|
+
constraints: nil,
|
|
97
|
+
promo_codes: nil,
|
|
98
|
+
variant_selections: nil,
|
|
99
|
+
request_options: {}
|
|
100
|
+
)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
sig do
|
|
104
|
+
override.returns(
|
|
105
|
+
{
|
|
106
|
+
buyer: CheckoutIntents::Buyer,
|
|
107
|
+
payment_method:
|
|
108
|
+
T.any(
|
|
109
|
+
CheckoutIntents::PaymentMethod::StripeTokenPaymentMethod,
|
|
110
|
+
CheckoutIntents::PaymentMethod::BasisTheoryPaymentMethod,
|
|
111
|
+
CheckoutIntents::PaymentMethod::NekudaPaymentMethod
|
|
112
|
+
),
|
|
113
|
+
product_url: String,
|
|
114
|
+
quantity: Float,
|
|
115
|
+
constraints:
|
|
116
|
+
CheckoutIntents::CheckoutIntentPurchaseParams::Constraints,
|
|
117
|
+
promo_codes: T::Array[String],
|
|
118
|
+
variant_selections: T::Array[CheckoutIntents::VariantSelection],
|
|
119
|
+
request_options: CheckoutIntents::RequestOptions
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
end
|
|
123
|
+
def to_hash
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
class Constraints < CheckoutIntents::Internal::Type::BaseModel
|
|
127
|
+
OrHash =
|
|
128
|
+
T.type_alias do
|
|
129
|
+
T.any(
|
|
130
|
+
CheckoutIntents::CheckoutIntentPurchaseParams::Constraints,
|
|
131
|
+
CheckoutIntents::Internal::AnyHash
|
|
132
|
+
)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
sig { returns(T.nilable(Integer)) }
|
|
136
|
+
attr_reader :max_shipping_price
|
|
137
|
+
|
|
138
|
+
sig { params(max_shipping_price: Integer).void }
|
|
139
|
+
attr_writer :max_shipping_price
|
|
140
|
+
|
|
141
|
+
sig { returns(T.nilable(Integer)) }
|
|
142
|
+
attr_reader :max_total_price
|
|
143
|
+
|
|
144
|
+
sig { params(max_total_price: Integer).void }
|
|
145
|
+
attr_writer :max_total_price
|
|
146
|
+
|
|
147
|
+
sig do
|
|
148
|
+
params(max_shipping_price: Integer, max_total_price: Integer).returns(
|
|
149
|
+
T.attached_class
|
|
150
|
+
)
|
|
151
|
+
end
|
|
152
|
+
def self.new(max_shipping_price: nil, max_total_price: nil)
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
sig do
|
|
156
|
+
override.returns(
|
|
157
|
+
{ max_shipping_price: Integer, max_total_price: Integer }
|
|
158
|
+
)
|
|
159
|
+
end
|
|
160
|
+
def to_hash
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module CheckoutIntents
|
|
4
|
+
module Models
|
|
5
|
+
class CheckoutIntentRetrieveParams < 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::CheckoutIntentRetrieveParams,
|
|
13
|
+
CheckoutIntents::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(
|
|
19
|
+
request_options: CheckoutIntents::RequestOptions::OrHash
|
|
20
|
+
).returns(T.attached_class)
|
|
21
|
+
end
|
|
22
|
+
def self.new(request_options: {})
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
override.returns({ request_options: CheckoutIntents::RequestOptions })
|
|
27
|
+
end
|
|
28
|
+
def to_hash
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module CheckoutIntents
|
|
4
|
+
module Models
|
|
5
|
+
class CheckoutSession < CheckoutIntents::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
CheckoutIntents::CheckoutSession,
|
|
10
|
+
CheckoutIntents::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# URL to send your user to for checkout. This URL is valid for 4 hours.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :url
|
|
17
|
+
|
|
18
|
+
# A checkout session represents a hosted checkout form that shoppers can use to
|
|
19
|
+
# complete their purchases.
|
|
20
|
+
#
|
|
21
|
+
# Checkout sessions provide a pre-built UI for collecting payment and shipping
|
|
22
|
+
# information, allowing you to quickly integrate checkout functionality without
|
|
23
|
+
# building your own forms.
|
|
24
|
+
sig { params(url: String).returns(T.attached_class) }
|
|
25
|
+
def self.new(
|
|
26
|
+
# URL to send your user to for checkout. This URL is valid for 4 hours.
|
|
27
|
+
url:
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
sig { override.returns({ url: String }) }
|
|
32
|
+
def to_hash
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module CheckoutIntents
|
|
4
|
+
module Models
|
|
5
|
+
class Money < CheckoutIntents::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(CheckoutIntents::Money, CheckoutIntents::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(Float) }
|
|
12
|
+
attr_accessor :amount_subunits
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :currency_code
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(amount_subunits: Float, currency_code: String).returns(
|
|
19
|
+
T.attached_class
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
def self.new(amount_subunits:, currency_code:)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
override.returns({ amount_subunits: Float, currency_code: String })
|
|
27
|
+
end
|
|
28
|
+
def to_hash
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|