inttegro 9.1.0 → 9.2.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 +6 -0
- data/lib/inttegro/generated/enums.rb +1 -0
- data/lib/inttegro/generated/models.rb +6 -0
- data/lib/inttegro/http_client.rb +26 -1
- data/lib/inttegro/price/catalog_price.rb +27 -4
- data/lib/inttegro/price/catalog_price_params.rb +24 -6
- data/lib/inttegro/price/customer_selected_amount.rb +50 -0
- data/lib/inttegro/price/customer_selected_amount_params.rb +51 -0
- data/lib/inttegro/price/suggested_amount.rb +41 -0
- data/lib/inttegro/price/suggested_amount_params.rb +41 -0
- data/lib/inttegro/price/type.rb +27 -0
- data/lib/inttegro/product/add_price_request.rb +22 -5
- data/lib/inttegro/product/catalog_with_customer_selected_price.rb +43 -0
- data/lib/inttegro/product/customer_selected_price_input.rb +37 -0
- data/lib/inttegro/product/details.rb +5 -4
- data/lib/inttegro/product/line_item.rb +2 -2
- data/lib/inttegro/product/price_summary.rb +27 -4
- data/lib/inttegro/resources/prices.rb +1 -1
- data/lib/inttegro/version.rb +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 192fa0d6bd78a893b0577e6cea06f93a1577b4356176267125090f760c396e7f
|
|
4
|
+
data.tar.gz: de934a47ffb8c6028236f58560e18e34435c6db06489b7eb8770203cd9b26f88
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b706cd2e9276468e0626ad7294e416507846250a1e7fa6d995fde9db98144412db9ceb25072c9f123e7e492b48b76ca62a389aa15941471741c6808e64bd1e40
|
|
7
|
+
data.tar.gz: 18a789789f0bc32f289910091f918425d84c5832ddaa94064c3d16ef9eba1c71c67eb88f8354375b1582c10f3f49ec1f59a87b8f570cab85c667aa188e9c8d3f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [9.2.0] - 2026-10-01
|
|
4
|
+
|
|
5
|
+
- Added typed fixed and customer-selected catalog price definitions, suggested
|
|
6
|
+
contribution amounts, and order line items that couple a catalog price with
|
|
7
|
+
the amount selected by the customer.
|
|
8
|
+
|
|
3
9
|
## [9.1.0] - 2026-09-27
|
|
4
10
|
|
|
5
11
|
- Added the required application-scoped customer fingerprint to typed customer
|
|
@@ -66,6 +66,7 @@ require_relative "../payment_method/tokenize_base_type"
|
|
|
66
66
|
require_relative "../payment_method/tokenize_mobile_money_request_type"
|
|
67
67
|
require_relative "../payment_method/type"
|
|
68
68
|
require_relative "../payout/status"
|
|
69
|
+
require_relative "../price/type"
|
|
69
70
|
require_relative "../product/line_item_type"
|
|
70
71
|
require_relative "../product/shipment_input_type"
|
|
71
72
|
require_relative "../product/shipment_type"
|
|
@@ -16,8 +16,12 @@ require_relative "../payment_method/verification"
|
|
|
16
16
|
require_relative "../payment_method/payment_method"
|
|
17
17
|
require_relative "../payment_method/activate_response"
|
|
18
18
|
require_relative "../money/amount_params"
|
|
19
|
+
require_relative "../price/suggested_amount_params"
|
|
20
|
+
require_relative "../price/customer_selected_amount_params"
|
|
19
21
|
require_relative "../product/add_price_request"
|
|
20
22
|
require_relative "../money/amount"
|
|
23
|
+
require_relative "../price/suggested_amount"
|
|
24
|
+
require_relative "../price/customer_selected_amount"
|
|
21
25
|
require_relative "../purchase_intent/product_attributes_item"
|
|
22
26
|
require_relative "../product/dimensions_physical"
|
|
23
27
|
require_relative "../product/dimensions_digital"
|
|
@@ -97,6 +101,8 @@ require_relative "../schedule/cancel_request"
|
|
|
97
101
|
require_relative "../file/actor_input"
|
|
98
102
|
require_relative "../upload_request/cancel_request"
|
|
99
103
|
require_relative "../price/catalog_price_params"
|
|
104
|
+
require_relative "../product/customer_selected_price_input"
|
|
105
|
+
require_relative "../product/catalog_with_customer_selected_price"
|
|
100
106
|
require_relative "../price/price_params"
|
|
101
107
|
require_relative "../product/catalog_with_price_data"
|
|
102
108
|
require_relative "../product/catalog_with_price_reference"
|
data/lib/inttegro/http_client.rb
CHANGED
|
@@ -712,7 +712,10 @@ module Inttegro
|
|
|
712
712
|
when "/products/create"
|
|
713
713
|
require_keys(body, %w[type name], path)
|
|
714
714
|
when "/products/add_price"
|
|
715
|
-
require_keys(body, %w[product_id
|
|
715
|
+
require_keys(body, %w[product_id], path)
|
|
716
|
+
validate_catalog_price_definition(body, path, require_product: true)
|
|
717
|
+
when "/prices/create"
|
|
718
|
+
validate_catalog_price_definition(body, path, require_product: true)
|
|
716
719
|
when "/products/set_default_unit_price"
|
|
717
720
|
require_keys(body, %w[product_id price_id], path)
|
|
718
721
|
when "/products/lookup", "/products/update", "/products/publish", "/products/unpublish", "/products/archive"
|
|
@@ -757,6 +760,28 @@ module Inttegro
|
|
|
757
760
|
raise ArgumentError, "Missing required fields for #{path}: one of #{keys.join(', ')}"
|
|
758
761
|
end
|
|
759
762
|
|
|
763
|
+
sig { params(body: Types::Payload, path: String, require_product: T::Boolean).void }
|
|
764
|
+
def validate_catalog_price_definition(body, path, require_product:)
|
|
765
|
+
legacy_amount = payload_value(body, "amount")
|
|
766
|
+
price_type = payload_value(body, "type")
|
|
767
|
+
fixed_amount = payload_value(body, "fixed_amount")
|
|
768
|
+
selected_amount = payload_value(body, "customer_selected_amount")
|
|
769
|
+
|
|
770
|
+
fixed = price_type == "fixed_amount" && present?(fixed_amount) &&
|
|
771
|
+
!present?(legacy_amount) && !present?(selected_amount)
|
|
772
|
+
selected = price_type == "customer_selected_amount" && present?(selected_amount) &&
|
|
773
|
+
!present?(legacy_amount) && !present?(fixed_amount)
|
|
774
|
+
selected &&= present?(payload_value(body, "product_id")) if require_product
|
|
775
|
+
return if [fixed, selected].count(true) == 1
|
|
776
|
+
|
|
777
|
+
raise ArgumentError, "Invalid price definition for #{path}: provide exactly one supported definition"
|
|
778
|
+
end
|
|
779
|
+
|
|
780
|
+
sig { params(body: Types::Payload, key: String).returns(Object) }
|
|
781
|
+
def payload_value(body, key)
|
|
782
|
+
body.key?(key) ? body[key] : body[key.to_sym]
|
|
783
|
+
end
|
|
784
|
+
|
|
760
785
|
sig { params(value: Object).returns(T::Boolean) }
|
|
761
786
|
def present?(value)
|
|
762
787
|
return false if value.nil?
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
7
|
require_relative "../money/amount"
|
|
8
|
+
require_relative "customer_selected_amount"
|
|
8
9
|
require_relative "embedded_product"
|
|
10
|
+
require_relative "type"
|
|
9
11
|
|
|
10
12
|
module Inttegro
|
|
11
13
|
class Price
|
|
@@ -41,11 +43,29 @@ module Inttegro
|
|
|
41
43
|
# Required in the API payload. Wire name: `active`.
|
|
42
44
|
# @return [Boolean]
|
|
43
45
|
#
|
|
46
|
+
# @!attribute [r] type
|
|
47
|
+
# Price definition discriminator
|
|
48
|
+
#
|
|
49
|
+
# Required in the API payload. Wire name: `type`.
|
|
50
|
+
# @return [Inttegro::Price::Type]
|
|
51
|
+
#
|
|
44
52
|
# @!attribute [r] nominal
|
|
45
|
-
#
|
|
53
|
+
# Legacy fixed price amount. Present only for fixed_amount prices.
|
|
54
|
+
#
|
|
55
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `nominal`.
|
|
56
|
+
# @return [Inttegro::Money::Amount, nil]
|
|
57
|
+
#
|
|
58
|
+
# @!attribute [r] fixed_amount
|
|
59
|
+
# Fixed price amount. Present only for fixed_amount prices.
|
|
60
|
+
#
|
|
61
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `fixed_amount`.
|
|
62
|
+
# @return [Inttegro::Money::Amount, nil]
|
|
63
|
+
#
|
|
64
|
+
# @!attribute [r] customer_selected_amount
|
|
65
|
+
# Customer-selected amount configuration. Present only for customer_selected_amount prices.
|
|
46
66
|
#
|
|
47
|
-
#
|
|
48
|
-
# @return [Inttegro::
|
|
67
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `customer_selected_amount`.
|
|
68
|
+
# @return [Inttegro::Price::CustomerSelectedAmount, nil]
|
|
49
69
|
#
|
|
50
70
|
# @!attribute [r] product_id
|
|
51
71
|
# Product ID when the operation returns the relationship by reference
|
|
@@ -81,7 +101,10 @@ module Inttegro
|
|
|
81
101
|
const :label, T.nilable(String), default: nil
|
|
82
102
|
const :about, T.nilable(String), default: nil
|
|
83
103
|
const :active, T::Boolean
|
|
84
|
-
const :
|
|
104
|
+
const :type, Inttegro::Price::Type
|
|
105
|
+
const :nominal, T.nilable(Inttegro::Money::Amount), default: nil
|
|
106
|
+
const :fixed_amount, T.nilable(Inttegro::Money::Amount), default: nil
|
|
107
|
+
const :customer_selected_amount, T.nilable(Inttegro::Price::CustomerSelectedAmount), default: nil
|
|
85
108
|
const :product_id, T.nilable(String), default: nil
|
|
86
109
|
const :product, T.nilable(Inttegro::Price::EmbeddedProduct), default: nil
|
|
87
110
|
const :created_at, Time
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
7
|
require_relative "../money/amount_params"
|
|
8
|
+
require_relative "customer_selected_amount_params"
|
|
9
|
+
require_relative "type"
|
|
8
10
|
|
|
9
11
|
module Inttegro
|
|
10
12
|
class Price
|
|
@@ -17,7 +19,8 @@ module Inttegro
|
|
|
17
19
|
# @api public
|
|
18
20
|
#
|
|
19
21
|
# @!attribute [r] product_id
|
|
20
|
-
#
|
|
22
|
+
# Product ID to associate this price with. Optional for fixed prices, required for
|
|
23
|
+
# customer_selected_amount prices, and immutable once set.
|
|
21
24
|
#
|
|
22
25
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `product_id`.
|
|
23
26
|
# @return [String, nil]
|
|
@@ -34,16 +37,31 @@ module Inttegro
|
|
|
34
37
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `about`.
|
|
35
38
|
# @return [String, nil]
|
|
36
39
|
#
|
|
37
|
-
# @!attribute [r]
|
|
38
|
-
#
|
|
40
|
+
# @!attribute [r] type
|
|
41
|
+
# Price definition discriminator.
|
|
39
42
|
#
|
|
40
|
-
#
|
|
41
|
-
# @return [Inttegro::
|
|
43
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `type`.
|
|
44
|
+
# @return [Inttegro::Price::Type, nil]
|
|
45
|
+
#
|
|
46
|
+
# @!attribute [r] fixed_amount
|
|
47
|
+
# Required when type is fixed_amount.
|
|
48
|
+
#
|
|
49
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `fixed_amount`.
|
|
50
|
+
# @return [Inttegro::Money::AmountParams, nil]
|
|
51
|
+
#
|
|
52
|
+
# @!attribute [r] customer_selected_amount
|
|
53
|
+
# Required when type is customer_selected_amount. Available only to Commerce internal services
|
|
54
|
+
# and Upper private beta organizations and applications.
|
|
55
|
+
#
|
|
56
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `customer_selected_amount`.
|
|
57
|
+
# @return [Inttegro::Price::CustomerSelectedAmountParams, nil]
|
|
42
58
|
class CatalogPriceParams < T::Struct
|
|
43
59
|
const :product_id, T.nilable(String), default: nil
|
|
44
60
|
const :label, T.nilable(String), default: nil
|
|
45
61
|
const :about, T.nilable(String), default: nil
|
|
46
|
-
const :
|
|
62
|
+
const :type, T.nilable(Inttegro::Price::Type), default: nil
|
|
63
|
+
const :fixed_amount, T.nilable(Inttegro::Money::AmountParams), default: nil
|
|
64
|
+
const :customer_selected_amount, T.nilable(Inttegro::Price::CustomerSelectedAmountParams), default: nil
|
|
47
65
|
end
|
|
48
66
|
end
|
|
49
67
|
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# typed: strict
|
|
3
|
+
|
|
4
|
+
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
|
+
|
|
6
|
+
require_relative "base"
|
|
7
|
+
require_relative "../money/currency"
|
|
8
|
+
require_relative "suggested_amount"
|
|
9
|
+
|
|
10
|
+
module Inttegro
|
|
11
|
+
class Price
|
|
12
|
+
# Typed representation of the customer selected amount object in the Inttegro API.
|
|
13
|
+
#
|
|
14
|
+
# This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
|
|
15
|
+
# payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
|
|
16
|
+
# field names and serialized enum values.
|
|
17
|
+
#
|
|
18
|
+
# @api public
|
|
19
|
+
#
|
|
20
|
+
# @!attribute [r] currency
|
|
21
|
+
# Currency accepted for customer-selected amounts
|
|
22
|
+
#
|
|
23
|
+
# Required in the API payload. Wire name: `currency`.
|
|
24
|
+
# @return [Inttegro::Money::Currency]
|
|
25
|
+
#
|
|
26
|
+
# @!attribute [r] minimum
|
|
27
|
+
# Minimum selectable amount in the currency's smallest unit
|
|
28
|
+
#
|
|
29
|
+
# Required in the API payload. Wire name: `minimum`.
|
|
30
|
+
# @return [Integer]
|
|
31
|
+
#
|
|
32
|
+
# @!attribute [r] maximum
|
|
33
|
+
# Optional maximum selectable amount
|
|
34
|
+
#
|
|
35
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `maximum`.
|
|
36
|
+
# @return [Integer, nil]
|
|
37
|
+
#
|
|
38
|
+
# @!attribute [r] suggested_amounts
|
|
39
|
+
# Convenient choices, not an allow-list
|
|
40
|
+
#
|
|
41
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `suggested_amounts`.
|
|
42
|
+
# @return [Array<Inttegro::Price::SuggestedAmount>, nil]
|
|
43
|
+
class CustomerSelectedAmount < T::Struct
|
|
44
|
+
const :currency, Inttegro::Money::Currency
|
|
45
|
+
const :minimum, Integer
|
|
46
|
+
const :maximum, T.nilable(Integer), default: nil
|
|
47
|
+
const :suggested_amounts, T.nilable(T::Array[Inttegro::Price::SuggestedAmount]), default: nil
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# typed: strict
|
|
3
|
+
|
|
4
|
+
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
|
+
|
|
6
|
+
require_relative "base"
|
|
7
|
+
require_relative "../money/currency"
|
|
8
|
+
require_relative "suggested_amount_params"
|
|
9
|
+
|
|
10
|
+
module Inttegro
|
|
11
|
+
class Price
|
|
12
|
+
# Typed representation of the customer selected amount params object in the Inttegro API.
|
|
13
|
+
#
|
|
14
|
+
# This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
|
|
15
|
+
# payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
|
|
16
|
+
# field names and serialized enum values.
|
|
17
|
+
#
|
|
18
|
+
# @api public
|
|
19
|
+
#
|
|
20
|
+
# @!attribute [r] currency
|
|
21
|
+
# Currency accepted for customer-selected amounts
|
|
22
|
+
#
|
|
23
|
+
# Required in the API payload. Wire name: `currency`.
|
|
24
|
+
# @return [Inttegro::Money::Currency]
|
|
25
|
+
#
|
|
26
|
+
# @!attribute [r] minimum
|
|
27
|
+
# Minimum selectable amount in the currency's smallest unit
|
|
28
|
+
#
|
|
29
|
+
# Required in the API payload. Wire name: `minimum`.
|
|
30
|
+
# @return [Integer]
|
|
31
|
+
#
|
|
32
|
+
# @!attribute [r] maximum
|
|
33
|
+
# Optional maximum selectable amount; it must be at least minimum
|
|
34
|
+
#
|
|
35
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `maximum`.
|
|
36
|
+
# @return [Integer, nil]
|
|
37
|
+
#
|
|
38
|
+
# @!attribute [r] suggested_amounts
|
|
39
|
+
# Convenient choices, not an allow-list. IDs and values must be unique and at most one can be
|
|
40
|
+
# recommended.
|
|
41
|
+
#
|
|
42
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `suggested_amounts`.
|
|
43
|
+
# @return [Array<Inttegro::Price::SuggestedAmountParams>, nil]
|
|
44
|
+
class CustomerSelectedAmountParams < T::Struct
|
|
45
|
+
const :currency, Inttegro::Money::Currency
|
|
46
|
+
const :minimum, Integer
|
|
47
|
+
const :maximum, T.nilable(Integer), default: nil
|
|
48
|
+
const :suggested_amounts, T.nilable(T::Array[Inttegro::Price::SuggestedAmountParams]), default: nil
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# typed: strict
|
|
3
|
+
|
|
4
|
+
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
|
+
|
|
6
|
+
require_relative "base"
|
|
7
|
+
|
|
8
|
+
module Inttegro
|
|
9
|
+
class Price
|
|
10
|
+
# Typed representation of the suggested amount object in the Inttegro API.
|
|
11
|
+
#
|
|
12
|
+
# This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
|
|
13
|
+
# payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
|
|
14
|
+
# field names and serialized enum values.
|
|
15
|
+
#
|
|
16
|
+
# @api public
|
|
17
|
+
#
|
|
18
|
+
# @!attribute [r] id
|
|
19
|
+
# Stable merchant-defined identifier for this suggestion
|
|
20
|
+
#
|
|
21
|
+
# Required in the API payload. Wire name: `id`.
|
|
22
|
+
# @return [String]
|
|
23
|
+
#
|
|
24
|
+
# @!attribute [r] value
|
|
25
|
+
# Suggested amount in the currency's smallest unit
|
|
26
|
+
#
|
|
27
|
+
# Required in the API payload. Wire name: `value`.
|
|
28
|
+
# @return [Integer]
|
|
29
|
+
#
|
|
30
|
+
# @!attribute [r] recommended
|
|
31
|
+
# Whether this is the recommended suggestion
|
|
32
|
+
#
|
|
33
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `recommended`.
|
|
34
|
+
# @return [Boolean, nil]
|
|
35
|
+
class SuggestedAmount < T::Struct
|
|
36
|
+
const :id, String
|
|
37
|
+
const :value, Integer
|
|
38
|
+
const :recommended, T.nilable(T::Boolean), default: nil
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# typed: strict
|
|
3
|
+
|
|
4
|
+
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
|
+
|
|
6
|
+
require_relative "base"
|
|
7
|
+
|
|
8
|
+
module Inttegro
|
|
9
|
+
class Price
|
|
10
|
+
# Typed representation of the suggested amount params object in the Inttegro API.
|
|
11
|
+
#
|
|
12
|
+
# This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
|
|
13
|
+
# payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
|
|
14
|
+
# field names and serialized enum values.
|
|
15
|
+
#
|
|
16
|
+
# @api public
|
|
17
|
+
#
|
|
18
|
+
# @!attribute [r] id
|
|
19
|
+
# Stable merchant-defined identifier for this suggestion
|
|
20
|
+
#
|
|
21
|
+
# Required in the API payload. Wire name: `id`.
|
|
22
|
+
# @return [String]
|
|
23
|
+
#
|
|
24
|
+
# @!attribute [r] value
|
|
25
|
+
# Suggested amount in the currency's smallest unit
|
|
26
|
+
#
|
|
27
|
+
# Required in the API payload. Wire name: `value`.
|
|
28
|
+
# @return [Integer]
|
|
29
|
+
#
|
|
30
|
+
# @!attribute [r] recommended
|
|
31
|
+
# Whether this is the single recommended suggestion
|
|
32
|
+
#
|
|
33
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `recommended`.
|
|
34
|
+
# @return [Boolean, nil]
|
|
35
|
+
class SuggestedAmountParams < T::Struct
|
|
36
|
+
const :id, String
|
|
37
|
+
const :value, Integer
|
|
38
|
+
const :recommended, T.nilable(T::Boolean), default: nil
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# typed: strict
|
|
3
|
+
|
|
4
|
+
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
|
+
|
|
6
|
+
require_relative "base"
|
|
7
|
+
|
|
8
|
+
module Inttegro
|
|
9
|
+
class Price
|
|
10
|
+
# Price definition discriminator.
|
|
11
|
+
#
|
|
12
|
+
# Use the constants below when constructing a request. `#serialize` returns the documented
|
|
13
|
+
# string wire value received from or sent to the API.
|
|
14
|
+
#
|
|
15
|
+
# @api public
|
|
16
|
+
class Type < T::Enum
|
|
17
|
+
enums do
|
|
18
|
+
# Serialized wire value: `fixed_amount`.
|
|
19
|
+
# @return [Inttegro::Price::Type]
|
|
20
|
+
FIXED_AMOUNT = new("fixed_amount")
|
|
21
|
+
# Serialized wire value: `customer_selected_amount`.
|
|
22
|
+
# @return [Inttegro::Price::Type]
|
|
23
|
+
CUSTOMER_SELECTED_AMOUNT = new("customer_selected_amount")
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
7
|
require_relative "../money/amount_params"
|
|
8
|
+
require_relative "../price/customer_selected_amount_params"
|
|
9
|
+
require_relative "../price/type"
|
|
8
10
|
|
|
9
11
|
module Inttegro
|
|
10
12
|
class Product
|
|
@@ -34,16 +36,31 @@ module Inttegro
|
|
|
34
36
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `about`.
|
|
35
37
|
# @return [String, nil]
|
|
36
38
|
#
|
|
37
|
-
# @!attribute [r]
|
|
38
|
-
#
|
|
39
|
+
# @!attribute [r] type
|
|
40
|
+
# Price definition discriminator.
|
|
39
41
|
#
|
|
40
|
-
#
|
|
41
|
-
# @return [Inttegro::
|
|
42
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `type`.
|
|
43
|
+
# @return [Inttegro::Price::Type, nil]
|
|
44
|
+
#
|
|
45
|
+
# @!attribute [r] fixed_amount
|
|
46
|
+
# Required when type is fixed_amount.
|
|
47
|
+
#
|
|
48
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `fixed_amount`.
|
|
49
|
+
# @return [Inttegro::Money::AmountParams, nil]
|
|
50
|
+
#
|
|
51
|
+
# @!attribute [r] customer_selected_amount
|
|
52
|
+
# Required when type is customer_selected_amount. Available only to Commerce internal services
|
|
53
|
+
# and Upper private beta organizations and applications.
|
|
54
|
+
#
|
|
55
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `customer_selected_amount`.
|
|
56
|
+
# @return [Inttegro::Price::CustomerSelectedAmountParams, nil]
|
|
42
57
|
class AddPriceRequest < T::Struct
|
|
43
58
|
const :product_id, String
|
|
44
59
|
const :label, T.nilable(String), default: nil
|
|
45
60
|
const :about, T.nilable(String), default: nil
|
|
46
|
-
const :
|
|
61
|
+
const :type, T.nilable(Inttegro::Price::Type), default: nil
|
|
62
|
+
const :fixed_amount, T.nilable(Inttegro::Money::AmountParams), default: nil
|
|
63
|
+
const :customer_selected_amount, T.nilable(Inttegro::Price::CustomerSelectedAmountParams), default: nil
|
|
47
64
|
end
|
|
48
65
|
end
|
|
49
66
|
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# typed: strict
|
|
3
|
+
|
|
4
|
+
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
|
+
|
|
6
|
+
require_relative "base"
|
|
7
|
+
require_relative "customer_selected_price_input"
|
|
8
|
+
|
|
9
|
+
module Inttegro
|
|
10
|
+
class Product
|
|
11
|
+
# Typed representation of the catalog with customer selected price object in the Inttegro API.
|
|
12
|
+
#
|
|
13
|
+
# This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
|
|
14
|
+
# payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
|
|
15
|
+
# field names and serialized enum values.
|
|
16
|
+
#
|
|
17
|
+
# @api public
|
|
18
|
+
#
|
|
19
|
+
# @!attribute [r] customer_selected_price
|
|
20
|
+
# Available only to Commerce internal services and Upper private beta organizations and
|
|
21
|
+
# applications.
|
|
22
|
+
#
|
|
23
|
+
# Required in the API payload. Wire name: `customer_selected_price`.
|
|
24
|
+
# @return [Inttegro::Product::CustomerSelectedPriceInput]
|
|
25
|
+
#
|
|
26
|
+
# @!attribute [r] product_id
|
|
27
|
+
# Existing catalog product ID to snapshot onto the order line item
|
|
28
|
+
#
|
|
29
|
+
# Required in the API payload. Wire name: `product_id`.
|
|
30
|
+
# @return [String]
|
|
31
|
+
#
|
|
32
|
+
# @!attribute [r] quantity
|
|
33
|
+
# How many units of the catalog product the customer is purchasing
|
|
34
|
+
#
|
|
35
|
+
# Required in the API payload. Wire name: `quantity`.
|
|
36
|
+
# @return [Integer]
|
|
37
|
+
class CatalogWithCustomerSelectedPrice < T::Struct
|
|
38
|
+
const :customer_selected_price, Inttegro::Product::CustomerSelectedPriceInput
|
|
39
|
+
const :product_id, String
|
|
40
|
+
const :quantity, Integer
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# typed: strict
|
|
3
|
+
|
|
4
|
+
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
|
+
|
|
6
|
+
require_relative "base"
|
|
7
|
+
require_relative "../money/amount_params"
|
|
8
|
+
|
|
9
|
+
module Inttegro
|
|
10
|
+
class Product
|
|
11
|
+
# Available only to Commerce internal services and Upper private beta organizations and
|
|
12
|
+
# applications.
|
|
13
|
+
#
|
|
14
|
+
# This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
|
|
15
|
+
# payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
|
|
16
|
+
# field names and serialized enum values.
|
|
17
|
+
#
|
|
18
|
+
# @api public
|
|
19
|
+
#
|
|
20
|
+
# @!attribute [r] price_id
|
|
21
|
+
# Existing customer_selected_amount price belonging to the catalog product
|
|
22
|
+
#
|
|
23
|
+
# Required in the API payload. Wire name: `price_id`.
|
|
24
|
+
# @return [String]
|
|
25
|
+
#
|
|
26
|
+
# @!attribute [r] selected_amount
|
|
27
|
+
# Concrete unit amount selected for this order; it must satisfy the referenced price's
|
|
28
|
+
# currency and range
|
|
29
|
+
#
|
|
30
|
+
# Required in the API payload. Wire name: `selected_amount`.
|
|
31
|
+
# @return [Inttegro::Money::AmountParams]
|
|
32
|
+
class CustomerSelectedPriceInput < T::Struct
|
|
33
|
+
const :price_id, String
|
|
34
|
+
const :selected_amount, Inttegro::Money::AmountParams
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "catalog_with_customer_selected_price"
|
|
7
8
|
require_relative "catalog_with_price_data"
|
|
8
9
|
require_relative "catalog_with_price_reference"
|
|
9
10
|
require_relative "inline_details"
|
|
@@ -12,11 +13,11 @@ module Inttegro
|
|
|
12
13
|
class Product
|
|
13
14
|
# Provide either inline product data or a `product_id` reference to an existing catalog
|
|
14
15
|
# product. Catalog-backed product line items can use an explicit `price` or an existing
|
|
15
|
-
# `price_id`. Inttegro never falls back to a
|
|
16
|
-
# creation.
|
|
16
|
+
# `price_id`, or a validated `customer_selected_price`. Inttegro never falls back to a
|
|
17
|
+
# product's default unit price during order creation.
|
|
17
18
|
#
|
|
18
19
|
# @api public
|
|
19
|
-
# @return [Inttegro::Product::InlineDetails, Inttegro::Product::CatalogWithPriceData, Inttegro::Product::CatalogWithPriceReference]
|
|
20
|
-
Details = T.type_alias { T.any(Inttegro::Product::InlineDetails, Inttegro::Product::CatalogWithPriceData, Inttegro::Product::CatalogWithPriceReference) }
|
|
20
|
+
# @return [Inttegro::Product::InlineDetails, Inttegro::Product::CatalogWithPriceData, Inttegro::Product::CatalogWithPriceReference, Inttegro::Product::CatalogWithCustomerSelectedPrice]
|
|
21
|
+
Details = T.type_alias { T.any(Inttegro::Product::InlineDetails, Inttegro::Product::CatalogWithPriceData, Inttegro::Product::CatalogWithPriceReference, Inttegro::Product::CatalogWithCustomerSelectedPrice) }
|
|
21
22
|
end
|
|
22
23
|
end
|
|
@@ -26,8 +26,8 @@ module Inttegro
|
|
|
26
26
|
# @!attribute [r] product
|
|
27
27
|
# Provide either inline product data or a `product_id` reference to an existing catalog
|
|
28
28
|
# product. Catalog-backed product line items can use an explicit `price` or an existing
|
|
29
|
-
# `price_id`. Inttegro never falls back to a
|
|
30
|
-
# creation.
|
|
29
|
+
# `price_id`, or a validated `customer_selected_price`. Inttegro never falls back to a
|
|
30
|
+
# product's default unit price during order creation.
|
|
31
31
|
#
|
|
32
32
|
# Required in the API payload. Wire name: `product`.
|
|
33
33
|
# @return [Inttegro::Product::Details]
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
7
|
require_relative "../money/amount"
|
|
8
|
+
require_relative "../price/customer_selected_amount"
|
|
9
|
+
require_relative "../price/type"
|
|
8
10
|
|
|
9
11
|
module Inttegro
|
|
10
12
|
class Product
|
|
@@ -34,16 +36,37 @@ module Inttegro
|
|
|
34
36
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `label`.
|
|
35
37
|
# @return [String, nil]
|
|
36
38
|
#
|
|
39
|
+
# @!attribute [r] type
|
|
40
|
+
# Price definition discriminator
|
|
41
|
+
#
|
|
42
|
+
# Required in the API payload. Wire name: `type`.
|
|
43
|
+
# @return [Inttegro::Price::Type]
|
|
44
|
+
#
|
|
37
45
|
# @!attribute [r] nominal
|
|
38
|
-
#
|
|
46
|
+
# Legacy fixed price amount. Present only for fixed_amount prices.
|
|
47
|
+
#
|
|
48
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `nominal`.
|
|
49
|
+
# @return [Inttegro::Money::Amount, nil]
|
|
50
|
+
#
|
|
51
|
+
# @!attribute [r] fixed_amount
|
|
52
|
+
# Fixed price amount. Present only for fixed_amount prices.
|
|
53
|
+
#
|
|
54
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `fixed_amount`.
|
|
55
|
+
# @return [Inttegro::Money::Amount, nil]
|
|
56
|
+
#
|
|
57
|
+
# @!attribute [r] customer_selected_amount
|
|
58
|
+
# Customer-selected amount configuration. Present only for customer_selected_amount prices.
|
|
39
59
|
#
|
|
40
|
-
#
|
|
41
|
-
# @return [Inttegro::
|
|
60
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `customer_selected_amount`.
|
|
61
|
+
# @return [Inttegro::Price::CustomerSelectedAmount, nil]
|
|
42
62
|
class PriceSummary < T::Struct
|
|
43
63
|
const :id, String
|
|
44
64
|
const :active, T::Boolean
|
|
45
65
|
const :label, T.nilable(String), default: nil
|
|
46
|
-
const :
|
|
66
|
+
const :type, Inttegro::Price::Type
|
|
67
|
+
const :nominal, T.nilable(Inttegro::Money::Amount), default: nil
|
|
68
|
+
const :fixed_amount, T.nilable(Inttegro::Money::Amount), default: nil
|
|
69
|
+
const :customer_selected_amount, T.nilable(Inttegro::Price::CustomerSelectedAmount), default: nil
|
|
47
70
|
end
|
|
48
71
|
end
|
|
49
72
|
end
|
|
@@ -14,7 +14,7 @@ module Inttegro
|
|
|
14
14
|
|
|
15
15
|
# Create a catalog price.
|
|
16
16
|
#
|
|
17
|
-
# @param payload [Hash, Inttegro::Price::CatalogPriceParams]
|
|
17
|
+
# @param payload [Hash, Inttegro::Price::CatalogPriceParams] tagged price definition and optional metadata
|
|
18
18
|
# @return [Inttegro::Price::CatalogPrice] created price
|
|
19
19
|
def create(payload)
|
|
20
20
|
@http.post_resource("/prices/create", Inttegro::Price::CatalogPrice, :price, payload)
|
data/lib/inttegro/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: inttegro
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 9.
|
|
4
|
+
version: 9.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Inttegro Engineering
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sorbet-runtime
|
|
@@ -575,6 +575,8 @@ files:
|
|
|
575
575
|
- lib/inttegro/price/base.rb
|
|
576
576
|
- lib/inttegro/price/catalog_price.rb
|
|
577
577
|
- lib/inttegro/price/catalog_price_params.rb
|
|
578
|
+
- lib/inttegro/price/customer_selected_amount.rb
|
|
579
|
+
- lib/inttegro/price/customer_selected_amount_params.rb
|
|
578
580
|
- lib/inttegro/price/embedded_product.rb
|
|
579
581
|
- lib/inttegro/price/lookup_request.rb
|
|
580
582
|
- lib/inttegro/price/page.rb
|
|
@@ -584,15 +586,20 @@ files:
|
|
|
584
586
|
- lib/inttegro/price/price.rb
|
|
585
587
|
- lib/inttegro/price/price_params.rb
|
|
586
588
|
- lib/inttegro/price/response.rb
|
|
589
|
+
- lib/inttegro/price/suggested_amount.rb
|
|
590
|
+
- lib/inttegro/price/suggested_amount_params.rb
|
|
591
|
+
- lib/inttegro/price/type.rb
|
|
587
592
|
- lib/inttegro/price/update_request.rb
|
|
588
593
|
- lib/inttegro/product/action_request.rb
|
|
589
594
|
- lib/inttegro/product/add_price_request.rb
|
|
590
595
|
- lib/inttegro/product/add_price_response.rb
|
|
591
596
|
- lib/inttegro/product/attribute.rb
|
|
592
597
|
- lib/inttegro/product/base.rb
|
|
598
|
+
- lib/inttegro/product/catalog_with_customer_selected_price.rb
|
|
593
599
|
- lib/inttegro/product/catalog_with_price_data.rb
|
|
594
600
|
- lib/inttegro/product/catalog_with_price_reference.rb
|
|
595
601
|
- lib/inttegro/product/create_request.rb
|
|
602
|
+
- lib/inttegro/product/customer_selected_price_input.rb
|
|
596
603
|
- lib/inttegro/product/delivery.rb
|
|
597
604
|
- lib/inttegro/product/details.rb
|
|
598
605
|
- lib/inttegro/product/dimensions.rb
|