inttegro 9.0.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 +11 -0
- data/lib/inttegro/balance_transaction/available_amount.rb +1 -1
- data/lib/inttegro/balance_transaction/balance_transaction.rb +41 -49
- data/lib/inttegro/balance_transaction/pending_amount.rb +1 -2
- data/lib/inttegro/balance_transaction/questions.rb +2 -1
- data/lib/inttegro/balance_transaction/response.rb +2 -6
- data/lib/inttegro/balance_transaction/spent_amount.rb +1 -2
- data/lib/inttegro/balance_transaction/type.rb +4 -1
- data/lib/inttegro/customer/customer.rb +10 -0
- data/lib/inttegro/generated/enums.rb +1 -0
- data/lib/inttegro/generated/models.rb +7 -1
- data/lib/inttegro/http_client.rb +26 -1
- data/lib/inttegro/payment/payment.rb +2 -6
- data/lib/inttegro/payout/payout.rb +7 -0
- 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,16 @@
|
|
|
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
|
+
|
|
9
|
+
## [9.1.0] - 2026-09-27
|
|
10
|
+
|
|
11
|
+
- Added the required application-scoped customer fingerprint to typed customer
|
|
12
|
+
responses for possible duplicate-record detection.
|
|
13
|
+
|
|
3
14
|
## [9.0.0] - 2026-09-23
|
|
4
15
|
|
|
5
16
|
- Breaking: replaced payout `balance_transactions` ID strings with typed
|
|
@@ -7,7 +7,7 @@ require_relative "base"
|
|
|
7
7
|
|
|
8
8
|
module Inttegro
|
|
9
9
|
class BalanceTransaction
|
|
10
|
-
# Amount still available for a refund or payout.
|
|
10
|
+
# Amount still available for a refund or payout.
|
|
11
11
|
#
|
|
12
12
|
# This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
|
|
13
13
|
# payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
|
|
@@ -13,12 +13,8 @@ require_relative "spent_amount"
|
|
|
13
13
|
require_relative "type"
|
|
14
14
|
|
|
15
15
|
module Inttegro
|
|
16
|
-
# Merchant balance entry caused by a payment or
|
|
17
|
-
#
|
|
18
|
-
# `refund_id`. Exactly one matching reference is present. Payment transactions also expose
|
|
19
|
-
# their complete current allocation state and disjoint available, pending, and spent amounts.
|
|
20
|
-
# Allocation fields are omitted from refund transactions because refund transactions are
|
|
21
|
-
# consumers rather than sources.
|
|
16
|
+
# Merchant balance entry caused by a payment, refund, or payout. `type` is the discriminator
|
|
17
|
+
# and describes the semantic source rather than the direction.
|
|
22
18
|
#
|
|
23
19
|
# This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
|
|
24
20
|
# payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
|
|
@@ -32,15 +28,32 @@ module Inttegro
|
|
|
32
28
|
# Required in the API payload. Wire name: `amount`.
|
|
33
29
|
# @return [Inttegro::BalanceTransaction::Amount]
|
|
34
30
|
#
|
|
31
|
+
# @!attribute [r] created_at
|
|
32
|
+
# Value of the `created_at` field in the Inttegro API payload.
|
|
33
|
+
#
|
|
34
|
+
# Required in the API payload. Wire name: `created_at`.
|
|
35
|
+
# @return [Time]
|
|
36
|
+
#
|
|
37
|
+
# @!attribute [r] id
|
|
38
|
+
# Value of the `id` field in the Inttegro API payload.
|
|
39
|
+
#
|
|
40
|
+
# Required in the API payload. Wire name: `id`.
|
|
41
|
+
# @return [String]
|
|
42
|
+
#
|
|
43
|
+
# @!attribute [r] type
|
|
44
|
+
# Value of the `type` field in the Inttegro API payload.
|
|
45
|
+
#
|
|
46
|
+
# Required in the API payload. Wire name: `type`.
|
|
47
|
+
# @return [Inttegro::BalanceTransaction::Type]
|
|
48
|
+
#
|
|
35
49
|
# @!attribute [r] allocations
|
|
36
|
-
# All current pending and completed allocations
|
|
37
|
-
# allocations are omitted. Present only when `type` is `payment`.
|
|
50
|
+
# All current pending and completed allocations. Released allocations are omitted.
|
|
38
51
|
#
|
|
39
52
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `allocations`.
|
|
40
53
|
# @return [Array<Inttegro::BalanceTransaction::Allocation>, nil]
|
|
41
54
|
#
|
|
42
55
|
# @!attribute [r] available_amount
|
|
43
|
-
# Amount still available for a refund or payout.
|
|
56
|
+
# Amount still available for a refund or payout.
|
|
44
57
|
#
|
|
45
58
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `available_amount`.
|
|
46
59
|
# @return [Inttegro::BalanceTransaction::AvailableAmount, nil]
|
|
@@ -58,23 +71,11 @@ module Inttegro
|
|
|
58
71
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `claimed_at`.
|
|
59
72
|
# @return [Time, nil]
|
|
60
73
|
#
|
|
61
|
-
# @!attribute [r] created_at
|
|
62
|
-
# Value of the `created_at` field in the Inttegro API payload.
|
|
63
|
-
#
|
|
64
|
-
# Required in the API payload. Wire name: `created_at`.
|
|
65
|
-
# @return [Time]
|
|
66
|
-
#
|
|
67
|
-
# @!attribute [r] id
|
|
68
|
-
# Value of the `id` field in the Inttegro API payload.
|
|
69
|
-
#
|
|
70
|
-
# Required in the API payload. Wire name: `id`.
|
|
71
|
-
# @return [String]
|
|
72
|
-
#
|
|
73
74
|
# @!attribute [r] order_id
|
|
74
75
|
# Value of the `order_id` field in the Inttegro API payload.
|
|
75
76
|
#
|
|
76
|
-
#
|
|
77
|
-
# @return [String]
|
|
77
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `order_id`.
|
|
78
|
+
# @return [String, nil]
|
|
78
79
|
#
|
|
79
80
|
# @!attribute [r] paid_at
|
|
80
81
|
# Legacy whole-transaction payout completion timestamp. New integrations should inspect
|
|
@@ -83,22 +84,14 @@ module Inttegro
|
|
|
83
84
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `paid_at`.
|
|
84
85
|
# @return [Time, nil]
|
|
85
86
|
#
|
|
86
|
-
# @!attribute [r] pending_amount
|
|
87
|
-
# Amount temporarily unavailable because a refund or payout is unresolved. Present only when
|
|
88
|
-
# `type` is `payment`.
|
|
89
|
-
#
|
|
90
|
-
# Optional in the API payload; omitted values default to `nil`. Wire name: `pending_amount`.
|
|
91
|
-
# @return [Inttegro::BalanceTransaction::PendingAmount, nil]
|
|
92
|
-
#
|
|
93
87
|
# @!attribute [r] payment_id
|
|
94
|
-
#
|
|
88
|
+
# Value of the `payment_id` field in the Inttegro API payload.
|
|
95
89
|
#
|
|
96
90
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `payment_id`.
|
|
97
91
|
# @return [String, nil]
|
|
98
92
|
#
|
|
99
93
|
# @!attribute [r] payout_id
|
|
100
|
-
#
|
|
101
|
-
# `allocations` because one transaction can participate in many payouts.
|
|
94
|
+
# Payout that created this finalized debit.
|
|
102
95
|
#
|
|
103
96
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `payout_id`.
|
|
104
97
|
# @return [String, nil]
|
|
@@ -109,41 +102,40 @@ module Inttegro
|
|
|
109
102
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `payout_configuration`.
|
|
110
103
|
# @return [Inttegro::BalanceTransaction::PayoutConfiguration, nil]
|
|
111
104
|
#
|
|
112
|
-
# @!attribute [r]
|
|
113
|
-
#
|
|
105
|
+
# @!attribute [r] pending_amount
|
|
106
|
+
# Amount temporarily unavailable because a refund or payout is unresolved.
|
|
114
107
|
#
|
|
115
|
-
# Optional in the API payload; omitted values default to `nil`. Wire name: `
|
|
116
|
-
# @return [
|
|
108
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `pending_amount`.
|
|
109
|
+
# @return [Inttegro::BalanceTransaction::PendingAmount, nil]
|
|
117
110
|
#
|
|
118
111
|
# @!attribute [r] spent_amount
|
|
119
|
-
# Amount permanently consumed by completed
|
|
120
|
-
# `payment`.
|
|
112
|
+
# Amount permanently consumed by completed refund and payout allocations.
|
|
121
113
|
#
|
|
122
114
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `spent_amount`.
|
|
123
115
|
# @return [Inttegro::BalanceTransaction::SpentAmount, nil]
|
|
124
116
|
#
|
|
125
|
-
# @!attribute [r]
|
|
126
|
-
#
|
|
117
|
+
# @!attribute [r] refund_id
|
|
118
|
+
# Value of the `refund_id` field in the Inttegro API payload.
|
|
127
119
|
#
|
|
128
|
-
#
|
|
129
|
-
# @return [
|
|
120
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `refund_id`.
|
|
121
|
+
# @return [String, nil]
|
|
130
122
|
class BalanceTransaction
|
|
131
123
|
const :amount, Inttegro::BalanceTransaction::Amount
|
|
124
|
+
const :created_at, Time
|
|
125
|
+
const :id, String
|
|
126
|
+
const :type, Inttegro::BalanceTransaction::Type
|
|
132
127
|
const :allocations, T.nilable(T::Array[Inttegro::BalanceTransaction::Allocation]), default: nil
|
|
133
128
|
const :available_amount, T.nilable(Inttegro::BalanceTransaction::AvailableAmount), default: nil
|
|
134
129
|
const :available_at, T.nilable(Time), default: nil
|
|
135
130
|
const :claimed_at, T.nilable(Time), default: nil
|
|
136
|
-
const :
|
|
137
|
-
const :id, String
|
|
138
|
-
const :order_id, String
|
|
131
|
+
const :order_id, T.nilable(String), default: nil
|
|
139
132
|
const :paid_at, T.nilable(Time), default: nil
|
|
140
|
-
const :pending_amount, T.nilable(Inttegro::BalanceTransaction::PendingAmount), default: nil
|
|
141
133
|
const :payment_id, T.nilable(String), default: nil
|
|
142
134
|
const :payout_id, T.nilable(String), default: nil
|
|
143
135
|
const :payout_configuration, T.nilable(Inttegro::BalanceTransaction::PayoutConfiguration), default: nil
|
|
144
|
-
const :
|
|
136
|
+
const :pending_amount, T.nilable(Inttegro::BalanceTransaction::PendingAmount), default: nil
|
|
145
137
|
const :spent_amount, T.nilable(Inttegro::BalanceTransaction::SpentAmount), default: nil
|
|
146
|
-
const :
|
|
138
|
+
const :refund_id, T.nilable(String), default: nil
|
|
147
139
|
|
|
148
140
|
extend T::Sig
|
|
149
141
|
|
|
@@ -7,8 +7,7 @@ require_relative "base"
|
|
|
7
7
|
|
|
8
8
|
module Inttegro
|
|
9
9
|
class BalanceTransaction
|
|
10
|
-
# Amount temporarily unavailable because a refund or payout is unresolved.
|
|
11
|
-
# `type` is `payment`.
|
|
10
|
+
# Amount temporarily unavailable because a refund or payout is unresolved.
|
|
12
11
|
#
|
|
13
12
|
# This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
|
|
14
13
|
# payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
|
|
@@ -42,7 +42,8 @@ module Inttegro
|
|
|
42
42
|
#
|
|
43
43
|
# @return [Boolean] whether the transaction satisfies the local identity checks
|
|
44
44
|
def valid?
|
|
45
|
-
|
|
45
|
+
order = order_id
|
|
46
|
+
!id.empty? && !order.nil? && !order.empty? && valid_source?
|
|
46
47
|
end
|
|
47
48
|
end
|
|
48
49
|
end
|
|
@@ -17,12 +17,8 @@ module Inttegro
|
|
|
17
17
|
# @api public
|
|
18
18
|
#
|
|
19
19
|
# @!attribute [r] transaction
|
|
20
|
-
# Merchant balance entry caused by a payment or
|
|
21
|
-
#
|
|
22
|
-
# `refund_id`. Exactly one matching reference is present. Payment transactions also expose
|
|
23
|
-
# their complete current allocation state and disjoint available, pending, and spent amounts.
|
|
24
|
-
# Allocation fields are omitted from refund transactions because refund transactions are
|
|
25
|
-
# consumers rather than sources.
|
|
20
|
+
# Merchant balance entry caused by a payment, refund, or payout. `type` is the discriminator
|
|
21
|
+
# and describes the semantic source rather than the direction.
|
|
26
22
|
#
|
|
27
23
|
# Required in the API payload. Wire name: `transaction`.
|
|
28
24
|
# @return [Inttegro::BalanceTransaction]
|
|
@@ -7,8 +7,7 @@ require_relative "base"
|
|
|
7
7
|
|
|
8
8
|
module Inttegro
|
|
9
9
|
class BalanceTransaction
|
|
10
|
-
# Amount permanently consumed by completed
|
|
11
|
-
# `payment`.
|
|
10
|
+
# Amount permanently consumed by completed refund and payout allocations.
|
|
12
11
|
#
|
|
13
12
|
# This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
|
|
14
13
|
# payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
|
|
@@ -7,7 +7,7 @@ require_relative "base"
|
|
|
7
7
|
|
|
8
8
|
module Inttegro
|
|
9
9
|
class BalanceTransaction
|
|
10
|
-
#
|
|
10
|
+
# String-backed values accepted by the Inttegro API for Inttegro::BalanceTransaction::Type.
|
|
11
11
|
#
|
|
12
12
|
# Use the constants below when constructing a request. `#serialize` returns the documented
|
|
13
13
|
# string wire value received from or sent to the API.
|
|
@@ -21,6 +21,9 @@ module Inttegro
|
|
|
21
21
|
# Serialized wire value: `refund`.
|
|
22
22
|
# @return [Inttegro::BalanceTransaction::Type]
|
|
23
23
|
REFUND = new("refund")
|
|
24
|
+
# Serialized wire value: `payout`.
|
|
25
|
+
# @return [Inttegro::BalanceTransaction::Type]
|
|
26
|
+
PAYOUT = new("payout")
|
|
24
27
|
end
|
|
25
28
|
end
|
|
26
29
|
end
|
|
@@ -48,6 +48,15 @@ module Inttegro
|
|
|
48
48
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `email_address`.
|
|
49
49
|
# @return [String, nil]
|
|
50
50
|
#
|
|
51
|
+
# @!attribute [r] fingerprint
|
|
52
|
+
# Application-scoped value for spotting possible duplicate customer records. Matching nonempty
|
|
53
|
+
# fingerprints within the same application indicate that the records likely belong to the same
|
|
54
|
+
# buyer. Compare fingerprints only within that application, and continue to use each customer
|
|
55
|
+
# ID for API operations.
|
|
56
|
+
#
|
|
57
|
+
# Required in the API payload. Wire name: `fingerprint`.
|
|
58
|
+
# @return [String]
|
|
59
|
+
#
|
|
51
60
|
# @!attribute [r] guest
|
|
52
61
|
# Value of the `guest` field in the Inttegro API payload.
|
|
53
62
|
#
|
|
@@ -107,6 +116,7 @@ module Inttegro
|
|
|
107
116
|
const :created_at, Time
|
|
108
117
|
const :custom_data, T.nilable(Inttegro::CustomData), default: nil
|
|
109
118
|
const :email_address, T.nilable(String), default: nil
|
|
119
|
+
const :fingerprint, String
|
|
110
120
|
const :guest, T::Boolean
|
|
111
121
|
const :id, String
|
|
112
122
|
const :name, String
|
|
@@ -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"
|
|
@@ -54,9 +58,9 @@ require_relative "../balance_transaction/payout_allocation_payout"
|
|
|
54
58
|
require_relative "../balance_transaction/payout_allocation"
|
|
55
59
|
require_relative "../balance_transaction/allocation"
|
|
56
60
|
require_relative "../balance_transaction/available_amount"
|
|
57
|
-
require_relative "../balance_transaction/pending_amount"
|
|
58
61
|
require_relative "../balance_transaction/payout_configuration_destination"
|
|
59
62
|
require_relative "../balance_transaction/payout_configuration"
|
|
63
|
+
require_relative "../balance_transaction/pending_amount"
|
|
60
64
|
require_relative "../balance_transaction/spent_amount"
|
|
61
65
|
require_relative "../balance_transaction/balance_transaction"
|
|
62
66
|
require_relative "../balance_transaction/allocation_base"
|
|
@@ -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?
|
|
@@ -49,12 +49,8 @@ module Inttegro
|
|
|
49
49
|
# @return [Inttegro::Money::Amount]
|
|
50
50
|
#
|
|
51
51
|
# @!attribute [r] balance_transaction
|
|
52
|
-
# Merchant balance entry caused by a payment or
|
|
53
|
-
#
|
|
54
|
-
# `refund_id`. Exactly one matching reference is present. Payment transactions also expose
|
|
55
|
-
# their complete current allocation state and disjoint available, pending, and spent amounts.
|
|
56
|
-
# Allocation fields are omitted from refund transactions because refund transactions are
|
|
57
|
-
# consumers rather than sources.
|
|
52
|
+
# Merchant balance entry caused by a payment, refund, or payout. `type` is the discriminator
|
|
53
|
+
# and describes the semantic source rather than the direction.
|
|
58
54
|
#
|
|
59
55
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `balance_transaction`.
|
|
60
56
|
# @return [Inttegro::BalanceTransaction, nil]
|
|
@@ -34,6 +34,12 @@ module Inttegro
|
|
|
34
34
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `balance_transactions`.
|
|
35
35
|
# @return [Array<Inttegro::Payout::BalanceTransaction>, nil]
|
|
36
36
|
#
|
|
37
|
+
# @!attribute [r] balance_transaction_id
|
|
38
|
+
# Immutable debit balance transaction created when this payout succeeds.
|
|
39
|
+
#
|
|
40
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `balance_transaction_id`.
|
|
41
|
+
# @return [String, nil]
|
|
42
|
+
#
|
|
37
43
|
# @!attribute [r] canceled_at
|
|
38
44
|
# When the payout was canceled
|
|
39
45
|
#
|
|
@@ -157,6 +163,7 @@ module Inttegro
|
|
|
157
163
|
class Payout
|
|
158
164
|
const :amount, T.nilable(Inttegro::Money::Amount), default: nil
|
|
159
165
|
const :balance_transactions, T.nilable(T::Array[Inttegro::Payout::BalanceTransaction]), default: nil
|
|
166
|
+
const :balance_transaction_id, T.nilable(String), default: nil
|
|
160
167
|
const :canceled_at, T.nilable(Time), default: nil
|
|
161
168
|
const :custom_data, T.nilable(Inttegro::CustomData), default: nil
|
|
162
169
|
const :destination_id, String
|
|
@@ -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
|