inttegro 6.0.1 → 8.0.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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.md +2 -2
  4. data/SECURITY.md +1 -1
  5. data/lib/inttegro/api_response.rb +41 -0
  6. data/lib/inttegro/chime/chime.rb +3 -2
  7. data/lib/inttegro/chime/send_request.rb +3 -2
  8. data/lib/inttegro/custom_data.rb +132 -0
  9. data/lib/inttegro/customer/create_request.rb +3 -2
  10. data/lib/inttegro/customer/customer.rb +3 -2
  11. data/lib/inttegro/customer/data.rb +3 -2
  12. data/lib/inttegro/customer/update_request.rb +3 -2
  13. data/lib/inttegro/file/file.rb +3 -2
  14. data/lib/inttegro/file_link/create_request.rb +3 -2
  15. data/lib/inttegro/file_link/file_link.rb +3 -2
  16. data/lib/inttegro/financial_account/bank_request.rb +3 -2
  17. data/lib/inttegro/financial_account/connected.rb +3 -2
  18. data/lib/inttegro/financial_account/created.rb +3 -2
  19. data/lib/inttegro/financial_account/details.rb +3 -2
  20. data/lib/inttegro/financial_account/dosh_request.rb +3 -2
  21. data/lib/inttegro/financial_account/financial_account.rb +3 -2
  22. data/lib/inttegro/financial_account/request_base.rb +3 -2
  23. data/lib/inttegro/financial_account/update_request.rb +3 -2
  24. data/lib/inttegro/financial_account/updated.rb +3 -2
  25. data/lib/inttegro/financial_account/wallet_request.rb +3 -2
  26. data/lib/inttegro/financial_account/wire_page_accounts_item.rb +3 -2
  27. data/lib/inttegro/generated/enums.rb +5 -1
  28. data/lib/inttegro/generated/models.rb +22 -17
  29. data/lib/inttegro/generated/operations.rb +6 -6
  30. data/lib/inttegro/http_client.rb +65 -1
  31. data/lib/inttegro/model_serialization.rb +30 -1
  32. data/lib/inttegro/order/create_existing_customer.rb +3 -2
  33. data/lib/inttegro/order/create_new_customer.rb +3 -2
  34. data/lib/inttegro/order/order.rb +3 -2
  35. data/lib/inttegro/order/product_line_item_product.rb +3 -2
  36. data/lib/inttegro/order/update_request.rb +3 -2
  37. data/lib/inttegro/payment_method/payment_method.rb +14 -2
  38. data/lib/inttegro/payment_method/tokenize_base.rb +3 -2
  39. data/lib/inttegro/payment_method/tokenize_mobile_money_request.rb +3 -2
  40. data/lib/inttegro/payment_method/update_request.rb +3 -2
  41. data/lib/inttegro/payout/cancel_request.rb +2 -2
  42. data/lib/inttegro/payout/{lookup_response.rb → destinations.rb} +8 -8
  43. data/lib/inttegro/payout/disable_automatic_response.rb +1 -1
  44. data/lib/inttegro/payout/error.rb +5 -5
  45. data/lib/inttegro/payout/lookup_request.rb +2 -2
  46. data/lib/inttegro/payout/page.rb +3 -3
  47. data/lib/inttegro/payout/page_request.rb +3 -3
  48. data/lib/inttegro/payout/page_response.rb +2 -2
  49. data/lib/inttegro/payout/payout.rb +4 -3
  50. data/lib/inttegro/payout/{cancel_response.rb → response.rb} +2 -2
  51. data/lib/inttegro/payout/set_destinations_request.rb +5 -4
  52. data/lib/inttegro/payout/settings_lookup.rb +5 -4
  53. data/lib/inttegro/payout/{get_settings_response.rb → settings_lookup_response.rb} +2 -2
  54. data/lib/inttegro/payout/settings_lookup_schedule.rb +2 -2
  55. data/lib/inttegro/payout/settings_lookup_schedule_aging_spec.rb +4 -4
  56. data/lib/inttegro/payout/settings_mutation.rb +12 -4
  57. data/lib/inttegro/payout/{set_destinations_response.rb → settings_mutation_response.rb} +2 -2
  58. data/lib/inttegro/payout/settings_mutation_schedule.rb +2 -2
  59. data/lib/inttegro/payout/settings_mutation_schedule_spec.rb +1 -1
  60. data/lib/inttegro/price/embedded_product.rb +3 -2
  61. data/lib/inttegro/product/create_request.rb +3 -2
  62. data/lib/inttegro/product/inline_details.rb +3 -2
  63. data/lib/inttegro/product/product.rb +3 -2
  64. data/lib/inttegro/product/update_request.rb +3 -2
  65. data/lib/inttegro/product/updated.rb +3 -2
  66. data/lib/inttegro/purchase_intent/product.rb +3 -2
  67. data/lib/inttegro/purchase_intent/purchase_intent.rb +0 -8
  68. data/lib/inttegro/refund/cancel_request.rb +7 -0
  69. data/lib/inttegro/refund/create_request.rb +3 -2
  70. data/lib/inttegro/refund/failure.rb +45 -0
  71. data/lib/inttegro/refund/failure_reason.rb +49 -0
  72. data/lib/inttegro/refund/offline_settlement.rb +28 -0
  73. data/lib/inttegro/refund/offline_settlement_type.rb +24 -0
  74. data/lib/inttegro/refund/payment_method_settlement.rb +37 -0
  75. data/lib/inttegro/refund/payment_method_settlement_type.rb +24 -0
  76. data/lib/inttegro/refund/refund.rb +35 -2
  77. data/lib/inttegro/refund/settlement.rb +19 -0
  78. data/lib/inttegro/refund/settlement_bank_account_payment_method.rb +44 -0
  79. data/lib/inttegro/refund/settlement_bank_account_payment_method_bank_account.rb +37 -0
  80. data/lib/inttegro/refund/settlement_bank_account_payment_method_bank_account_ghana_bank_account.rb +35 -0
  81. data/lib/inttegro/refund/settlement_bank_account_payment_method_type.rb +25 -0
  82. data/lib/inttegro/refund/settlement_mobile_money_payment_method.rb +44 -0
  83. data/lib/inttegro/refund/settlement_mobile_money_payment_method_mobile_money.rb +43 -0
  84. data/lib/inttegro/refund/settlement_mobile_money_payment_method_type.rb +25 -0
  85. data/lib/inttegro/refund/settlement_payment_method.rb +19 -0
  86. data/lib/inttegro/resources/orders.rb +8 -0
  87. data/lib/inttegro/resources/payouts.rb +15 -32
  88. data/lib/inttegro/resources/refunds.rb +5 -2
  89. data/lib/inttegro/schedule/payout_request.rb +5 -5
  90. data/lib/inttegro/shared/fee_details.rb +3 -2
  91. data/lib/inttegro/shared/invoice_settings.rb +3 -2
  92. data/lib/inttegro/shared/response_meta.rb +35 -0
  93. data/lib/inttegro/shared/shipping_details.rb +3 -2
  94. data/lib/inttegro/upload_request/create_request.rb +3 -2
  95. data/lib/inttegro/upload_request/details.rb +3 -2
  96. data/lib/inttegro/upload_request/upload_request.rb +3 -2
  97. data/lib/inttegro/version.rb +1 -1
  98. data/lib/inttegro.rb +2 -0
  99. data/rbi/inttegro/generated.rbi +11 -8
  100. metadata +27 -16
  101. data/lib/inttegro/payout/enable_automatic_response.rb +0 -28
  102. data/lib/inttegro/purchase_intent/activity.rb +0 -122
  103. data/lib/inttegro/purchase_intent/activity_attribution.rb +0 -83
  104. data/lib/inttegro/purchase_intent/activity_log.rb +0 -28
  105. data/lib/inttegro/purchase_intent/activity_type.rb +0 -37
  106. data/lib/inttegro/purchase_intent/activity_visitor.rb +0 -97
  107. data/lib/inttegro/schedule/payout_response.rb +0 -28
@@ -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 "../shared/mobile_money_network"
8
+
9
+ module Inttegro
10
+ class Refund
11
+ # Typed representation of the settlement mobile money payment method mobile money object in
12
+ # 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] account_number
21
+ # Masked mobile-money account number. The full number is never returned.
22
+ #
23
+ # Required in the API payload. Wire name: `account_number`.
24
+ # @return [String]
25
+ #
26
+ # @!attribute [r] last4
27
+ # Last four numeric digits of the original account number.
28
+ #
29
+ # Required in the API payload. Wire name: `last4`.
30
+ # @return [String]
31
+ #
32
+ # @!attribute [r] network
33
+ # Value of the `network` field in the Inttegro API payload.
34
+ #
35
+ # Required in the API payload. Wire name: `network`.
36
+ # @return [Inttegro::Shared::MobileMoneyNetwork]
37
+ class SettlementMobileMoneyPaymentMethodMobileMoney < T::Struct
38
+ const :account_number, String
39
+ const :last4, String
40
+ const :network, Inttegro::Shared::MobileMoneyNetwork
41
+ end
42
+ end
43
+ 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::SettlementMobileMoneyPaymentMethodType.
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 SettlementMobileMoneyPaymentMethodType < T::Enum
18
+ enums do
19
+ # Serialized wire value: `mobile_money`.
20
+ # @return [Inttegro::Refund::SettlementMobileMoneyPaymentMethodType]
21
+ MOBILE_MONEY = new("mobile_money")
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,19 @@
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 "settlement_bank_account_payment_method"
8
+ require_relative "settlement_mobile_money_payment_method"
9
+
10
+ module Inttegro
11
+ class Refund
12
+ # Caller-safe immutable snapshot of the original payment method. Account values are masked and
13
+ # management-only payment-method data is never included.
14
+ #
15
+ # @api public
16
+ # @return [Inttegro::Refund::SettlementMobileMoneyPaymentMethod, Inttegro::Refund::SettlementBankAccountPaymentMethod]
17
+ SettlementPaymentMethod = T.type_alias { T.any(Inttegro::Refund::SettlementMobileMoneyPaymentMethod, Inttegro::Refund::SettlementBankAccountPaymentMethod) }
18
+ end
19
+ end
@@ -104,6 +104,14 @@ module Inttegro
104
104
  @http.post_resource("/orders/create", Inttegro::Order, :order, payload)
105
105
  end
106
106
 
107
+ # Create a new order and keep HTTP response metadata with the decoded order.
108
+ #
109
+ # @param payload [Hash, Inttegro::Order::CreateNewCustomer, Inttegro::Order::CreateExistingCustomer]
110
+ # @return [Inttegro::APIResponse] response whose data is an Inttegro::Order
111
+ def create_with_response(payload)
112
+ @http.post_resource_with_response("/orders/create", Inttegro::Order, :order, payload)
113
+ end
114
+
107
115
  # Retrieve an existing order by its ID.
108
116
  #
109
117
  # Returns full order details including customer, line items, payment state, and invoice information.
@@ -18,20 +18,16 @@ module Inttegro
18
18
 
19
19
  # Configure which financial account should be used for payouts in each currency.
20
20
  #
21
- # Sets payout destinations by mapping currency codes to financial account IDs. Each financial
22
- # account must be owned by your application, have push operations enabled, and its currency
23
- # must match the currency key in the destinations map.
21
+ # Sets the supported GHS payout destination. The financial account must be owned by your
22
+ # application, have push operations enabled, and use Ghana cedi.
24
23
  #
25
- # @param destinations [Hash] Map of currency codes to financial account IDs (required)
24
+ # @param destinations [Inttegro::Payout::Destinations] supported destination assignments
26
25
  #
27
26
  # @return [Inttegro::Payout::SettingsMutation] Updated payout settings
28
27
  #
29
- # @example Set payout destinations for multiple currencies
28
+ # @example Set the GHS payout destination
30
29
  # result = client.payouts.set_destinations(
31
- # destinations: {
32
- # 'ghs' => 'fa_1234567890abcdef',
33
- # 'usd' => 'fa_0987654321fedcba'
34
- # }
30
+ # destinations: Inttegro::Payout::Destinations.new(ghs: "fa_1234567890abcdef")
35
31
  # )
36
32
  #
37
33
  # puts "Destinations configured: #{result.destinations}"
@@ -110,7 +106,7 @@ module Inttegro
110
106
  # Important: FX conversion incurs additional fees beyond standard payout fees, and exchange rates are
111
107
  # determined at payout execution time. FX-enabled payouts require approval and special configuration.
112
108
  #
113
- # @return [Inttegro::Payout::SettingsLookup] Updated payout settings
109
+ # @return [Inttegro::Payout::SettingsMutation] Updated payout settings
114
110
  #
115
111
  # @example Enable foreign exchange for payouts
116
112
  # result = client.payouts.enable_fx
@@ -119,7 +115,7 @@ module Inttegro
119
115
  #
120
116
  # @see https://studio.inttegro.com/enable-fx-payouts for FX payout guide
121
117
  def enable_fx
122
- @http.post_resource("/payouts/enable_fx", Inttegro::Payout::SettingsLookup, :settings, {})
118
+ @http.post_resource("/payouts/enable_fx", Inttegro::Payout::SettingsMutation, :settings, {})
123
119
  end
124
120
 
125
121
  # Disable foreign exchange conversion for payouts.
@@ -127,7 +123,7 @@ module Inttegro
127
123
  # Disables FX conversion, restricting payouts to accounts that match the transaction currency.
128
124
  # After disabling FX, GHS balance can only be paid out to GHS accounts, USD balance only to USD accounts, etc.
129
125
  #
130
- # @return [Inttegro::Payout::SettingsLookup] Updated payout settings
126
+ # @return [Inttegro::Payout::SettingsMutation] Updated payout settings
131
127
  #
132
128
  # @example Disable foreign exchange for payouts
133
129
  # result = client.payouts.disable_fx
@@ -136,46 +132,33 @@ module Inttegro
136
132
  #
137
133
  # @see https://studio.inttegro.com/disable-fx-payouts for FX payout guide
138
134
  def disable_fx
139
- @http.post_resource("/payouts/disable_fx", Inttegro::Payout::SettingsLookup, :settings, {})
135
+ @http.post_resource("/payouts/disable_fx", Inttegro::Payout::SettingsMutation, :settings, {})
140
136
  end
141
137
 
142
138
  # Retrieve a paginated list of payouts.
143
139
  #
144
- # Returns payouts in reverse chronological order (most recent first). Use the has_more field
145
- # and page parameter to navigate through results. Supports filtering by status and time range.
140
+ # Returns payouts in reverse chronological order (most recent first).
146
141
  #
147
- # @param payload [Hash, Inttegro::Payout::PageRequest] Pagination and filter parameters (optional)
148
- # @option payload [Integer] :page Page number to retrieve (minimum 1, default: 1)
149
- # @option payload [Integer] :per_page Number of results per page (minimum 1, maximum 100, default: 10)
150
- # @option payload [String] :status Filter by payout status (e.g., 'pending', 'paid', 'failed')
151
- # @option payload [Time] :created_after Filter payouts created after this timestamp
152
- # @option payload [Time] :created_before Filter payouts created before this timestamp
142
+ # @param payload [Inttegro::Payout::PageRequest] Typed pagination parameters
153
143
  #
154
144
  # @return [Inttegro::Payout::Page] Paginated list of payouts
155
145
  #
156
146
  # @example Get first page of payouts
157
147
  # result = client.payouts.page(
158
- # per_page: 25,
159
- # page: 1
148
+ # Inttegro::Payout::PageRequest.new(page_number: 1, page_size: 25)
160
149
  # )
161
150
  #
162
151
  # puts "Retrieved #{result.payouts&.length || 0} payouts"
163
152
  #
164
- # @example Filter by status
165
- # paid_payouts = client.payouts.page(
166
- # status: 'paid',
167
- # per_page: 50
168
- # )
169
- #
170
153
  # @see https://studio.inttegro.com/pagination for pagination guide
171
154
  # @see https://studio.inttegro.com/product-payouts for payouts overview
172
- def page(payload = {})
173
- @http.post_resource("/payouts/page", Inttegro::Payout::Page, :page, payload || {})
155
+ def page(payload)
156
+ @http.post_resource("/payouts/page", Inttegro::Payout::Page, :page, payload)
174
157
  end
175
158
 
176
159
  # Schedule a payout from the application's available balance.
177
160
  #
178
- # @param payload [Hash, Inttegro::Schedule::PayoutRequest] amount, destination, and execution fields
161
+ # @param payload [Inttegro::Schedule::PayoutRequest] typed amount, destination, and execution fields
179
162
  # @return [Inttegro::Payout] scheduled payout
180
163
  def schedule(payload)
181
164
  @http.post_resource("/payouts/schedule", Inttegro::Payout, :payout, payload)
@@ -23,12 +23,15 @@ module Inttegro
23
23
  # Cancel a pending refund before processing claims it.
24
24
  #
25
25
  # @param refund_id [String] unique refund identifier
26
+ # @param reason [String, nil] optional explanation for canceling the refund
26
27
  # @return [Inttegro::Refund] canceled refund
27
- def cancel(refund_id:)
28
+ def cancel(refund_id:, reason: nil)
29
+ payload = T.let({ refund_id: refund_id }, Inttegro::Types::Payload)
30
+ payload[:reason] = reason unless reason.nil?
28
31
  @http.post_resource(
29
32
  "/refunds/cancel",
30
33
  Inttegro::Refund, :refund,
31
- { refund_id: refund_id }
34
+ payload
32
35
  )
33
36
  end
34
37
 
@@ -7,7 +7,7 @@ require_relative "base"
7
7
 
8
8
  module Inttegro
9
9
  module Schedule
10
- # Typed representation of the payout request object in the Inttegro API.
10
+ # Parameters for scheduling a 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
@@ -16,25 +16,25 @@ module Inttegro
16
16
  # @api public
17
17
  #
18
18
  # @!attribute [r] destination_id
19
- # Financial account that should receive the payout
19
+ # Financial account that should receive the payout.
20
20
  #
21
21
  # Required in the API payload. Wire name: `destination_id`.
22
22
  # @return [String]
23
23
  #
24
24
  # @!attribute [r] execute_after
25
- # Optional future time after which execution may begin
25
+ # Optional future time after which execution may begin.
26
26
  #
27
27
  # Optional in the API payload; omitted values default to `nil`. Wire name: `execute_after`.
28
28
  # @return [Time, nil]
29
29
  #
30
30
  # @!attribute [r] max_amount
31
- # Maximum amount, in the smallest currency unit, that this payout may transfer
31
+ # Maximum amount, in the smallest currency unit, that this payout may transfer.
32
32
  #
33
33
  # Optional in the API payload; omitted values default to `nil`. Wire name: `max_amount`.
34
34
  # @return [Integer, nil]
35
35
  #
36
36
  # @!attribute [r] reference
37
- # Merchant reference carried on the payout
37
+ # Merchant reference carried on the payout.
38
38
  #
39
39
  # Required in the API payload. Wire name: `reference`.
40
40
  # @return [String]
@@ -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 "../custom_data"
7
8
  require_relative "../money/amount_params"
8
9
 
9
10
  module Inttegro
@@ -45,7 +46,7 @@ module Inttegro
45
46
  # collection rather than a raw map.
46
47
  #
47
48
  # Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
48
- # @return [Hash{String => String}, nil]
49
+ # @return [Inttegro::CustomData, nil]
49
50
  #
50
51
  # @!attribute [r] amount
51
52
  # Value of the `amount` field in the Inttegro API payload.
@@ -57,7 +58,7 @@ module Inttegro
57
58
  const :label, T.nilable(String), default: nil
58
59
  const :tax_code, T.nilable(String), default: nil
59
60
  const :description, T.nilable(String), default: nil
60
- const :custom_data, T.nilable(T::Hash[String, String]), default: nil
61
+ const :custom_data, T.nilable(Inttegro::CustomData), default: nil
61
62
  const :amount, Inttegro::Money::AmountParams
62
63
  end
63
64
  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 "../custom_data"
7
8
 
8
9
  module Inttegro
9
10
  module Shared
@@ -40,12 +41,12 @@ module Inttegro
40
41
  # collection rather than a raw map.
41
42
  #
42
43
  # Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
43
- # @return [Hash{String => String}, nil]
44
+ # @return [Inttegro::CustomData, nil]
44
45
  class InvoiceSettings < T::Struct
45
46
  const :number, T.nilable(String), default: nil
46
47
  const :memo, T.nilable(String), default: nil
47
48
  const :footer, T.nilable(String), default: nil
48
- const :custom_data, T.nilable(T::Hash[String, String]), default: nil
49
+ const :custom_data, T.nilable(Inttegro::CustomData), default: nil
49
50
  end
50
51
  end
51
52
  end
@@ -0,0 +1,35 @@
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 Shared
10
+ # Curated response metadata. This is body metadata and does not replace native HTTP status or
11
+ # response headers.
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] request_id
20
+ # Inttegro request identifier for this API response.
21
+ #
22
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `request_id`.
23
+ # @return [String, nil]
24
+ #
25
+ # @!attribute [r] debug
26
+ # Optional debug information returned only when explicitly enabled and authorized.
27
+ #
28
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `debug`.
29
+ # @return [Hash{String => Object}, nil]
30
+ class ResponseMeta < T::Struct
31
+ const :request_id, T.nilable(String), default: nil
32
+ const :debug, T.nilable(T::Hash[String, Object]), default: nil
33
+ end
34
+ end
35
+ 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 "../custom_data"
7
8
  require_relative "../money/amount_params"
8
9
 
9
10
  module Inttegro
@@ -33,7 +34,7 @@ module Inttegro
33
34
  # collection rather than a raw map.
34
35
  #
35
36
  # Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
36
- # @return [Hash{String => String}, nil]
37
+ # @return [Inttegro::CustomData, nil]
37
38
  #
38
39
  # @!attribute [r] fee
39
40
  # Value of the `fee` field in the Inttegro API payload.
@@ -43,7 +44,7 @@ module Inttegro
43
44
  class ShippingDetails < T::Struct
44
45
  const :id, T.nilable(String), default: nil
45
46
  const :tax_code, T.nilable(String), default: nil
46
- const :custom_data, T.nilable(T::Hash[String, String]), default: nil
47
+ const :custom_data, T.nilable(Inttegro::CustomData), default: nil
47
48
  const :fee, Inttegro::Money::AmountParams
48
49
  end
49
50
  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 "../custom_data"
7
8
  require_relative "../file/actor_input"
8
9
  require_relative "../file/party"
9
10
  require_relative "../file/resource"
@@ -74,7 +75,7 @@ module Inttegro
74
75
  # collection rather than a raw map.
75
76
  #
76
77
  # Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
77
- # @return [Hash{String => String}, nil]
78
+ # @return [Inttegro::CustomData, nil]
78
79
  #
79
80
  # @!attribute [r] expires_at
80
81
  # Value of the `expires_at` field in the Inttegro API payload.
@@ -90,7 +91,7 @@ module Inttegro
90
91
  const :resource, T.nilable(Inttegro::File::Resource), default: nil
91
92
  const :requester, T.nilable(Inttegro::File::ActorInput), default: nil
92
93
  const :attempts, T.nilable(Inttegro::UploadRequest::AttemptsRequest), default: nil
93
- const :custom_data, T.nilable(T::Hash[String, String]), default: nil
94
+ const :custom_data, T.nilable(Inttegro::CustomData), default: nil
94
95
  const :expires_at, T.nilable(Time), default: nil
95
96
  end
96
97
  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 "../custom_data"
7
8
  require_relative "../file/party"
8
9
  require_relative "../file/resource"
9
10
  require_relative "actor"
@@ -119,7 +120,7 @@ module Inttegro
119
120
  # collection rather than a raw map.
120
121
  #
121
122
  # Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
122
- # @return [Hash{String => String}, nil]
123
+ # @return [Inttegro::CustomData, nil]
123
124
  #
124
125
  # @!attribute [r] metadata
125
126
  # System-managed string metadata attached to a file resource.
@@ -190,7 +191,7 @@ module Inttegro
190
191
  const :attempts, Inttegro::UploadRequest::Attempts
191
192
  const :latest_error, T.nilable(Inttegro::UploadRequest::LatestError), default: nil
192
193
  const :canceled_by, T.nilable(Inttegro::UploadRequest::Actor), default: nil
193
- const :custom_data, T.nilable(T::Hash[String, String]), default: nil
194
+ const :custom_data, T.nilable(Inttegro::CustomData), default: nil
194
195
  const :metadata, T.nilable(T::Hash[String, String]), default: nil
195
196
  const :created_at, Time
196
197
  const :updated_at, Time
@@ -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 "../custom_data"
7
8
  require_relative "../file/party"
8
9
  require_relative "../file/resource"
9
10
  require_relative "actor"
@@ -117,7 +118,7 @@ module Inttegro
117
118
  # collection rather than a raw map.
118
119
  #
119
120
  # Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
120
- # @return [Hash{String => String}, nil]
121
+ # @return [Inttegro::CustomData, nil]
121
122
  #
122
123
  # @!attribute [r] metadata
123
124
  # System-managed string metadata attached to a file resource.
@@ -182,7 +183,7 @@ module Inttegro
182
183
  const :attempts, Inttegro::UploadRequest::Attempts
183
184
  const :latest_error, T.nilable(Inttegro::UploadRequest::LatestError), default: nil
184
185
  const :canceled_by, T.nilable(Inttegro::UploadRequest::Actor), default: nil
185
- const :custom_data, T.nilable(T::Hash[String, String]), default: nil
186
+ const :custom_data, T.nilable(Inttegro::CustomData), default: nil
186
187
  const :metadata, T.nilable(T::Hash[String, String]), default: nil
187
188
  const :created_at, Time
188
189
  const :updated_at, Time
@@ -2,5 +2,5 @@
2
2
  # typed: strict
3
3
 
4
4
  module Inttegro
5
- VERSION = "6.0.1"
5
+ VERSION = "8.0.0"
6
6
  end
data/lib/inttegro.rb CHANGED
@@ -4,7 +4,9 @@
4
4
  require "sorbet-runtime"
5
5
 
6
6
  require_relative "inttegro/types"
7
+ require_relative "inttegro/api_response"
7
8
  require_relative "inttegro/client"
9
+ require_relative "inttegro/custom_data"
8
10
  require_relative "inttegro/errors"
9
11
  require_relative "inttegro/error_reporting"
10
12
  require_relative "inttegro/enums"
@@ -250,6 +250,9 @@ module Inttegro
250
250
  sig { params(payload: T.any(T.any(Inttegro::Order::CreateNewCustomer, Inttegro::Order::CreateExistingCustomer), Inttegro::Types::Payload)).returns(Inttegro::Order) }
251
251
  def create(payload); end
252
252
 
253
+ sig { params(payload: T.any(T.any(Inttegro::Order::CreateNewCustomer, Inttegro::Order::CreateExistingCustomer), Inttegro::Types::Payload)).returns(Inttegro::APIResponse) }
254
+ def create_with_response(payload); end
255
+
253
256
  sig { params(order_id: String, request_meta: T.nilable(Inttegro::Types::Payload)).returns(Inttegro::Order) }
254
257
  def finalize(order_id:, request_meta: nil); end
255
258
 
@@ -353,25 +356,25 @@ module Inttegro
353
356
  sig { returns(Inttegro::Payout::SettingsMutation) }
354
357
  def disable_automatic(); end
355
358
 
356
- sig { returns(Inttegro::Payout::SettingsLookup) }
359
+ sig { returns(Inttegro::Payout::SettingsMutation) }
357
360
  def disable_fx(); end
358
361
 
359
362
  sig { returns(Inttegro::Payout::SettingsMutation) }
360
363
  def enable_automatic(); end
361
364
 
362
- sig { returns(Inttegro::Payout::SettingsLookup) }
365
+ sig { returns(Inttegro::Payout::SettingsMutation) }
363
366
  def enable_fx(); end
364
367
 
365
368
  sig { params(payout_id: String).returns(Inttegro::Payout) }
366
369
  def lookup(payout_id:); end
367
370
 
368
- sig { params(payload: T.nilable(T.any(Inttegro::Payout::PageRequest, Inttegro::Types::Payload))).returns(Inttegro::Payout::Page) }
369
- def page(payload = nil); end
371
+ sig { params(payload: Inttegro::Payout::PageRequest).returns(Inttegro::Payout::Page) }
372
+ def page(payload); end
370
373
 
371
- sig { params(payload: T.any(Inttegro::Schedule::PayoutRequest, Inttegro::Types::Payload)).returns(Inttegro::Payout) }
374
+ sig { params(payload: Inttegro::Schedule::PayoutRequest).returns(Inttegro::Payout) }
372
375
  def schedule(payload); end
373
376
 
374
- sig { params(destinations: T::Hash[String, String]).returns(Inttegro::Payout::SettingsMutation) }
377
+ sig { params(destinations: Inttegro::Payout::Destinations).returns(Inttegro::Payout::SettingsMutation) }
375
378
  def set_destinations(destinations:); end
376
379
 
377
380
  sig { returns(Inttegro::Payout::SettingsLookup) }
@@ -460,8 +463,8 @@ module Inttegro
460
463
  sig { params(http: Inttegro::HTTPClient).void }
461
464
  def initialize(http); end
462
465
 
463
- sig { params(refund_id: String).returns(Inttegro::Refund) }
464
- def cancel(refund_id:); end
466
+ sig { params(refund_id: String, reason: T.nilable(Inttegro::Types::WireValue)).returns(Inttegro::Refund) }
467
+ def cancel(refund_id:, reason: nil); end
465
468
 
466
469
  sig { params(payload: T.any(Inttegro::Refund::CreateRequest, Inttegro::Types::Payload)).returns(Inttegro::Refund) }
467
470
  def create(payload); end