inttegro 2.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +1 -1
- data/lib/inttegro/file_download.rb +1 -1
- data/lib/inttegro/generated/enums.rb +1 -1
- data/lib/inttegro/generated/models.rb +539 -537
- data/lib/inttegro/generated/operations.rb +8 -8
- data/lib/inttegro/http_client.rb +57 -3
- data/lib/inttegro/models.rb +2 -50
- data/lib/inttegro/resources/apps.rb +3 -3
- data/lib/inttegro/resources/balance_transactions.rb +2 -6
- data/lib/inttegro/resources/balances.rb +1 -1
- data/lib/inttegro/resources/broadcasts.rb +2 -6
- data/lib/inttegro/resources/chimes.rb +5 -5
- data/lib/inttegro/resources/customers.rb +4 -4
- data/lib/inttegro/resources/file_links.rb +4 -6
- data/lib/inttegro/resources/file_references.rb +1 -1
- data/lib/inttegro/resources/files.rb +4 -6
- data/lib/inttegro/resources/financial_accounts.rb +22 -22
- data/lib/inttegro/resources/keys.rb +8 -10
- data/lib/inttegro/resources/message_templates.rb +13 -15
- data/lib/inttegro/resources/orders.rb +20 -20
- data/lib/inttegro/resources/otp.rb +4 -4
- data/lib/inttegro/resources/payment_methods.rb +34 -36
- data/lib/inttegro/resources/payouts.rb +28 -28
- data/lib/inttegro/resources/prices.rb +7 -7
- data/lib/inttegro/resources/products.rb +9 -9
- data/lib/inttegro/resources/purchase_intents.rb +8 -8
- data/lib/inttegro/resources/refunds.rb +6 -6
- data/lib/inttegro/resources/schedules.rb +4 -4
- data/lib/inttegro/resources/spec.rb +1 -1
- data/lib/inttegro/resources/upload_requests.rb +10 -10
- data/lib/inttegro/version.rb +1 -1
- data/lib/inttegro.rb +15 -0
- data/rbi/inttegro/generated.rbi +110 -110
- metadata +2 -2
|
@@ -100,11 +100,11 @@ module Inttegro
|
|
|
100
100
|
# @see https://studio.inttegro.com/accept-a-payment for payment flow guide
|
|
101
101
|
# @see https://studio.inttegro.com/order-lifecycle for order states
|
|
102
102
|
def create(payload)
|
|
103
|
-
@http.
|
|
103
|
+
@http.post_resource("/orders/create", Inttegro::Order, :order, payload)
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
def new(payload)
|
|
107
|
-
@http.
|
|
107
|
+
@http.post_resource("/orders/new", Inttegro::Order, :order, payload)
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
# Retrieve an existing order by its ID.
|
|
@@ -127,11 +127,11 @@ module Inttegro
|
|
|
127
127
|
# @see https://studio.inttegro.com/orders for API reference
|
|
128
128
|
def lookup(order_id:, **options)
|
|
129
129
|
body = { order_id: order_id }.merge(options)
|
|
130
|
-
@http.
|
|
130
|
+
@http.post_resource("/orders/lookup", Inttegro::Order, :order, body)
|
|
131
131
|
end
|
|
132
132
|
|
|
133
133
|
def update(payload)
|
|
134
|
-
@http.
|
|
134
|
+
@http.post_resource("/orders/update", Inttegro::Order, :order, payload)
|
|
135
135
|
end
|
|
136
136
|
|
|
137
137
|
# Initiate payment for an existing order.
|
|
@@ -183,7 +183,7 @@ module Inttegro
|
|
|
183
183
|
# @see https://studio.inttegro.com/accept-a-payment for payment flow guide
|
|
184
184
|
# @see https://studio.inttegro.com/charge-repeat-customers for saved payment methods
|
|
185
185
|
def pay(payload)
|
|
186
|
-
@http.
|
|
186
|
+
@http.post_resource("/orders/pay", Inttegro::Order, :order, payload)
|
|
187
187
|
end
|
|
188
188
|
|
|
189
189
|
# Confirm a pending payment using a verification token (e.g., OTP sent to customer's phone).
|
|
@@ -209,7 +209,7 @@ module Inttegro
|
|
|
209
209
|
#
|
|
210
210
|
# @see https://studio.inttegro.com/accept-a-payment for complete payment flow
|
|
211
211
|
def confirm_payment(payload)
|
|
212
|
-
@http.
|
|
212
|
+
@http.post_resource("/orders/confirm_payment", Inttegro::Order, :order, payload)
|
|
213
213
|
end
|
|
214
214
|
|
|
215
215
|
# Request a new confirmation token to be sent to the customer (e.g., resend OTP).
|
|
@@ -231,14 +231,15 @@ module Inttegro
|
|
|
231
231
|
#
|
|
232
232
|
# @see https://studio.inttegro.com/accept-a-payment for payment confirmation flow
|
|
233
233
|
def request_confirmation(order_id:, request_meta: nil)
|
|
234
|
-
@http.
|
|
234
|
+
@http.post_resource(
|
|
235
235
|
"/orders/request_confirmation",
|
|
236
|
-
Inttegro::
|
|
236
|
+
Inttegro::Order,
|
|
237
|
+
:order,
|
|
237
238
|
{
|
|
238
239
|
order_id: order_id,
|
|
239
240
|
request_meta: request_meta || stable_order_request_meta("request_confirmation", order_id)
|
|
240
241
|
}
|
|
241
|
-
)
|
|
242
|
+
)
|
|
242
243
|
end
|
|
243
244
|
|
|
244
245
|
# Finalize an order to make it immutable and ready for payment or fulfillment.
|
|
@@ -260,15 +261,15 @@ module Inttegro
|
|
|
260
261
|
#
|
|
261
262
|
# @see https://studio.inttegro.com/order-lifecycle for order states
|
|
262
263
|
def finalize(order_id:, request_meta: nil)
|
|
263
|
-
|
|
264
|
+
@http.post_resource(
|
|
264
265
|
"/orders/finalize",
|
|
265
|
-
Inttegro::
|
|
266
|
+
Inttegro::Order,
|
|
267
|
+
:order,
|
|
266
268
|
{
|
|
267
269
|
order_id: order_id,
|
|
268
270
|
request_meta: request_meta || stable_order_request_meta("finalize", order_id)
|
|
269
271
|
}
|
|
270
272
|
)
|
|
271
|
-
T.must(response.order)
|
|
272
273
|
end
|
|
273
274
|
|
|
274
275
|
# Send the hosted invoice link for an existing order.
|
|
@@ -324,8 +325,7 @@ module Inttegro
|
|
|
324
325
|
#
|
|
325
326
|
# @see https://studio.inttegro.com/order-lifecycle for order states
|
|
326
327
|
def complete(payload)
|
|
327
|
-
|
|
328
|
-
T.must(response.order)
|
|
328
|
+
@http.post_resource("/orders/complete", Inttegro::Order, :order, payload)
|
|
329
329
|
end
|
|
330
330
|
|
|
331
331
|
# Cancel an order, stopping payment execution and preventing further processing.
|
|
@@ -347,14 +347,15 @@ module Inttegro
|
|
|
347
347
|
#
|
|
348
348
|
# @see https://studio.inttegro.com/order-lifecycle for order states
|
|
349
349
|
def cancel(order_id:, request_meta: nil)
|
|
350
|
-
@http.
|
|
350
|
+
@http.post_resource(
|
|
351
351
|
"/orders/cancel",
|
|
352
|
-
Inttegro::
|
|
352
|
+
Inttegro::Order,
|
|
353
|
+
:order,
|
|
353
354
|
{
|
|
354
355
|
order_id: order_id,
|
|
355
356
|
request_meta: request_meta || stable_order_request_meta("cancel", order_id)
|
|
356
357
|
}
|
|
357
|
-
)
|
|
358
|
+
)
|
|
358
359
|
end
|
|
359
360
|
|
|
360
361
|
# Create a refund through the /orders/refund compatibility alias.
|
|
@@ -380,7 +381,7 @@ module Inttegro
|
|
|
380
381
|
#
|
|
381
382
|
# @see https://studio.inttegro.com/refunds
|
|
382
383
|
def refund(payload)
|
|
383
|
-
@http.
|
|
384
|
+
@http.post_resource("/orders/refund", Inttegro::Refund, :refund, payload)
|
|
384
385
|
end
|
|
385
386
|
|
|
386
387
|
# Retrieve a paginated list of orders.
|
|
@@ -411,8 +412,7 @@ module Inttegro
|
|
|
411
412
|
# @see https://studio.inttegro.com/pagination for pagination guide
|
|
412
413
|
# @see https://studio.inttegro.com/orders for API reference
|
|
413
414
|
def page(payload = {})
|
|
414
|
-
|
|
415
|
-
T.must(response.page)
|
|
415
|
+
@http.post_resource("/orders/page", Inttegro::OrderPage, :page, payload || {})
|
|
416
416
|
end
|
|
417
417
|
|
|
418
418
|
private
|
|
@@ -9,21 +9,21 @@ module Inttegro
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def initiate(payload)
|
|
12
|
-
@http.
|
|
12
|
+
@http.post_resource("/otp/initiate", Inttegro::OTPTransaction, :transaction, payload)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
alias_method :initialize_session, :initiate
|
|
16
16
|
|
|
17
17
|
def verify(payload)
|
|
18
|
-
@http.post_model("/otp/verify", Inttegro::
|
|
18
|
+
@http.post_model("/otp/verify", Inttegro::OTPVerification, payload)
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def lookup(payload)
|
|
22
|
-
@http.
|
|
22
|
+
@http.post_resource("/otp/lookup", Inttegro::OTPTransaction, :transaction, payload)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def cancel(payload)
|
|
26
|
-
@http.
|
|
26
|
+
@http.post_resource("/otp/cancel", Inttegro::OTPTransaction, :transaction, payload)
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
end
|
|
@@ -29,7 +29,7 @@ module Inttegro
|
|
|
29
29
|
# @option payload [Hash] :payment_method_data Payment method details (required)
|
|
30
30
|
# @option payload [Boolean] :verify_immediately Send verification OTP immediately (default: false)
|
|
31
31
|
#
|
|
32
|
-
# @return [Inttegro::
|
|
32
|
+
# @return [Inttegro::PaymentMethod] Tokenized payment method
|
|
33
33
|
#
|
|
34
34
|
# @example Tokenize a mobile money payment method
|
|
35
35
|
# result = client.payment_methods.tokenize(
|
|
@@ -44,13 +44,13 @@ module Inttegro
|
|
|
44
44
|
# verify_immediately: true
|
|
45
45
|
# )
|
|
46
46
|
#
|
|
47
|
-
# puts "Tokenized payment method: #{result.
|
|
47
|
+
# puts "Tokenized payment method: #{result.id}"
|
|
48
48
|
#
|
|
49
49
|
# @see https://studio.inttegro.com/charge-repeat-customers for usage guide
|
|
50
50
|
def tokenize(payload)
|
|
51
|
-
@http.
|
|
51
|
+
@http.post_resource(
|
|
52
52
|
"/payment_methods/tokenize",
|
|
53
|
-
Inttegro::
|
|
53
|
+
Inttegro::PaymentMethod, :payment_method,
|
|
54
54
|
payload
|
|
55
55
|
)
|
|
56
56
|
end
|
|
@@ -64,20 +64,20 @@ module Inttegro
|
|
|
64
64
|
# @param payment_method_id [String] ID of the payment method to verify (required)
|
|
65
65
|
# @param request_meta [Hash, nil] Request controls such as idempotency_key (optional)
|
|
66
66
|
#
|
|
67
|
-
# @return [Inttegro::
|
|
67
|
+
# @return [Inttegro::PaymentMethodVerification] Verification details
|
|
68
68
|
#
|
|
69
69
|
# @example Verify a payment method
|
|
70
70
|
# result = client.payment_methods.verify(
|
|
71
71
|
# payment_method_id: 'pm_xyz789'
|
|
72
72
|
# )
|
|
73
73
|
#
|
|
74
|
-
# puts "Verification request: #{result.
|
|
74
|
+
# puts "Verification request: #{result.request_id}"
|
|
75
75
|
#
|
|
76
76
|
# @see https://studio.inttegro.com/charge-repeat-customers for verification flow
|
|
77
77
|
def verify(payment_method_id:, request_meta: nil)
|
|
78
|
-
@http.
|
|
78
|
+
@http.post_resource(
|
|
79
79
|
"/payment_methods/verify",
|
|
80
|
-
Inttegro::
|
|
80
|
+
Inttegro::PaymentMethodVerification, :verification,
|
|
81
81
|
{
|
|
82
82
|
payment_method_id: payment_method_id,
|
|
83
83
|
request_meta: request_meta || stable_payment_method_request_meta("verify", payment_method_id)
|
|
@@ -94,7 +94,7 @@ module Inttegro
|
|
|
94
94
|
# @option payload [String] :payment_method_id ID of the payment method being verified (required)
|
|
95
95
|
# @option payload [String] :token OTP code provided by customer (required, typically 6 digits)
|
|
96
96
|
#
|
|
97
|
-
# @return [Inttegro::
|
|
97
|
+
# @return [Inttegro::PaymentMethod] Verified payment method
|
|
98
98
|
#
|
|
99
99
|
# @example Confirm verification with OTP
|
|
100
100
|
# result = client.payment_methods.confirm_verification(
|
|
@@ -102,15 +102,15 @@ module Inttegro
|
|
|
102
102
|
# token: '123456'
|
|
103
103
|
# )
|
|
104
104
|
#
|
|
105
|
-
# if result.
|
|
105
|
+
# if result.verified_at
|
|
106
106
|
# puts 'Payment method verified successfully!'
|
|
107
107
|
# end
|
|
108
108
|
#
|
|
109
109
|
# @see https://studio.inttegro.com/charge-repeat-customers for verification flow
|
|
110
110
|
def confirm_verification(payload)
|
|
111
|
-
@http.
|
|
111
|
+
@http.post_resource(
|
|
112
112
|
"/payment_methods/confirm_verification",
|
|
113
|
-
Inttegro::
|
|
113
|
+
Inttegro::PaymentMethod, :payment_method,
|
|
114
114
|
payload
|
|
115
115
|
)
|
|
116
116
|
end
|
|
@@ -122,52 +122,52 @@ module Inttegro
|
|
|
122
122
|
#
|
|
123
123
|
# @param payment_method_id [String] ID of the payment method to retrieve (required)
|
|
124
124
|
#
|
|
125
|
-
# @return [Inttegro::
|
|
125
|
+
# @return [Inttegro::PaymentMethod] Payment method details
|
|
126
126
|
#
|
|
127
127
|
# @example Lookup a payment method
|
|
128
128
|
# result = client.payment_methods.lookup(
|
|
129
129
|
# payment_method_id: 'pm_xyz789'
|
|
130
130
|
# )
|
|
131
131
|
#
|
|
132
|
-
# puts "Payment method type: #{result.
|
|
132
|
+
# puts "Payment method type: #{result.type&.serialize}"
|
|
133
133
|
#
|
|
134
134
|
# @see https://studio.inttegro.com/payment-methods for API reference
|
|
135
135
|
def lookup(payment_method_id:)
|
|
136
|
-
@http.
|
|
136
|
+
@http.post_resource(
|
|
137
137
|
"/payment_methods/lookup",
|
|
138
|
-
Inttegro::
|
|
138
|
+
Inttegro::PaymentMethod, :payment_method,
|
|
139
139
|
{ payment_method_id: payment_method_id }
|
|
140
140
|
)
|
|
141
141
|
end
|
|
142
142
|
|
|
143
143
|
def page(payload = {})
|
|
144
|
-
@http.
|
|
144
|
+
@http.post_resource(
|
|
145
145
|
"/payment_methods/page",
|
|
146
|
-
Inttegro::
|
|
146
|
+
Inttegro::PaymentMethodPage, :page,
|
|
147
147
|
payload || {}
|
|
148
148
|
)
|
|
149
149
|
end
|
|
150
150
|
|
|
151
151
|
def update(payload)
|
|
152
|
-
@http.
|
|
152
|
+
@http.post_resource(
|
|
153
153
|
"/payment_methods/update",
|
|
154
|
-
Inttegro::
|
|
154
|
+
Inttegro::PaymentMethod, :payment_method,
|
|
155
155
|
payload
|
|
156
156
|
)
|
|
157
157
|
end
|
|
158
158
|
|
|
159
159
|
def activate(payment_method_id:)
|
|
160
|
-
@http.
|
|
160
|
+
@http.post_resource(
|
|
161
161
|
"/payment_methods/activate",
|
|
162
|
-
Inttegro::
|
|
162
|
+
Inttegro::PaymentMethod, :payment_method,
|
|
163
163
|
{ payment_method_id: payment_method_id }
|
|
164
164
|
)
|
|
165
165
|
end
|
|
166
166
|
|
|
167
167
|
def disactivate(payment_method_id:)
|
|
168
|
-
@http.
|
|
168
|
+
@http.post_resource(
|
|
169
169
|
"/payment_methods/disactivate",
|
|
170
|
-
Inttegro::
|
|
170
|
+
Inttegro::PaymentMethod, :payment_method,
|
|
171
171
|
{ payment_method_id: payment_method_id }
|
|
172
172
|
)
|
|
173
173
|
end
|
|
@@ -175,17 +175,17 @@ module Inttegro
|
|
|
175
175
|
alias deactivate disactivate
|
|
176
176
|
|
|
177
177
|
def archive(payment_method_id:)
|
|
178
|
-
@http.
|
|
178
|
+
@http.post_resource(
|
|
179
179
|
"/payment_methods/archive",
|
|
180
|
-
Inttegro::
|
|
180
|
+
Inttegro::PaymentMethod, :payment_method,
|
|
181
181
|
{ payment_method_id: payment_method_id }
|
|
182
182
|
)
|
|
183
183
|
end
|
|
184
184
|
|
|
185
185
|
def unarchive(payment_method_id:)
|
|
186
|
-
@http.
|
|
186
|
+
@http.post_resource(
|
|
187
187
|
"/payment_methods/unarchive",
|
|
188
|
-
Inttegro::
|
|
188
|
+
Inttegro::PaymentMethod, :payment_method,
|
|
189
189
|
{ payment_method_id: payment_method_id }
|
|
190
190
|
)
|
|
191
191
|
end
|
|
@@ -198,7 +198,7 @@ module Inttegro
|
|
|
198
198
|
# @param payment_method_id [String] ID of the payment method to delete (required)
|
|
199
199
|
# @param request_meta [Hash, nil] Request controls such as idempotency_key (optional)
|
|
200
200
|
#
|
|
201
|
-
# @return [Inttegro::
|
|
201
|
+
# @return [Inttegro::PaymentMethodDeletion] Deletion confirmation
|
|
202
202
|
#
|
|
203
203
|
# @example Delete a payment method
|
|
204
204
|
# result = client.payment_methods.delete(
|
|
@@ -209,9 +209,7 @@ module Inttegro
|
|
|
209
209
|
#
|
|
210
210
|
# @see https://studio.inttegro.com/payment-methods for API reference
|
|
211
211
|
def delete(payment_method_id:, request_meta: nil)
|
|
212
|
-
@http.post_model(
|
|
213
|
-
"/payment_methods/delete",
|
|
214
|
-
Inttegro::PaymentMethodDeleteResponse,
|
|
212
|
+
@http.post_model("/payment_methods/delete", Inttegro::PaymentMethodDeletion,
|
|
215
213
|
{
|
|
216
214
|
payment_method_id: payment_method_id,
|
|
217
215
|
request_meta: request_meta || stable_payment_method_request_meta("delete", payment_method_id)
|
|
@@ -224,18 +222,18 @@ module Inttegro
|
|
|
224
222
|
# Returns settings that control payment method behavior, including whether verification
|
|
225
223
|
# is required before charging and supported payment method types.
|
|
226
224
|
#
|
|
227
|
-
# @return [Inttegro::
|
|
225
|
+
# @return [Inttegro::PaymentMethodSettings] Payment method settings
|
|
228
226
|
#
|
|
229
227
|
# @example Get payment method settings
|
|
230
228
|
# result = client.payment_methods.settings
|
|
231
229
|
#
|
|
232
|
-
# puts "Mobile money enabled: #{result.
|
|
230
|
+
# puts "Mobile money enabled: #{result.mobile_money&.enabled}"
|
|
233
231
|
#
|
|
234
232
|
# @see https://studio.inttegro.com/payment-methods for API reference
|
|
235
233
|
def settings
|
|
236
|
-
@http.
|
|
234
|
+
@http.post_resource(
|
|
237
235
|
"/payment_methods/settings",
|
|
238
|
-
Inttegro::
|
|
236
|
+
Inttegro::PaymentMethodSettings, :settings,
|
|
239
237
|
{}
|
|
240
238
|
)
|
|
241
239
|
end
|
|
@@ -23,7 +23,7 @@ module Inttegro
|
|
|
23
23
|
#
|
|
24
24
|
# @param destinations [Hash] Map of currency codes to financial account IDs (required)
|
|
25
25
|
#
|
|
26
|
-
# @return [Inttegro::
|
|
26
|
+
# @return [Inttegro::PayoutSettingsMutation] Updated payout settings
|
|
27
27
|
#
|
|
28
28
|
# @example Set payout destinations for multiple currencies
|
|
29
29
|
# result = client.payouts.set_destinations(
|
|
@@ -33,13 +33,13 @@ module Inttegro
|
|
|
33
33
|
# }
|
|
34
34
|
# )
|
|
35
35
|
#
|
|
36
|
-
# puts "Destinations configured: #{result.
|
|
36
|
+
# puts "Destinations configured: #{result.destinations}"
|
|
37
37
|
#
|
|
38
38
|
# @see https://studio.inttegro.com/enable-automatic-payouts for configuration guide
|
|
39
39
|
def set_destinations(destinations:)
|
|
40
|
-
@http.
|
|
40
|
+
@http.post_resource(
|
|
41
41
|
"/payouts/set_destinations",
|
|
42
|
-
Inttegro::
|
|
42
|
+
Inttegro::PayoutSettingsMutation, :settings,
|
|
43
43
|
{ destinations: destinations }
|
|
44
44
|
)
|
|
45
45
|
end
|
|
@@ -49,16 +49,16 @@ module Inttegro
|
|
|
49
49
|
# Returns payout settings including configured payout destinations, schedule information,
|
|
50
50
|
# and whether foreign exchange is enabled.
|
|
51
51
|
#
|
|
52
|
-
# @return [Inttegro::
|
|
52
|
+
# @return [Inttegro::PayoutSettingsLookup] Current payout settings
|
|
53
53
|
#
|
|
54
54
|
# @example Get payout settings
|
|
55
55
|
# result = client.payouts.settings
|
|
56
56
|
#
|
|
57
|
-
# puts "Payout schedule: #{result.
|
|
57
|
+
# puts "Payout schedule: #{result.schedule&.name}"
|
|
58
58
|
#
|
|
59
59
|
# @see https://studio.inttegro.com/product-payouts for payouts overview
|
|
60
60
|
def settings
|
|
61
|
-
@http.
|
|
61
|
+
@http.post_resource("/payouts/settings", Inttegro::PayoutSettingsLookup, :settings, {})
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
# Disable automatic payouts by switching to manual payout mode.
|
|
@@ -68,26 +68,26 @@ module Inttegro
|
|
|
68
68
|
# still be at least 7 days old before they can be paid out, but the payout will only occur when you
|
|
69
69
|
# explicitly request it.
|
|
70
70
|
#
|
|
71
|
-
# @return [Inttegro::
|
|
71
|
+
# @return [Inttegro::PayoutSettingsMutation] Updated payout settings
|
|
72
72
|
#
|
|
73
73
|
# @example Disable automatic payouts
|
|
74
74
|
# result = client.payouts.disable_automatic
|
|
75
75
|
#
|
|
76
|
-
# puts "Schedule type: #{result.
|
|
76
|
+
# puts "Schedule type: #{result.schedule&.type}"
|
|
77
77
|
#
|
|
78
78
|
# @see https://studio.inttegro.com/disable-automatic-payouts for manual payout guide
|
|
79
79
|
def disable_automatic
|
|
80
|
-
@http.
|
|
80
|
+
@http.post_resource(
|
|
81
81
|
"/payouts/disable",
|
|
82
|
-
Inttegro::
|
|
82
|
+
Inttegro::PayoutSettingsMutation, :settings,
|
|
83
83
|
{}
|
|
84
84
|
)
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
def enable_automatic
|
|
88
|
-
@http.
|
|
88
|
+
@http.post_resource(
|
|
89
89
|
"/payouts/enable",
|
|
90
|
-
Inttegro::
|
|
90
|
+
Inttegro::PayoutSettingsMutation, :settings,
|
|
91
91
|
{}
|
|
92
92
|
)
|
|
93
93
|
end
|
|
@@ -106,16 +106,16 @@ module Inttegro
|
|
|
106
106
|
# Important: FX conversion incurs additional fees beyond standard payout fees, and exchange rates are
|
|
107
107
|
# determined at payout execution time. FX-enabled payouts require approval and special configuration.
|
|
108
108
|
#
|
|
109
|
-
# @return [Inttegro::
|
|
109
|
+
# @return [Inttegro::PayoutSettingsLookup] Updated payout settings
|
|
110
110
|
#
|
|
111
111
|
# @example Enable foreign exchange for payouts
|
|
112
112
|
# result = client.payouts.enable_fx
|
|
113
113
|
#
|
|
114
|
-
# puts "FX enabled: #{result.
|
|
114
|
+
# puts "FX enabled: #{result.fx_enabled}"
|
|
115
115
|
#
|
|
116
116
|
# @see https://studio.inttegro.com/enable-fx-payouts for FX payout guide
|
|
117
117
|
def enable_fx
|
|
118
|
-
@http.
|
|
118
|
+
@http.post_resource("/payouts/enable_fx", Inttegro::PayoutSettingsLookup, :settings, {})
|
|
119
119
|
end
|
|
120
120
|
|
|
121
121
|
# Disable foreign exchange conversion for payouts.
|
|
@@ -123,16 +123,16 @@ module Inttegro
|
|
|
123
123
|
# Disables FX conversion, restricting payouts to accounts that match the transaction currency.
|
|
124
124
|
# After disabling FX, GHS balance can only be paid out to GHS accounts, USD balance only to USD accounts, etc.
|
|
125
125
|
#
|
|
126
|
-
# @return [Inttegro::
|
|
126
|
+
# @return [Inttegro::PayoutSettingsLookup] Updated payout settings
|
|
127
127
|
#
|
|
128
128
|
# @example Disable foreign exchange for payouts
|
|
129
129
|
# result = client.payouts.disable_fx
|
|
130
130
|
#
|
|
131
|
-
# puts "FX enabled: #{result.
|
|
131
|
+
# puts "FX enabled: #{result.fx_enabled}"
|
|
132
132
|
#
|
|
133
133
|
# @see https://studio.inttegro.com/disable-fx-payouts for FX payout guide
|
|
134
134
|
def disable_fx
|
|
135
|
-
@http.
|
|
135
|
+
@http.post_resource("/payouts/disable_fx", Inttegro::PayoutSettingsLookup, :settings, {})
|
|
136
136
|
end
|
|
137
137
|
|
|
138
138
|
# Retrieve a paginated list of payouts.
|
|
@@ -147,7 +147,7 @@ module Inttegro
|
|
|
147
147
|
# @option payload [String] :created_after Filter payouts created after this timestamp (ISO 8601)
|
|
148
148
|
# @option payload [String] :created_before Filter payouts created before this timestamp (ISO 8601)
|
|
149
149
|
#
|
|
150
|
-
# @return [Inttegro::
|
|
150
|
+
# @return [Inttegro::PayoutPage] Paginated list of payouts
|
|
151
151
|
#
|
|
152
152
|
# @example Get first page of payouts
|
|
153
153
|
# result = client.payouts.page(
|
|
@@ -155,7 +155,7 @@ module Inttegro
|
|
|
155
155
|
# page: 1
|
|
156
156
|
# )
|
|
157
157
|
#
|
|
158
|
-
# puts "Retrieved #{result.
|
|
158
|
+
# puts "Retrieved #{result.payouts&.length || 0} payouts"
|
|
159
159
|
#
|
|
160
160
|
# @example Filter by status
|
|
161
161
|
# paid_payouts = client.payouts.page(
|
|
@@ -166,17 +166,17 @@ module Inttegro
|
|
|
166
166
|
# @see https://studio.inttegro.com/pagination for pagination guide
|
|
167
167
|
# @see https://studio.inttegro.com/product-payouts for payouts overview
|
|
168
168
|
def page(payload = {})
|
|
169
|
-
@http.
|
|
169
|
+
@http.post_resource("/payouts/page", Inttegro::PayoutPage, :page, payload || {})
|
|
170
170
|
end
|
|
171
171
|
|
|
172
172
|
def schedule(payload)
|
|
173
|
-
@http.
|
|
173
|
+
@http.post_resource("/payouts/schedule", Inttegro::Payout, :payout, payload)
|
|
174
174
|
end
|
|
175
175
|
|
|
176
176
|
def lookup(payout_id:)
|
|
177
|
-
@http.
|
|
177
|
+
@http.post_resource(
|
|
178
178
|
"/payouts/lookup",
|
|
179
|
-
Inttegro::
|
|
179
|
+
Inttegro::Payout, :payout,
|
|
180
180
|
{ payout_id: payout_id }
|
|
181
181
|
)
|
|
182
182
|
end
|
|
@@ -187,11 +187,11 @@ module Inttegro
|
|
|
187
187
|
#
|
|
188
188
|
# @param payout_id [String] Scheduled payout ID
|
|
189
189
|
#
|
|
190
|
-
# @return [Inttegro::
|
|
190
|
+
# @return [Inttegro::Payout] Canceled payout
|
|
191
191
|
def cancel(payout_id:)
|
|
192
|
-
@http.
|
|
192
|
+
@http.post_resource(
|
|
193
193
|
"/payouts/cancel",
|
|
194
|
-
Inttegro::
|
|
194
|
+
Inttegro::Payout, :payout,
|
|
195
195
|
{ payout_id: payout_id }
|
|
196
196
|
)
|
|
197
197
|
end
|
|
@@ -9,31 +9,31 @@ module Inttegro
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def create(payload)
|
|
12
|
-
@http.
|
|
12
|
+
@http.post_resource("/prices/create", Inttegro::Price, :price, payload)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def lookup(price_id:)
|
|
16
|
-
@http.
|
|
16
|
+
@http.post_resource("/prices/lookup", Inttegro::Price, :price, { price_id: price_id })
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def page(payload = {})
|
|
20
|
-
@http.
|
|
20
|
+
@http.post_resource("/prices/page", Inttegro::PricePage, :page, payload || {})
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def update(payload)
|
|
24
|
-
@http.
|
|
24
|
+
@http.post_resource("/prices/update", Inttegro::Price, :price, payload)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def activate(price_id:)
|
|
28
|
-
@http.
|
|
28
|
+
@http.post_resource("/prices/activate", Inttegro::Price, :price, { price_id: price_id })
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def deactivate(price_id:)
|
|
32
|
-
@http.
|
|
32
|
+
@http.post_resource("/prices/deactivate", Inttegro::Price, :price, { price_id: price_id })
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def archive(price_id:)
|
|
36
|
-
@http.
|
|
36
|
+
@http.post_resource("/prices/archive", Inttegro::Price, :price, { price_id: price_id })
|
|
37
37
|
end
|
|
38
38
|
end
|
|
39
39
|
end
|
|
@@ -9,39 +9,39 @@ module Inttegro
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def create(payload)
|
|
12
|
-
@http.
|
|
12
|
+
@http.post_resource("/products/create", Inttegro::Product, :product, payload)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def add_price(payload)
|
|
16
|
-
@http.
|
|
16
|
+
@http.post_resource("/products/add_price", Inttegro::ProductPriceNominal, :price, payload)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def set_default_unit_price(payload)
|
|
20
|
-
@http.
|
|
20
|
+
@http.post_resource("/products/set_default_unit_price", Inttegro::Product, :product, payload)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def lookup(product_id:)
|
|
24
|
-
@http.
|
|
24
|
+
@http.post_resource("/products/lookup", Inttegro::Product, :product, { product_id: product_id })
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def update(payload)
|
|
28
|
-
@http.
|
|
28
|
+
@http.post_resource("/products/update", Inttegro::UpdatedProduct, :product, payload)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def publish(product_id:)
|
|
32
|
-
@http.
|
|
32
|
+
@http.post_resource("/products/publish", Inttegro::Product, :product, { product_id: product_id })
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def unpublish(product_id:)
|
|
36
|
-
@http.
|
|
36
|
+
@http.post_resource("/products/unpublish", Inttegro::Product, :product, { product_id: product_id })
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def archive(product_id:)
|
|
40
|
-
@http.
|
|
40
|
+
@http.post_resource("/products/archive", Inttegro::Product, :product, { product_id: product_id })
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
def page(payload = {})
|
|
44
|
-
@http.
|
|
44
|
+
@http.post_resource("/products/page", Inttegro::ProductPage, :page, payload || {})
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
end
|
|
@@ -9,33 +9,33 @@ module Inttegro
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def create(payload)
|
|
12
|
-
@http.
|
|
12
|
+
@http.post_resource("/purchase_intents/create", Inttegro::PurchaseIntent, :purchase_intent, payload)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def update(payload)
|
|
16
|
-
@http.
|
|
16
|
+
@http.post_resource("/purchase_intents/update", Inttegro::PurchaseIntent, :purchase_intent, payload)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def cancel(id:)
|
|
20
|
-
@http.
|
|
20
|
+
@http.post_resource(
|
|
21
21
|
"/purchase_intents/cancel",
|
|
22
|
-
Inttegro::
|
|
22
|
+
Inttegro::PurchaseIntent, :purchase_intent,
|
|
23
23
|
{ id: id }
|
|
24
24
|
)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def lookup(id:)
|
|
28
|
-
@http.
|
|
28
|
+
@http.post_resource(
|
|
29
29
|
"/purchase_intents/lookup",
|
|
30
|
-
Inttegro::
|
|
30
|
+
Inttegro::PurchaseIntent, :purchase_intent,
|
|
31
31
|
{ id: id }
|
|
32
32
|
)
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def page(payload = {})
|
|
36
|
-
@http.
|
|
36
|
+
@http.post_resource(
|
|
37
37
|
"/purchase_intents/page",
|
|
38
|
-
Inttegro::
|
|
38
|
+
Inttegro::PurchaseIntentPage, :page,
|
|
39
39
|
payload || {}
|
|
40
40
|
)
|
|
41
41
|
end
|