inttegro 8.0.0 → 8.1.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.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/lib/inttegro/checkout/invoice_view.rb +8 -0
  4. data/lib/inttegro/checkout/order_line_item_group.rb +23 -0
  5. data/lib/inttegro/chime/send_request.rb +9 -0
  6. data/lib/inttegro/chime/send_request_cooldown.rb +35 -0
  7. data/lib/inttegro/chime/transport.rb +2 -1
  8. data/lib/inttegro/generated/enums.rb +12 -1
  9. data/lib/inttegro/generated/models.rb +26 -0
  10. data/lib/inttegro/generated/operations.rb +18 -3
  11. data/lib/inttegro/http_client.rb +1 -1
  12. data/lib/inttegro/order/create_existing_customer.rb +23 -0
  13. data/lib/inttegro/order/create_new_customer.rb +23 -0
  14. data/lib/inttegro/order/document_delivery_attempt.rb +7 -0
  15. data/lib/inttegro/order/document_delivery_channel_summary.rb +34 -0
  16. data/lib/inttegro/order/document_delivery_summary.rb +43 -0
  17. data/lib/inttegro/order/document_delivery_summary_channels.rb +36 -0
  18. data/lib/inttegro/order/invoice.rb +8 -0
  19. data/lib/inttegro/order/invoice_format.rb +3 -2
  20. data/lib/inttegro/order/line_item_group.rb +25 -0
  21. data/lib/inttegro/order/receipt_document_format.rb +35 -0
  22. data/lib/inttegro/order/update_request.rb +23 -0
  23. data/lib/inttegro/otp/initiate_request.rb +35 -8
  24. data/lib/inttegro/otp/purpose.rb +62 -0
  25. data/lib/inttegro/otp/transmission.rb +4 -4
  26. data/lib/inttegro/otp/transmission_status.rb +9 -0
  27. data/lib/inttegro/otp/verify_request.rb +2 -1
  28. data/lib/inttegro/refund/line_item.rb +31 -1
  29. data/lib/inttegro/refund/order_fee_line_item.rb +43 -0
  30. data/lib/inttegro/refund/order_fee_line_item_fee.rb +34 -0
  31. data/lib/inttegro/{otp/transmission_sent_via.rb → refund/order_fee_line_item_type.rb} +7 -6
  32. data/lib/inttegro/refund/order_line_item.rb +20 -0
  33. data/lib/inttegro/refund/order_product_line_item.rb +50 -0
  34. data/lib/inttegro/refund/order_product_line_item_product.rb +34 -0
  35. data/lib/inttegro/refund/order_product_line_item_type.rb +25 -0
  36. data/lib/inttegro/refund/order_shipping_line_item.rb +43 -0
  37. data/lib/inttegro/refund/order_shipping_line_item_shipping.rb +34 -0
  38. data/lib/inttegro/refund/order_shipping_line_item_type.rb +25 -0
  39. data/lib/inttegro/refund/payment_method_settlement.rb +18 -0
  40. data/lib/inttegro/refund/refund.rb +18 -0
  41. data/lib/inttegro/resources/customers.rb +8 -0
  42. data/lib/inttegro/resources/financial_accounts.rb +12 -0
  43. data/lib/inttegro/resources/orders.rb +8 -0
  44. data/lib/inttegro/resources/payouts.rb +8 -0
  45. data/lib/inttegro/resources/products.rb +8 -0
  46. data/lib/inttegro/search/base.rb +17 -0
  47. data/lib/inttegro/search/facet.rb +34 -0
  48. data/lib/inttegro/search/facet_bucket.rb +34 -0
  49. data/lib/inttegro/search/facet_result.rb +35 -0
  50. data/lib/inttegro/search/filter.rb +42 -0
  51. data/lib/inttegro/search/filter_operator.rb +27 -0
  52. data/lib/inttegro/search/freshness.rb +43 -0
  53. data/lib/inttegro/search/freshness_state.rb +36 -0
  54. data/lib/inttegro/search/page.rb +104 -0
  55. data/lib/inttegro/search/request.rb +68 -0
  56. data/lib/inttegro/search/resource_freshness.rb +50 -0
  57. data/lib/inttegro/search/resource_freshness_state.rb +37 -0
  58. data/lib/inttegro/search/resource_reference.rb +35 -0
  59. data/lib/inttegro/search/resource_total.rb +43 -0
  60. data/lib/inttegro/search/resource_total_relation.rb +28 -0
  61. data/lib/inttegro/search/response.rb +28 -0
  62. data/lib/inttegro/search/result.rb +78 -0
  63. data/lib/inttegro/search/sort.rb +36 -0
  64. data/lib/inttegro/search/sort_direction.rb +27 -0
  65. data/lib/inttegro/search/sort_field.rb +30 -0
  66. data/lib/inttegro/search/total.rb +35 -0
  67. data/lib/inttegro/search/total_relation.rb +27 -0
  68. data/lib/inttegro/search/type.rb +36 -0
  69. data/lib/inttegro/telemetry.rb +1 -1
  70. data/lib/inttegro/version.rb +1 -1
  71. data/rbi/inttegro/generated.rbi +15 -0
  72. metadata +41 -3
@@ -4,7 +4,9 @@
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 "../chime/transport"
7
8
  require_relative "alphabet_type"
9
+ require_relative "purpose"
8
10
 
9
11
  module Inttegro
10
12
  module OTP
@@ -17,31 +19,47 @@ module Inttegro
17
19
  # @api public
18
20
  #
19
21
  # @!attribute [r] async_delivery
20
- # Return after accepting the transaction while SMS delivery continues asynchronously.
22
+ # Return after accepting the transaction while delivery continues asynchronously.
21
23
  #
22
24
  # Optional in the API payload; omitted values default to `nil`. Wire name: `async_delivery`.
23
25
  # @return [Boolean, nil]
24
26
  #
25
27
  # @!attribute [r] message_template
26
- # SMS text containing the required `{token}` placeholder and optional `{service}` placeholder.
28
+ # SMS body or email copy containing the required `{token}` placeholder and optional
29
+ # `{service}` placeholder. Email templates must contain `{token}` exactly once. A custom
30
+ # template replaces the purpose-specific default body, while `purpose` still controls the
31
+ # email subject and heading. Email sends this as the plain-text fallback and renders the copy
32
+ # around a prominent code in the HTML version. Defaults are transport-specific.
27
33
  #
28
34
  # Optional in the API payload; omitted values default to `nil`. Wire name: `message_template`.
29
35
  # @return [String, nil]
30
36
  #
31
- # @!attribute [r] purpose
32
- # Your label for the verification flow.
37
+ # @!attribute [r] preferred_gateway
38
+ # Optional SMS gateway; not valid for email OTP delivery. Email uses the configured default
39
+ # provider.
33
40
  #
34
- # Optional in the API payload; omitted values default to `nil`. Wire name: `purpose`.
41
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `preferred_gateway`.
35
42
  # @return [String, nil]
36
43
  #
44
+ # @!attribute [r] purpose
45
+ # Customer action protected by the OTP. Controls safe, purpose-specific default email copy.
46
+ # Unknown values are rejected; use `unspecified` explicitly for a general verification
47
+ # request.
48
+ #
49
+ # Required in the API payload. Wire name: `purpose`.
50
+ # @return [Inttegro::OTP::Purpose]
51
+ #
37
52
  # @!attribute [r] recipient
38
- # Phone number in international format (E.164)
53
+ # Phone number in international format (E.164) or bare email address. Transport is inferred
54
+ # from the address unless specified.
39
55
  #
40
56
  # Required in the API payload. Wire name: `recipient`.
41
57
  # @return [String]
42
58
  #
43
59
  # @!attribute [r] sender
44
- # Optional sender identifier shown to the recipient (3-12 characters).
60
+ # Optional SMS sender identifier (3-12 characters). Email OTP always uses `{service_name}
61
+ # <noreply@inttegro.com>`; omit this field for email or supply exactly the bare
62
+ # `noreply@inttegro.com` address.
45
63
  #
46
64
  # Optional in the API payload; omitted values default to `nil`. Wire name: `sender`.
47
65
  # @return [String, nil]
@@ -70,6 +88,13 @@ module Inttegro
70
88
  # Required in the API payload. Wire name: `token_size`.
71
89
  # @return [Integer]
72
90
  #
91
+ # @!attribute [r] transport
92
+ # Optional delivery transport. When omitted, an email address selects email and a phone number
93
+ # selects SMS.
94
+ #
95
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `transport`.
96
+ # @return [Inttegro::Chime::Transport, nil]
97
+ #
73
98
  # @!attribute [r] validity_duration_in_minutes
74
99
  # How long the token remains valid (3-10080 minutes)
75
100
  #
@@ -78,13 +103,15 @@ module Inttegro
78
103
  class InitiateRequest < T::Struct
79
104
  const :async_delivery, T.nilable(T::Boolean), default: nil
80
105
  const :message_template, T.nilable(String), default: nil
81
- const :purpose, T.nilable(String), default: nil
106
+ const :preferred_gateway, T.nilable(String), default: nil
107
+ const :purpose, Inttegro::OTP::Purpose
82
108
  const :recipient, String
83
109
  const :sender, T.nilable(String), default: nil
84
110
  const :service_name, String
85
111
  const :token_alphabet, T.nilable(String), default: nil
86
112
  const :token_alphabet_type, T.nilable(Inttegro::OTP::AlphabetType), default: nil
87
113
  const :token_size, Integer
114
+ const :transport, T.nilable(Inttegro::Chime::Transport), default: nil
88
115
  const :validity_duration_in_minutes, T.nilable(Integer), default: nil
89
116
  end
90
117
  end
@@ -0,0 +1,62 @@
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
+ module OTP
10
+ # Customer action protected by the OTP. Controls safe, purpose-specific default email copy.
11
+ # Unknown values are rejected; use `unspecified` explicitly for a general verification
12
+ # request.
13
+ #
14
+ # Use the constants below when constructing a request. `#serialize` returns the documented
15
+ # string wire value received from or sent to the API.
16
+ #
17
+ # @api public
18
+ class Purpose < T::Enum
19
+ enums do
20
+ # Serialized wire value: `account_creation`.
21
+ # @return [Inttegro::OTP::Purpose]
22
+ ACCOUNT_CREATION = new("account_creation")
23
+ # Serialized wire value: `account_recovery`.
24
+ # @return [Inttegro::OTP::Purpose]
25
+ ACCOUNT_RECOVERY = new("account_recovery")
26
+ # Serialized wire value: `email_verification`.
27
+ # @return [Inttegro::OTP::Purpose]
28
+ EMAIL_VERIFICATION = new("email_verification")
29
+ # Serialized wire value: `financial_account_verification`.
30
+ # @return [Inttegro::OTP::Purpose]
31
+ FINANCIAL_ACCOUNT_VERIFICATION = new("financial_account_verification")
32
+ # Serialized wire value: `password_reset`.
33
+ # @return [Inttegro::OTP::Purpose]
34
+ PASSWORD_RESET = new("password_reset")
35
+ # Serialized wire value: `payment_confirmation`.
36
+ # @return [Inttegro::OTP::Purpose]
37
+ PAYMENT_CONFIRMATION = new("payment_confirmation")
38
+ # Serialized wire value: `payment_method_verification`.
39
+ # @return [Inttegro::OTP::Purpose]
40
+ PAYMENT_METHOD_VERIFICATION = new("payment_method_verification")
41
+ # Serialized wire value: `payout_confirmation`.
42
+ # @return [Inttegro::OTP::Purpose]
43
+ PAYOUT_CONFIRMATION = new("payout_confirmation")
44
+ # Serialized wire value: `phone_verification`.
45
+ # @return [Inttegro::OTP::Purpose]
46
+ PHONE_VERIFICATION = new("phone_verification")
47
+ # Serialized wire value: `sensitive_action`.
48
+ # @return [Inttegro::OTP::Purpose]
49
+ SENSITIVE_ACTION = new("sensitive_action")
50
+ # Serialized wire value: `sign_in`.
51
+ # @return [Inttegro::OTP::Purpose]
52
+ SIGN_IN = new("sign_in")
53
+ # Serialized wire value: `transaction_confirmation`.
54
+ # @return [Inttegro::OTP::Purpose]
55
+ TRANSACTION_CONFIRMATION = new("transaction_confirmation")
56
+ # Serialized wire value: `unspecified`.
57
+ # @return [Inttegro::OTP::Purpose]
58
+ UNSPECIFIED = new("unspecified")
59
+ end
60
+ end
61
+ end
62
+ end
@@ -4,7 +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 "transmission_sent_via"
7
+ require_relative "../chime/transport"
8
8
  require_relative "transmission_status"
9
9
 
10
10
  module Inttegro
@@ -24,7 +24,7 @@ module Inttegro
24
24
  # @return [String]
25
25
  #
26
26
  # @!attribute [r] sender_id
27
- # Value of the `sender_id` field in the Inttegro API payload.
27
+ # SMS sender identifier or approved email From address.
28
28
  #
29
29
  # Required in the API payload. Wire name: `sender_id`.
30
30
  # @return [String]
@@ -39,7 +39,7 @@ module Inttegro
39
39
  # Value of the `sent_via` field in the Inttegro API payload.
40
40
  #
41
41
  # Optional in the API payload; omitted values default to `nil`. Wire name: `sent_via`.
42
- # @return [Inttegro::OTP::TransmissionSentVia, nil]
42
+ # @return [Inttegro::Chime::Transport, nil]
43
43
  #
44
44
  # @!attribute [r] status
45
45
  # Value of the `status` field in the Inttegro API payload.
@@ -50,7 +50,7 @@ module Inttegro
50
50
  const :recipient, String
51
51
  const :sender_id, String
52
52
  const :sent_at, T.nilable(Time), default: nil
53
- const :sent_via, T.nilable(Inttegro::OTP::TransmissionSentVia), default: nil
53
+ const :sent_via, T.nilable(Inttegro::Chime::Transport), default: nil
54
54
  const :status, T.nilable(Inttegro::OTP::TransmissionStatus), default: nil
55
55
  end
56
56
  end
@@ -15,12 +15,21 @@ module Inttegro
15
15
  # @api public
16
16
  class TransmissionStatus < T::Enum
17
17
  enums do
18
+ # Serialized wire value: `accepted`.
19
+ # @return [Inttegro::OTP::TransmissionStatus]
20
+ ACCEPTED = new("accepted")
18
21
  # Serialized wire value: `delivered`.
19
22
  # @return [Inttegro::OTP::TransmissionStatus]
20
23
  DELIVERED = new("delivered")
21
24
  # Serialized wire value: `failed`.
22
25
  # @return [Inttegro::OTP::TransmissionStatus]
23
26
  FAILED = new("failed")
27
+ # Serialized wire value: `queued`.
28
+ # @return [Inttegro::OTP::TransmissionStatus]
29
+ QUEUED = new("queued")
30
+ # Serialized wire value: `sent`.
31
+ # @return [Inttegro::OTP::TransmissionStatus]
32
+ SENT = new("sent")
24
33
  # Serialized wire value: `submitted`.
25
34
  # @return [Inttegro::OTP::TransmissionStatus]
26
35
  SUBMITTED = new("submitted")
@@ -22,7 +22,8 @@ module Inttegro
22
22
  # @return [String]
23
23
  #
24
24
  # @!attribute [r] recipient
25
- # Phone number that received the OTP
25
+ # Phone number or bare email address that received the OTP; must match the stored transaction
26
+ # transport.
26
27
  #
27
28
  # Required in the API payload. Wire name: `recipient`.
28
29
  # @return [String]
@@ -5,6 +5,7 @@
5
5
 
6
6
  require_relative "base"
7
7
  require_relative "../money/amount"
8
+ require_relative "order_line_item"
8
9
  require_relative "reason"
9
10
 
10
11
  module Inttegro
@@ -24,11 +25,19 @@ module Inttegro
24
25
  # @return [String]
25
26
  #
26
27
  # @!attribute [r] order_line_item_id
27
- # Value of the `order_line_item_id` field in the Inttegro API payload.
28
+ # Deprecated compatibility identifier. Use `order_line_item.id` when `order_line_item` is
29
+ # present.
28
30
  #
29
31
  # Required in the API payload. Wire name: `order_line_item_id`.
30
32
  # @return [String]
31
33
  #
34
+ # @!attribute [r] order_line_item
35
+ # Immutable display snapshot of the refunded order line. Omitted when the originating order
36
+ # cannot be resolved.
37
+ #
38
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `order_line_item`.
39
+ # @return [Inttegro::Refund::OrderLineItem, nil]
40
+ #
32
41
  # @!attribute [r] original_amount_paid
33
42
  # Value of the `original_amount_paid` field in the Inttegro API payload.
34
43
  #
@@ -55,10 +64,31 @@ module Inttegro
55
64
  class LineItem < T::Struct
56
65
  const :id, String
57
66
  const :order_line_item_id, String
67
+ const :order_line_item, T.nilable(Inttegro::Refund::OrderLineItem), default: nil
58
68
  const :original_amount_paid, Inttegro::Money::Amount
59
69
  const :reason, T.nilable(Inttegro::Refund::Reason), default: nil
60
70
  const :reason_details, T.nilable(String), default: nil
61
71
  const :refund_amount, Inttegro::Money::Amount
72
+
73
+ extend T::Sig
74
+
75
+ sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
76
+ def self.from_hash(hash, strict = false)
77
+ data = hash.dup
78
+ if (order_line_item_value = data["order_line_item"]).is_a?(Hash)
79
+ data["order_line_item"] = case order_line_item_value["type"]
80
+ when "product"
81
+ Inttegro::Refund::OrderProductLineItem.from_hash(order_line_item_value)
82
+ when "fee"
83
+ Inttegro::Refund::OrderFeeLineItem.from_hash(order_line_item_value)
84
+ when "shipping"
85
+ Inttegro::Refund::OrderShippingLineItem.from_hash(order_line_item_value)
86
+ else
87
+ order_line_item_value
88
+ end
89
+ end
90
+ super(data, strict)
91
+ end
62
92
  end
63
93
  end
64
94
  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 "order_fee_line_item_fee"
8
+ require_relative "order_fee_line_item_type"
9
+
10
+ module Inttegro
11
+ class Refund
12
+ # Typed representation of the order fee line item 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] id
21
+ # Immutable order-line identifier with the `oli_` prefix.
22
+ #
23
+ # Required in the API payload. Wire name: `id`.
24
+ # @return [String]
25
+ #
26
+ # @!attribute [r] type
27
+ # Value of the `type` field in the Inttegro API payload.
28
+ #
29
+ # Required in the API payload. Wire name: `type`.
30
+ # @return [Inttegro::Refund::OrderFeeLineItemType]
31
+ #
32
+ # @!attribute [r] fee
33
+ # Value of the `fee` field in the Inttegro API payload.
34
+ #
35
+ # Required in the API payload. Wire name: `fee`.
36
+ # @return [Inttegro::Refund::OrderFeeLineItemFee]
37
+ class OrderFeeLineItem < T::Struct
38
+ const :id, String
39
+ const :type, Inttegro::Refund::OrderFeeLineItemType
40
+ const :fee, Inttegro::Refund::OrderFeeLineItemFee
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,34 @@
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 Refund
10
+ # Typed representation of the order fee line item fee 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] label
19
+ # Value of the `label` field in the Inttegro API payload.
20
+ #
21
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `label`.
22
+ # @return [String, nil]
23
+ #
24
+ # @!attribute [r] description
25
+ # Value of the `description` field in the Inttegro API payload.
26
+ #
27
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `description`.
28
+ # @return [String, nil]
29
+ class OrderFeeLineItemFee < T::Struct
30
+ const :label, T.nilable(String), default: nil
31
+ const :description, T.nilable(String), default: nil
32
+ end
33
+ end
34
+ end
@@ -6,18 +6,19 @@
6
6
  require_relative "base"
7
7
 
8
8
  module Inttegro
9
- module OTP
10
- # String-backed values accepted by the Inttegro API for Inttegro::OTP::TransmissionSentVia.
9
+ class Refund
10
+ # String-backed values accepted by the Inttegro API for
11
+ # Inttegro::Refund::OrderFeeLineItemType.
11
12
  #
12
13
  # Use the constants below when constructing a request. `#serialize` returns the documented
13
14
  # string wire value received from or sent to the API.
14
15
  #
15
16
  # @api public
16
- class TransmissionSentVia < T::Enum
17
+ class OrderFeeLineItemType < T::Enum
17
18
  enums do
18
- # Serialized wire value: `sms`.
19
- # @return [Inttegro::OTP::TransmissionSentVia]
20
- SMS = new("sms")
19
+ # Serialized wire value: `fee`.
20
+ # @return [Inttegro::Refund::OrderFeeLineItemType]
21
+ FEE = new("fee")
21
22
  end
22
23
  end
23
24
  end
@@ -0,0 +1,20 @@
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 "order_fee_line_item"
8
+ require_relative "order_product_line_item"
9
+ require_relative "order_shipping_line_item"
10
+
11
+ module Inttegro
12
+ class Refund
13
+ # Immutable display snapshot of the refunded order line. Omitted when the originating order
14
+ # cannot be resolved.
15
+ #
16
+ # @api public
17
+ # @return [Inttegro::Refund::OrderProductLineItem, Inttegro::Refund::OrderFeeLineItem, Inttegro::Refund::OrderShippingLineItem]
18
+ OrderLineItem = T.type_alias { T.any(Inttegro::Refund::OrderProductLineItem, Inttegro::Refund::OrderFeeLineItem, Inttegro::Refund::OrderShippingLineItem) }
19
+ end
20
+ 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 "order_product_line_item_product"
8
+ require_relative "order_product_line_item_type"
9
+
10
+ module Inttegro
11
+ class Refund
12
+ # Typed representation of the order product line item 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] id
21
+ # Immutable order-line identifier with the `oli_` prefix.
22
+ #
23
+ # Required in the API payload. Wire name: `id`.
24
+ # @return [String]
25
+ #
26
+ # @!attribute [r] type
27
+ # Value of the `type` field in the Inttegro API payload.
28
+ #
29
+ # Required in the API payload. Wire name: `type`.
30
+ # @return [Inttegro::Refund::OrderProductLineItemType]
31
+ #
32
+ # @!attribute [r] quantity
33
+ # Value of the `quantity` field in the Inttegro API payload.
34
+ #
35
+ # Required in the API payload. Wire name: `quantity`.
36
+ # @return [Integer]
37
+ #
38
+ # @!attribute [r] product
39
+ # Value of the `product` field in the Inttegro API payload.
40
+ #
41
+ # Required in the API payload. Wire name: `product`.
42
+ # @return [Inttegro::Refund::OrderProductLineItemProduct]
43
+ class OrderProductLineItem < T::Struct
44
+ const :id, String
45
+ const :type, Inttegro::Refund::OrderProductLineItemType
46
+ const :quantity, Integer
47
+ const :product, Inttegro::Refund::OrderProductLineItemProduct
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,34 @@
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 Refund
10
+ # Typed representation of the order product line item product 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
+ # Source catalog product identifier. Omitted for inline products.
20
+ #
21
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `id`.
22
+ # @return [String, nil]
23
+ #
24
+ # @!attribute [r] name
25
+ # Product name captured on the order.
26
+ #
27
+ # Required in the API payload. Wire name: `name`.
28
+ # @return [String]
29
+ class OrderProductLineItemProduct < T::Struct
30
+ const :id, T.nilable(String), default: nil
31
+ const :name, String
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,25 @@
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 Refund
10
+ # String-backed values accepted by the Inttegro API for
11
+ # Inttegro::Refund::OrderProductLineItemType.
12
+ #
13
+ # Use the constants below when constructing a request. `#serialize` returns the documented
14
+ # string wire value received from or sent to the API.
15
+ #
16
+ # @api public
17
+ class OrderProductLineItemType < T::Enum
18
+ enums do
19
+ # Serialized wire value: `product`.
20
+ # @return [Inttegro::Refund::OrderProductLineItemType]
21
+ PRODUCT = new("product")
22
+ end
23
+ end
24
+ end
25
+ 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 "order_shipping_line_item_shipping"
8
+ require_relative "order_shipping_line_item_type"
9
+
10
+ module Inttegro
11
+ class Refund
12
+ # Typed representation of the order shipping line item 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] id
21
+ # Immutable order-line identifier with the `oli_` prefix.
22
+ #
23
+ # Required in the API payload. Wire name: `id`.
24
+ # @return [String]
25
+ #
26
+ # @!attribute [r] type
27
+ # Value of the `type` field in the Inttegro API payload.
28
+ #
29
+ # Required in the API payload. Wire name: `type`.
30
+ # @return [Inttegro::Refund::OrderShippingLineItemType]
31
+ #
32
+ # @!attribute [r] shipping
33
+ # Value of the `shipping` field in the Inttegro API payload.
34
+ #
35
+ # Required in the API payload. Wire name: `shipping`.
36
+ # @return [Inttegro::Refund::OrderShippingLineItemShipping]
37
+ class OrderShippingLineItem < T::Struct
38
+ const :id, String
39
+ const :type, Inttegro::Refund::OrderShippingLineItemType
40
+ const :shipping, Inttegro::Refund::OrderShippingLineItemShipping
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,34 @@
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 Refund
10
+ # Typed representation of the order shipping line item shipping 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] label
19
+ # Value of the `label` field in the Inttegro API payload.
20
+ #
21
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `label`.
22
+ # @return [String, nil]
23
+ #
24
+ # @!attribute [r] description
25
+ # Value of the `description` field in the Inttegro API payload.
26
+ #
27
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `description`.
28
+ # @return [String, nil]
29
+ class OrderShippingLineItemShipping < T::Struct
30
+ const :label, T.nilable(String), default: nil
31
+ const :description, T.nilable(String), default: nil
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,25 @@
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 Refund
10
+ # String-backed values accepted by the Inttegro API for
11
+ # Inttegro::Refund::OrderShippingLineItemType.
12
+ #
13
+ # Use the constants below when constructing a request. `#serialize` returns the documented
14
+ # string wire value received from or sent to the API.
15
+ #
16
+ # @api public
17
+ class OrderShippingLineItemType < T::Enum
18
+ enums do
19
+ # Serialized wire value: `shipping`.
20
+ # @return [Inttegro::Refund::OrderShippingLineItemType]
21
+ SHIPPING = new("shipping")
22
+ end
23
+ end
24
+ end
25
+ end
@@ -32,6 +32,24 @@ module Inttegro
32
32
  class PaymentMethodSettlement < T::Struct
33
33
  const :payment_method, Inttegro::Refund::SettlementPaymentMethod
34
34
  const :type, Inttegro::Refund::PaymentMethodSettlementType
35
+
36
+ extend T::Sig
37
+
38
+ sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
39
+ def self.from_hash(hash, strict = false)
40
+ data = hash.dup
41
+ if (payment_method_value = data["payment_method"]).is_a?(Hash)
42
+ data["payment_method"] = case payment_method_value["type"]
43
+ when "bank_account"
44
+ Inttegro::Refund::SettlementBankAccountPaymentMethod.from_hash(payment_method_value)
45
+ when "mobile_money"
46
+ Inttegro::Refund::SettlementMobileMoneyPaymentMethod.from_hash(payment_method_value)
47
+ else
48
+ payment_method_value
49
+ end
50
+ end
51
+ super(data, strict)
52
+ end
35
53
  end
36
54
  end
37
55
  end