checkout-intents 0.1.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8cf5e6cd633f4f7ee6338c4bea928549742449f2866fa6bbd2ae92b6421ef31c
4
- data.tar.gz: 852728890666c85d7d1a0e8adeda2d59a5b2ce29c3cee5e3799044f740f9e543
3
+ metadata.gz: 7d8d5a1ddee326274b3bf70f1984a643b09a03d67b92f5a2ae000ca6a82e538d
4
+ data.tar.gz: 85113215243021df5e95cf03ec0a7b77c471c653ff88e5b2bb4d300b980554de
5
5
  SHA512:
6
- metadata.gz: 0034c8b0230278a365e8d1193ba49d1cd32e9fc03a69794436e2ef407dcd73b6b7637e40587951695621099bc0e71a619725f896e91d0b1e335bef346cbae651
7
- data.tar.gz: 2f2dfb10980745a1f0f3b127a4e31faac529af16e3091c753d7f53e9341e29ac558c3308ca68cfcd33a1033cab7299fc47f05e78e1ba7a85938fc472384596df
6
+ metadata.gz: 7dc143a24721befccedb01f1c4449d02c23966b325bfbac050dda2fe238a1cf655472ba98216024d8e6bac18c78493f68e4145aef435675a46fbe7ee665c8914
7
+ data.tar.gz: a9f2fdfc3c4e44176ad6fa2fe41050c3919693ca31a0d75d90f3adccc8e49e3e5e8554ecde12295b3c91907d664427a5806f693dd14a5427ebd915b1daeb6f52
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.1 (2026-01-13)
4
+
5
+ Full Changelog: [v0.2.0...v0.2.1](https://github.com/rye-com/checkout-intents-ruby/compare/v0.2.0...v0.2.1)
6
+
7
+ ### Bug Fixes
8
+
9
+ * **api:** handle optional args ([8ef7d2b](https://github.com/rye-com/checkout-intents-ruby/commit/8ef7d2b96781b484a96a4c6c7cb8fff1c52f5a05))
10
+
11
+ ## 0.2.0 (2026-01-12)
12
+
13
+ Full Changelog: [v0.1.0...v0.2.0](https://github.com/rye-com/checkout-intents-ruby/compare/v0.1.0...v0.2.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** convert polling helpers to flat keyword args ([0b0893e](https://github.com/rye-com/checkout-intents-ruby/commit/0b0893e255447c6ef35a81196c7481242f7eab8b))
18
+
19
+
20
+ ### Chores
21
+
22
+ * **api:** coerce `quantity` to an `Integer` ([e32b3fc](https://github.com/rye-com/checkout-intents-ruby/commit/e32b3fc5848bfd455cba755cceddfd94f5d40da0))
23
+
3
24
  ## 0.1.0 (2026-01-12)
4
25
 
5
26
  Full Changelog: [v0.0.2...v0.1.0](https://github.com/rye-com/checkout-intents-ruby/compare/v0.0.2...v0.1.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "checkout-intents", "~> 0.1.0"
20
+ gem "checkout-intents", "~> 0.2.1"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -25,8 +25,8 @@ module CheckoutIntents
25
25
 
26
26
  # @!attribute quantity
27
27
  #
28
- # @return [Float]
29
- required :quantity, Float
28
+ # @return [Integer]
29
+ required :quantity, Integer
30
30
 
31
31
  # @!attribute constraints
32
32
  #
@@ -50,7 +50,7 @@ module CheckoutIntents
50
50
  # @param buyer [CheckoutIntents::Models::Buyer]
51
51
  # @param created_at [Time]
52
52
  # @param product_url [String]
53
- # @param quantity [Float]
53
+ # @param quantity [Integer]
54
54
  # @param constraints [CheckoutIntents::Models::BaseCheckoutIntent::Constraints]
55
55
  # @param promo_codes [Array<String>]
56
56
  # @param variant_selections [Array<CheckoutIntents::Models::VariantSelection>]
@@ -15,8 +15,8 @@ module CheckoutIntents
15
15
 
16
16
  # @!attribute quantity
17
17
  #
18
- # @return [Float]
19
- required :quantity, Float
18
+ # @return [Integer]
19
+ required :quantity, Integer
20
20
 
21
21
  # @!attribute buyer
22
22
  # Optional buyer information, used to pre-fill the checkout form with the buyer's
@@ -48,7 +48,7 @@ module CheckoutIntents
48
48
  #
49
49
  # @param product_url [String]
50
50
  #
51
- # @param quantity [Float]
51
+ # @param quantity [Integer]
52
52
  #
53
53
  # @param buyer [CheckoutIntents::Models::Betas::CheckoutSessionCreateParams::Buyer] Optional buyer information, used to pre-fill the checkout form with the buyer's
54
54
  #
@@ -19,8 +19,8 @@ module CheckoutIntents
19
19
 
20
20
  # @!attribute quantity
21
21
  #
22
- # @return [Float]
23
- required :quantity, Float
22
+ # @return [Integer]
23
+ required :quantity, Integer
24
24
 
25
25
  # @!attribute constraints
26
26
  #
@@ -42,7 +42,7 @@ module CheckoutIntents
42
42
  # @!method initialize(buyer:, product_url:, quantity:, constraints: nil, promo_codes: nil, variant_selections: nil, request_options: {})
43
43
  # @param buyer [CheckoutIntents::Models::Buyer]
44
44
  # @param product_url [String]
45
- # @param quantity [Float]
45
+ # @param quantity [Integer]
46
46
  # @param constraints [CheckoutIntents::Models::CheckoutIntentCreateParams::Constraints]
47
47
  # @param promo_codes [Array<String>]
48
48
  # @param variant_selections [Array<CheckoutIntents::Models::VariantSelection>]
@@ -24,8 +24,8 @@ module CheckoutIntents
24
24
 
25
25
  # @!attribute quantity
26
26
  #
27
- # @return [Float]
28
- required :quantity, Float
27
+ # @return [Integer]
28
+ required :quantity, Integer
29
29
 
30
30
  # @!attribute constraints
31
31
  #
@@ -48,7 +48,7 @@ module CheckoutIntents
48
48
  # @param buyer [CheckoutIntents::Models::Buyer]
49
49
  # @param payment_method [CheckoutIntents::Models::PaymentMethod::StripeTokenPaymentMethod, CheckoutIntents::Models::PaymentMethod::BasisTheoryPaymentMethod, CheckoutIntents::Models::PaymentMethod::NekudaPaymentMethod]
50
50
  # @param product_url [String]
51
- # @param quantity [Float]
51
+ # @param quantity [Integer]
52
52
  # @param constraints [CheckoutIntents::Models::CheckoutIntentPurchaseParams::Constraints]
53
53
  # @param promo_codes [Array<String>]
54
54
  # @param variant_selections [Array<CheckoutIntents::Models::VariantSelection>]
@@ -16,7 +16,7 @@ module CheckoutIntents
16
16
  #
17
17
  # @param product_url [String]
18
18
  #
19
- # @param quantity [Float]
19
+ # @param quantity [Integer]
20
20
  #
21
21
  # @param buyer [::CheckoutIntents::Models::Betas::CheckoutSessionCreateParams::Buyer] Optional buyer information, used to pre-fill the checkout form with the buyer's
22
22
  #
@@ -14,7 +14,7 @@ module CheckoutIntents
14
14
  #
15
15
  # @param buyer [::CheckoutIntents::Models::Buyer]
16
16
  # @param product_url [String]
17
- # @param quantity [Float]
17
+ # @param quantity [Integer]
18
18
  # @param constraints [::CheckoutIntents::Models::CheckoutIntentCreateParams::Constraints]
19
19
  # @param promo_codes [Array<String>]
20
20
  # @param variant_selections [Array<::CheckoutIntents::Models::VariantSelection>]
@@ -147,7 +147,7 @@ module CheckoutIntents
147
147
  # @param buyer [::CheckoutIntents::Models::Buyer]
148
148
  # @param payment_method [::CheckoutIntents::Models::PaymentMethod::StripeTokenPaymentMethod, ::CheckoutIntents::Models::PaymentMethod::BasisTheoryPaymentMethod, ::CheckoutIntents::Models::PaymentMethod::NekudaPaymentMethod]
149
149
  # @param product_url [String]
150
- # @param quantity [Float]
150
+ # @param quantity [Integer]
151
151
  # @param constraints [::CheckoutIntents::Models::CheckoutIntentPurchaseParams::Constraints]
152
152
  # @param promo_codes [Array<String>]
153
153
  # @param variant_selections [Array<::CheckoutIntents::Models::VariantSelection>]
@@ -247,7 +247,7 @@ module CheckoutIntents
247
247
  #
248
248
  # @param buyer [::CheckoutIntents::Models::Buyer]
249
249
  # @param product_url [String]
250
- # @param quantity [Float]
250
+ # @param quantity [Integer]
251
251
  # @param constraints [::CheckoutIntents::Models::CheckoutIntentCreateParams::Constraints]
252
252
  # @param promo_codes [Array<String>]
253
253
  # @param variant_selections [Array<::CheckoutIntents::Models::VariantSelection>]
@@ -267,16 +267,32 @@ module CheckoutIntents
267
267
  # )
268
268
  # puts "Total: #{intent.offer.cost.total}"
269
269
  def create_and_poll(
270
- params,
270
+ buyer:,
271
+ product_url:,
272
+ quantity:,
273
+ constraints: nil,
274
+ promo_codes: nil,
275
+ variant_selections: nil,
271
276
  poll_interval: DEFAULT_POLL_INTERVAL,
272
- max_attempts: DEFAULT_MAX_ATTEMPTS
277
+ max_attempts: DEFAULT_MAX_ATTEMPTS,
278
+ request_options: {}
273
279
  )
274
- intent = create(params)
280
+ create_params = {
281
+ buyer: buyer,
282
+ product_url: product_url,
283
+ quantity: quantity,
284
+ request_options: request_options
285
+ }
286
+ create_params[:constraints] = constraints if constraints
287
+ create_params[:promo_codes] = promo_codes if promo_codes
288
+ create_params[:variant_selections] = variant_selections if variant_selections
289
+
290
+ intent = create(create_params)
275
291
  poll_until_awaiting_confirmation(
276
292
  intent.id,
277
293
  poll_interval: poll_interval,
278
294
  max_attempts: max_attempts,
279
- request_options: params[:request_options] || {}
295
+ request_options: request_options
280
296
  )
281
297
  end
282
298
 
@@ -306,16 +322,17 @@ module CheckoutIntents
306
322
  # end
307
323
  def confirm_and_poll(
308
324
  id,
309
- params,
325
+ payment_method:,
310
326
  poll_interval: DEFAULT_POLL_INTERVAL,
311
- max_attempts: DEFAULT_MAX_ATTEMPTS
327
+ max_attempts: DEFAULT_MAX_ATTEMPTS,
328
+ request_options: {}
312
329
  )
313
- intent = confirm(id, params)
330
+ intent = confirm(id, payment_method: payment_method, request_options: request_options)
314
331
  poll_until_completed(
315
332
  intent.id,
316
333
  poll_interval: poll_interval,
317
334
  max_attempts: max_attempts,
318
- request_options: params[:request_options] || {}
335
+ request_options: request_options
319
336
  )
320
337
  end
321
338
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CheckoutIntents
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.1"
5
5
  end
@@ -64,7 +64,7 @@ module CheckoutIntents
64
64
  buyer: CheckoutIntents::Buyer::OrHash,
65
65
  created_at: Time,
66
66
  product_url: String,
67
- quantity: Float,
67
+ quantity: Integer,
68
68
  constraints: CheckoutIntents::BaseCheckoutIntent::Constraints::OrHash,
69
69
  promo_codes: T::Array[String],
70
70
  variant_selections:
@@ -90,7 +90,7 @@ module CheckoutIntents
90
90
  buyer: CheckoutIntents::Buyer,
91
91
  created_at: Time,
92
92
  product_url: String,
93
- quantity: Float,
93
+ quantity: Integer,
94
94
  constraints: CheckoutIntents::BaseCheckoutIntent::Constraints,
95
95
  promo_codes: T::Array[String],
96
96
  variant_selections: T::Array[CheckoutIntents::VariantSelection]
@@ -77,7 +77,7 @@ module CheckoutIntents
77
77
  sig do
78
78
  params(
79
79
  product_url: String,
80
- quantity: Float,
80
+ quantity: Integer,
81
81
  buyer:
82
82
  CheckoutIntents::Betas::CheckoutSessionCreateParams::Buyer::OrHash,
83
83
  constraints:
@@ -105,7 +105,7 @@ module CheckoutIntents
105
105
  override.returns(
106
106
  {
107
107
  product_url: String,
108
- quantity: Float,
108
+ quantity: Integer,
109
109
  buyer: CheckoutIntents::Betas::CheckoutSessionCreateParams::Buyer,
110
110
  constraints:
111
111
  CheckoutIntents::Betas::CheckoutSessionCreateParams::Constraints,
@@ -62,7 +62,7 @@ module CheckoutIntents
62
62
  params(
63
63
  buyer: CheckoutIntents::Buyer::OrHash,
64
64
  product_url: String,
65
- quantity: Float,
65
+ quantity: Integer,
66
66
  constraints:
67
67
  CheckoutIntents::CheckoutIntentCreateParams::Constraints::OrHash,
68
68
  promo_codes: T::Array[String],
@@ -87,7 +87,7 @@ module CheckoutIntents
87
87
  {
88
88
  buyer: CheckoutIntents::Buyer,
89
89
  product_url: String,
90
- quantity: Float,
90
+ quantity: Integer,
91
91
  constraints:
92
92
  CheckoutIntents::CheckoutIntentCreateParams::Constraints,
93
93
  promo_codes: T::Array[String],
@@ -79,7 +79,7 @@ module CheckoutIntents
79
79
  CheckoutIntents::PaymentMethod::NekudaPaymentMethod::OrHash
80
80
  ),
81
81
  product_url: String,
82
- quantity: Float,
82
+ quantity: Integer,
83
83
  constraints:
84
84
  CheckoutIntents::CheckoutIntentPurchaseParams::Constraints::OrHash,
85
85
  promo_codes: T::Array[String],
@@ -111,7 +111,7 @@ module CheckoutIntents
111
111
  CheckoutIntents::PaymentMethod::NekudaPaymentMethod
112
112
  ),
113
113
  product_url: String,
114
- quantity: Float,
114
+ quantity: Integer,
115
115
  constraints:
116
116
  CheckoutIntents::CheckoutIntentPurchaseParams::Constraints,
117
117
  promo_codes: T::Array[String],
@@ -11,7 +11,7 @@ module CheckoutIntents
11
11
  sig do
12
12
  params(
13
13
  product_url: String,
14
- quantity: Float,
14
+ quantity: Integer,
15
15
  buyer:
16
16
  ::CheckoutIntents::Betas::CheckoutSessionCreateParams::Buyer::OrHash,
17
17
  constraints:
@@ -8,7 +8,7 @@ module CheckoutIntents
8
8
  params(
9
9
  buyer: ::CheckoutIntents::Buyer::OrHash,
10
10
  product_url: String,
11
- quantity: Float,
11
+ quantity: Integer,
12
12
  constraints:
13
13
  ::CheckoutIntents::CheckoutIntentCreateParams::Constraints::OrHash,
14
14
  promo_codes: T::Array[String],
@@ -135,7 +135,7 @@ module CheckoutIntents
135
135
  ::CheckoutIntents::PaymentMethod::NekudaPaymentMethod::OrHash
136
136
  ),
137
137
  product_url: String,
138
- quantity: Float,
138
+ quantity: Integer,
139
139
  constraints:
140
140
  ::CheckoutIntents::CheckoutIntentPurchaseParams::Constraints::OrHash,
141
141
  promo_codes: T::Array[String],
@@ -209,9 +209,17 @@ module CheckoutIntents
209
209
  # Create a checkout intent and poll until it's ready for confirmation.
210
210
  sig do
211
211
  params(
212
- params: T::Hash[Symbol, T.anything],
212
+ buyer: ::CheckoutIntents::Buyer::OrHash,
213
+ product_url: String,
214
+ quantity: Integer,
215
+ constraints:
216
+ ::CheckoutIntents::CheckoutIntentCreateParams::Constraints::OrHash,
217
+ promo_codes: T::Array[String],
218
+ variant_selections:
219
+ T::Array[::CheckoutIntents::VariantSelection::OrHash],
213
220
  poll_interval: Float,
214
- max_attempts: Integer
221
+ max_attempts: Integer,
222
+ request_options: ::CheckoutIntents::RequestOptions::OrHash
215
223
  ).returns(
216
224
  T.any(
217
225
  ::CheckoutIntents::CheckoutIntent::AwaitingConfirmationCheckoutIntent,
@@ -220,9 +228,15 @@ module CheckoutIntents
220
228
  )
221
229
  end
222
230
  def create_and_poll(
223
- params,
231
+ buyer:,
232
+ product_url:,
233
+ quantity:,
234
+ constraints: nil,
235
+ promo_codes: nil,
236
+ variant_selections: nil,
224
237
  poll_interval: DEFAULT_POLL_INTERVAL,
225
- max_attempts: DEFAULT_MAX_ATTEMPTS
238
+ max_attempts: DEFAULT_MAX_ATTEMPTS,
239
+ request_options: {}
226
240
  )
227
241
  end
228
242
 
@@ -230,9 +244,15 @@ module CheckoutIntents
230
244
  sig do
231
245
  params(
232
246
  id: String,
233
- params: T::Hash[Symbol, T.anything],
247
+ payment_method:
248
+ T.any(
249
+ ::CheckoutIntents::PaymentMethod::StripeTokenPaymentMethod::OrHash,
250
+ ::CheckoutIntents::PaymentMethod::BasisTheoryPaymentMethod::OrHash,
251
+ ::CheckoutIntents::PaymentMethod::NekudaPaymentMethod::OrHash
252
+ ),
234
253
  poll_interval: Float,
235
- max_attempts: Integer
254
+ max_attempts: Integer,
255
+ request_options: ::CheckoutIntents::RequestOptions::OrHash
236
256
  ).returns(
237
257
  T.any(
238
258
  ::CheckoutIntents::CheckoutIntent::CompletedCheckoutIntent,
@@ -242,9 +262,10 @@ module CheckoutIntents
242
262
  end
243
263
  def confirm_and_poll(
244
264
  id,
245
- params,
265
+ payment_method:,
246
266
  poll_interval: DEFAULT_POLL_INTERVAL,
247
- max_attempts: DEFAULT_MAX_ATTEMPTS
267
+ max_attempts: DEFAULT_MAX_ATTEMPTS,
268
+ request_options: {}
248
269
  )
249
270
  end
250
271
 
@@ -6,7 +6,7 @@ module CheckoutIntents
6
6
  buyer: CheckoutIntents::Buyer,
7
7
  created_at: Time,
8
8
  product_url: String,
9
- quantity: Float,
9
+ quantity: Integer,
10
10
  constraints: CheckoutIntents::BaseCheckoutIntent::Constraints,
11
11
  promo_codes: ::Array[String],
12
12
  variant_selections: ::Array[CheckoutIntents::VariantSelection]
@@ -21,7 +21,7 @@ module CheckoutIntents
21
21
 
22
22
  attr_accessor product_url: String
23
23
 
24
- attr_accessor quantity: Float
24
+ attr_accessor quantity: Integer
25
25
 
26
26
  attr_reader constraints: CheckoutIntents::BaseCheckoutIntent::Constraints?
27
27
 
@@ -44,7 +44,7 @@ module CheckoutIntents
44
44
  buyer: CheckoutIntents::Buyer,
45
45
  created_at: Time,
46
46
  product_url: String,
47
- quantity: Float,
47
+ quantity: Integer,
48
48
  ?constraints: CheckoutIntents::BaseCheckoutIntent::Constraints,
49
49
  ?promo_codes: ::Array[String],
50
50
  ?variant_selections: ::Array[CheckoutIntents::VariantSelection]
@@ -55,7 +55,7 @@ module CheckoutIntents
55
55
  buyer: CheckoutIntents::Buyer,
56
56
  created_at: Time,
57
57
  product_url: String,
58
- quantity: Float,
58
+ quantity: Integer,
59
59
  constraints: CheckoutIntents::BaseCheckoutIntent::Constraints,
60
60
  promo_codes: ::Array[String],
61
61
  variant_selections: ::Array[CheckoutIntents::VariantSelection]
@@ -4,7 +4,7 @@ module CheckoutIntents
4
4
  type checkout_session_create_params =
5
5
  {
6
6
  product_url: String,
7
- quantity: Float,
7
+ quantity: Integer,
8
8
  buyer: CheckoutIntents::Betas::CheckoutSessionCreateParams::Buyer,
9
9
  constraints: CheckoutIntents::Betas::CheckoutSessionCreateParams::Constraints,
10
10
  promo_codes: ::Array[String],
@@ -18,7 +18,7 @@ module CheckoutIntents
18
18
 
19
19
  attr_accessor product_url: String
20
20
 
21
- attr_accessor quantity: Float
21
+ attr_accessor quantity: Integer
22
22
 
23
23
  attr_reader buyer: CheckoutIntents::Betas::CheckoutSessionCreateParams::Buyer?
24
24
 
@@ -44,7 +44,7 @@ module CheckoutIntents
44
44
 
45
45
  def initialize: (
46
46
  product_url: String,
47
- quantity: Float,
47
+ quantity: Integer,
48
48
  ?buyer: CheckoutIntents::Betas::CheckoutSessionCreateParams::Buyer,
49
49
  ?constraints: CheckoutIntents::Betas::CheckoutSessionCreateParams::Constraints,
50
50
  ?promo_codes: ::Array[String],
@@ -54,7 +54,7 @@ module CheckoutIntents
54
54
 
55
55
  def to_hash: -> {
56
56
  product_url: String,
57
- quantity: Float,
57
+ quantity: Integer,
58
58
  buyer: CheckoutIntents::Betas::CheckoutSessionCreateParams::Buyer,
59
59
  constraints: CheckoutIntents::Betas::CheckoutSessionCreateParams::Constraints,
60
60
  promo_codes: ::Array[String],
@@ -4,7 +4,7 @@ module CheckoutIntents
4
4
  {
5
5
  buyer: CheckoutIntents::Buyer,
6
6
  product_url: String,
7
- quantity: Float,
7
+ quantity: Integer,
8
8
  constraints: CheckoutIntents::CheckoutIntentCreateParams::Constraints,
9
9
  promo_codes: ::Array[String],
10
10
  variant_selections: ::Array[CheckoutIntents::VariantSelection]
@@ -19,7 +19,7 @@ module CheckoutIntents
19
19
 
20
20
  attr_accessor product_url: String
21
21
 
22
- attr_accessor quantity: Float
22
+ attr_accessor quantity: Integer
23
23
 
24
24
  attr_reader constraints: CheckoutIntents::CheckoutIntentCreateParams::Constraints?
25
25
 
@@ -40,7 +40,7 @@ module CheckoutIntents
40
40
  def initialize: (
41
41
  buyer: CheckoutIntents::Buyer,
42
42
  product_url: String,
43
- quantity: Float,
43
+ quantity: Integer,
44
44
  ?constraints: CheckoutIntents::CheckoutIntentCreateParams::Constraints,
45
45
  ?promo_codes: ::Array[String],
46
46
  ?variant_selections: ::Array[CheckoutIntents::VariantSelection],
@@ -50,7 +50,7 @@ module CheckoutIntents
50
50
  def to_hash: -> {
51
51
  buyer: CheckoutIntents::Buyer,
52
52
  product_url: String,
53
- quantity: Float,
53
+ quantity: Integer,
54
54
  constraints: CheckoutIntents::CheckoutIntentCreateParams::Constraints,
55
55
  promo_codes: ::Array[String],
56
56
  variant_selections: ::Array[CheckoutIntents::VariantSelection],
@@ -5,7 +5,7 @@ module CheckoutIntents
5
5
  buyer: CheckoutIntents::Buyer,
6
6
  payment_method: CheckoutIntents::Models::payment_method,
7
7
  product_url: String,
8
- quantity: Float,
8
+ quantity: Integer,
9
9
  constraints: CheckoutIntents::CheckoutIntentPurchaseParams::Constraints,
10
10
  promo_codes: ::Array[String],
11
11
  variant_selections: ::Array[CheckoutIntents::VariantSelection]
@@ -22,7 +22,7 @@ module CheckoutIntents
22
22
 
23
23
  attr_accessor product_url: String
24
24
 
25
- attr_accessor quantity: Float
25
+ attr_accessor quantity: Integer
26
26
 
27
27
  attr_reader constraints: CheckoutIntents::CheckoutIntentPurchaseParams::Constraints?
28
28
 
@@ -44,7 +44,7 @@ module CheckoutIntents
44
44
  buyer: CheckoutIntents::Buyer,
45
45
  payment_method: CheckoutIntents::Models::payment_method,
46
46
  product_url: String,
47
- quantity: Float,
47
+ quantity: Integer,
48
48
  ?constraints: CheckoutIntents::CheckoutIntentPurchaseParams::Constraints,
49
49
  ?promo_codes: ::Array[String],
50
50
  ?variant_selections: ::Array[CheckoutIntents::VariantSelection],
@@ -55,7 +55,7 @@ module CheckoutIntents
55
55
  buyer: CheckoutIntents::Buyer,
56
56
  payment_method: CheckoutIntents::Models::payment_method,
57
57
  product_url: String,
58
- quantity: Float,
58
+ quantity: Integer,
59
59
  constraints: CheckoutIntents::CheckoutIntentPurchaseParams::Constraints,
60
60
  promo_codes: ::Array[String],
61
61
  variant_selections: ::Array[CheckoutIntents::VariantSelection],
@@ -4,7 +4,7 @@ module CheckoutIntents
4
4
  class CheckoutSessions
5
5
  def create: (
6
6
  product_url: String,
7
- quantity: Float,
7
+ quantity: Integer,
8
8
  ?buyer: CheckoutIntents::Betas::CheckoutSessionCreateParams::Buyer,
9
9
  ?constraints: CheckoutIntents::Betas::CheckoutSessionCreateParams::Constraints,
10
10
  ?promo_codes: ::Array[String],
@@ -4,7 +4,7 @@ module CheckoutIntents
4
4
  def create: (
5
5
  buyer: CheckoutIntents::Buyer,
6
6
  product_url: String,
7
- quantity: Float,
7
+ quantity: Integer,
8
8
  ?constraints: CheckoutIntents::CheckoutIntentCreateParams::Constraints,
9
9
  ?promo_codes: ::Array[String],
10
10
  ?variant_selections: ::Array[CheckoutIntents::VariantSelection],
@@ -41,13 +41,47 @@ module CheckoutIntents
41
41
  buyer: CheckoutIntents::Buyer,
42
42
  payment_method: CheckoutIntents::Models::payment_method,
43
43
  product_url: String,
44
- quantity: Float,
44
+ quantity: Integer,
45
45
  ?constraints: CheckoutIntents::CheckoutIntentPurchaseParams::Constraints,
46
46
  ?promo_codes: ::Array[String],
47
47
  ?variant_selections: ::Array[CheckoutIntents::VariantSelection],
48
48
  ?request_options: CheckoutIntents::request_opts
49
49
  ) -> CheckoutIntents::Models::checkout_intent
50
50
 
51
+ def poll_until_completed: (
52
+ String id,
53
+ ?poll_interval: Float,
54
+ ?max_attempts: Integer,
55
+ ?request_options: CheckoutIntents::request_opts
56
+ ) -> (CheckoutIntents::CheckoutIntent::CompletedCheckoutIntent | CheckoutIntents::CheckoutIntent::FailedCheckoutIntent)
57
+
58
+ def poll_until_awaiting_confirmation: (
59
+ String id,
60
+ ?poll_interval: Float,
61
+ ?max_attempts: Integer,
62
+ ?request_options: CheckoutIntents::request_opts
63
+ ) -> (CheckoutIntents::CheckoutIntent::AwaitingConfirmationCheckoutIntent | CheckoutIntents::CheckoutIntent::FailedCheckoutIntent)
64
+
65
+ def create_and_poll: (
66
+ buyer: CheckoutIntents::Buyer,
67
+ product_url: String,
68
+ quantity: Integer,
69
+ ?constraints: CheckoutIntents::CheckoutIntentCreateParams::Constraints,
70
+ ?promo_codes: ::Array[String],
71
+ ?variant_selections: ::Array[CheckoutIntents::VariantSelection],
72
+ ?poll_interval: Float,
73
+ ?max_attempts: Integer,
74
+ ?request_options: CheckoutIntents::request_opts
75
+ ) -> (CheckoutIntents::CheckoutIntent::AwaitingConfirmationCheckoutIntent | CheckoutIntents::CheckoutIntent::FailedCheckoutIntent)
76
+
77
+ def confirm_and_poll: (
78
+ String id,
79
+ payment_method: CheckoutIntents::Models::payment_method,
80
+ ?poll_interval: Float,
81
+ ?max_attempts: Integer,
82
+ ?request_options: CheckoutIntents::request_opts
83
+ ) -> (CheckoutIntents::CheckoutIntent::CompletedCheckoutIntent | CheckoutIntents::CheckoutIntent::FailedCheckoutIntent)
84
+
51
85
  def initialize: (client: CheckoutIntents::Client) -> void
52
86
  end
53
87
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkout-intents
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Checkout Intents
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-12 00:00:00.000000000 Z
11
+ date: 2026-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi