inttegro 1.0.0 → 2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Dockerfile +1 -1
- data/README.md +9 -7
- data/SECURITY.md +11 -0
- data/lib/inttegro/enums.rb +2 -2
- data/lib/inttegro/generated/enums.rb +220 -328
- data/lib/inttegro/generated/models.rb +3705 -3830
- data/lib/inttegro/generated/operations.rb +230 -230
- data/lib/inttegro/http_client.rb +7 -4
- data/lib/inttegro/models.rb +101 -104
- data/lib/inttegro/resources/apps.rb +3 -3
- data/lib/inttegro/resources/balance_transactions.rb +2 -2
- data/lib/inttegro/resources/balances.rb +1 -1
- data/lib/inttegro/resources/broadcasts.rb +2 -2
- data/lib/inttegro/resources/chimes.rb +5 -5
- data/lib/inttegro/resources/customers.rb +4 -4
- data/lib/inttegro/resources/file_links.rb +4 -4
- data/lib/inttegro/resources/file_references.rb +1 -1
- data/lib/inttegro/resources/files.rb +4 -4
- data/lib/inttegro/resources/financial_accounts.rb +11 -11
- data/lib/inttegro/resources/keys.rb +6 -6
- data/lib/inttegro/resources/message_templates.rb +7 -7
- data/lib/inttegro/resources/orders.rb +72 -69
- data/lib/inttegro/resources/otp.rb +4 -4
- data/lib/inttegro/resources/payment_methods.rb +18 -18
- data/lib/inttegro/resources/payouts.rb +17 -17
- data/lib/inttegro/resources/prices.rb +7 -7
- data/lib/inttegro/resources/products.rb +9 -9
- data/lib/inttegro/resources/purchase_intents.rb +5 -5
- data/lib/inttegro/resources/refunds.rb +4 -4
- data/lib/inttegro/resources/schedules.rb +2 -2
- data/lib/inttegro/resources/spec.rb +1 -1
- data/lib/inttegro/resources/upload_requests.rb +6 -6
- data/lib/inttegro/response_object.rb +1 -1
- data/lib/inttegro/version.rb +1 -1
- data/rbi/inttegro/generated.rbi +124 -124
- metadata +3 -2
|
@@ -38,10 +38,10 @@ module Inttegro
|
|
|
38
38
|
# @option payload [String] :statement_descriptor_prefix Static prefix, 2-10 characters, used to build prefix*order_id; mutually exclusive with statement_descriptor
|
|
39
39
|
# @option payload [Boolean] :finalize Whether to explicitly finalize order (default: false)
|
|
40
40
|
#
|
|
41
|
-
# @return [Inttegro::
|
|
41
|
+
# @return [Inttegro::Order] Created order
|
|
42
42
|
#
|
|
43
43
|
# @example Create order with new customer and execute payment
|
|
44
|
-
#
|
|
44
|
+
# order = client.orders.create(
|
|
45
45
|
# request_meta: {
|
|
46
46
|
# idempotency_key: 'order_2025_001'
|
|
47
47
|
# },
|
|
@@ -77,7 +77,7 @@ module Inttegro
|
|
|
77
77
|
# }
|
|
78
78
|
# )
|
|
79
79
|
#
|
|
80
|
-
# puts "Created order: #{
|
|
80
|
+
# puts "Created order: #{order.id}"
|
|
81
81
|
#
|
|
82
82
|
# @example Create order with existing customer
|
|
83
83
|
# result = client.orders.create(
|
|
@@ -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.post_model("/orders/create", Inttegro::
|
|
103
|
+
@http.post_model("/orders/create", Inttegro::OrderEnvelope, payload).order
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
def new(payload)
|
|
107
|
-
@http.post_model("/orders/new", Inttegro::
|
|
107
|
+
@http.post_model("/orders/new", Inttegro::OrderEnvelope, payload).order
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
# Retrieve an existing order by its ID.
|
|
@@ -115,23 +115,23 @@ module Inttegro
|
|
|
115
115
|
# @param order_id [String] Unique identifier of the order to retrieve (required)
|
|
116
116
|
# @param options [Hash] Additional options (currently unused)
|
|
117
117
|
#
|
|
118
|
-
# @return [Inttegro::
|
|
118
|
+
# @return [Inttegro::Order] Complete order object
|
|
119
119
|
#
|
|
120
120
|
# @example Lookup an order
|
|
121
|
-
#
|
|
121
|
+
# order = client.orders.lookup(
|
|
122
122
|
# order_id: 'GKj7A8lM5wEGRUvbqpI4bkDFsQvpqVyh5fqePNnb'
|
|
123
123
|
# )
|
|
124
124
|
#
|
|
125
|
-
# puts "Order status: #{
|
|
125
|
+
# puts "Order status: #{order.status.serialize}"
|
|
126
126
|
#
|
|
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.post_model("/orders/lookup", Inttegro::
|
|
130
|
+
@http.post_model("/orders/lookup", Inttegro::OrderEnvelope, body).order
|
|
131
131
|
end
|
|
132
132
|
|
|
133
133
|
def update(payload)
|
|
134
|
-
@http.post_model("/orders/update", Inttegro::
|
|
134
|
+
@http.post_model("/orders/update", Inttegro::OrderEnvelope, payload).order
|
|
135
135
|
end
|
|
136
136
|
|
|
137
137
|
# Initiate payment for an existing order.
|
|
@@ -141,7 +141,7 @@ module Inttegro
|
|
|
141
141
|
# 2. New payment method: Include payment_method_data with inline payment details
|
|
142
142
|
# 3. Offline payment: Set paid_out_of_band to true for cash, bank transfer, or check payments
|
|
143
143
|
#
|
|
144
|
-
# When payment requires customer confirmation (e.g., OTP), the
|
|
144
|
+
# When payment requires customer confirmation (e.g., OTP), the returned order includes a next_action field.
|
|
145
145
|
#
|
|
146
146
|
# @param payload [Hash] Payment parameters
|
|
147
147
|
# @option payload [String] :order_id Unique identifier of the order to pay (required)
|
|
@@ -149,10 +149,10 @@ module Inttegro
|
|
|
149
149
|
# @option payload [String] :payment_method_id ID of a saved payment method to use
|
|
150
150
|
# @option payload [Boolean] :paid_out_of_band Set to true if payment received outside Inttegro (default: false)
|
|
151
151
|
#
|
|
152
|
-
# @return [Inttegro::
|
|
152
|
+
# @return [Inttegro::Order] Updated order and payment state
|
|
153
153
|
#
|
|
154
154
|
# @example Pay with inline mobile money
|
|
155
|
-
#
|
|
155
|
+
# order = client.orders.pay(
|
|
156
156
|
# order_id: 'GKj7A8lM5wEGRUvbqpI4bkDFsQvpqVyh5fqePNnb',
|
|
157
157
|
# payment_method_data: {
|
|
158
158
|
# type: 'mobile_money',
|
|
@@ -163,8 +163,7 @@ module Inttegro
|
|
|
163
163
|
# }
|
|
164
164
|
# )
|
|
165
165
|
#
|
|
166
|
-
# order
|
|
167
|
-
# if order.payment&.next_action&.type == Inttegro::Enums::PaymentNextActionType::CONFIRM_PAYMENT
|
|
166
|
+
# if order.payment&.next_action&.type == Inttegro::PaymentNextActionType::CONFIRM_PAYMENT
|
|
168
167
|
# # Customer needs to provide OTP sent to their phone
|
|
169
168
|
# puts 'Please enter the OTP sent to your phone'
|
|
170
169
|
# end
|
|
@@ -184,7 +183,7 @@ module Inttegro
|
|
|
184
183
|
# @see https://studio.inttegro.com/accept-a-payment for payment flow guide
|
|
185
184
|
# @see https://studio.inttegro.com/charge-repeat-customers for saved payment methods
|
|
186
185
|
def pay(payload)
|
|
187
|
-
@http.post_model("/orders/pay", Inttegro::
|
|
186
|
+
@http.post_model("/orders/pay", Inttegro::OrderEnvelope, payload).order
|
|
188
187
|
end
|
|
189
188
|
|
|
190
189
|
# Confirm a pending payment using a verification token (e.g., OTP sent to customer's phone).
|
|
@@ -196,22 +195,21 @@ module Inttegro
|
|
|
196
195
|
# @option payload [String] :order_id Unique identifier of the order being paid (required)
|
|
197
196
|
# @option payload [String] :token Verification token provided by customer (required, typically 6 digits)
|
|
198
197
|
#
|
|
199
|
-
# @return [Inttegro::
|
|
198
|
+
# @return [Inttegro::Order] Updated order with payment status
|
|
200
199
|
#
|
|
201
200
|
# @example Confirm payment with OTP
|
|
202
|
-
#
|
|
201
|
+
# order = client.orders.confirm_payment(
|
|
203
202
|
# order_id: 'GKj7A8lM5wEGRUvbqpI4bkDFsQvpqVyh5fqePNnb',
|
|
204
203
|
# token: '123456'
|
|
205
204
|
# )
|
|
206
205
|
#
|
|
207
|
-
# order
|
|
208
|
-
# if order.payment&.status == Inttegro::Enums::OrderPaymentStatus::PAID
|
|
206
|
+
# if order.payment&.status == Inttegro::OrderPaymentStatus::PAID
|
|
209
207
|
# puts 'Payment confirmed successfully!'
|
|
210
208
|
# end
|
|
211
209
|
#
|
|
212
210
|
# @see https://studio.inttegro.com/accept-a-payment for complete payment flow
|
|
213
211
|
def confirm_payment(payload)
|
|
214
|
-
@http.post_model("/orders/confirm_payment", Inttegro::
|
|
212
|
+
@http.post_model("/orders/confirm_payment", Inttegro::OrderEnvelope, payload).order
|
|
215
213
|
end
|
|
216
214
|
|
|
217
215
|
# Request a new confirmation token to be sent to the customer (e.g., resend OTP).
|
|
@@ -222,7 +220,7 @@ module Inttegro
|
|
|
222
220
|
# @param order_id [String] Unique identifier of the order requiring confirmation (required)
|
|
223
221
|
# @param request_meta [Hash, nil] Request controls such as idempotency_key (optional)
|
|
224
222
|
#
|
|
225
|
-
# @return [Inttegro::
|
|
223
|
+
# @return [Inttegro::Order] Updated order
|
|
226
224
|
#
|
|
227
225
|
# @example Resend OTP to customer
|
|
228
226
|
# result = client.orders.request_confirmation(
|
|
@@ -235,12 +233,12 @@ module Inttegro
|
|
|
235
233
|
def request_confirmation(order_id:, request_meta: nil)
|
|
236
234
|
@http.post_model(
|
|
237
235
|
"/orders/request_confirmation",
|
|
238
|
-
Inttegro::
|
|
236
|
+
Inttegro::OrderEnvelope,
|
|
239
237
|
{
|
|
240
238
|
order_id: order_id,
|
|
241
239
|
request_meta: request_meta || stable_order_request_meta("request_confirmation", order_id)
|
|
242
240
|
}
|
|
243
|
-
)
|
|
241
|
+
).order
|
|
244
242
|
end
|
|
245
243
|
|
|
246
244
|
# Finalize an order to make it immutable and ready for payment or fulfillment.
|
|
@@ -251,36 +249,37 @@ module Inttegro
|
|
|
251
249
|
# @param order_id [String] Unique identifier of the order to finalize (required)
|
|
252
250
|
# @param request_meta [Hash, nil] Request controls such as idempotency_key (optional)
|
|
253
251
|
#
|
|
254
|
-
# @return [Inttegro::
|
|
252
|
+
# @return [Inttegro::Order] Finalized order object
|
|
255
253
|
#
|
|
256
254
|
# @example Finalize an order
|
|
257
|
-
#
|
|
255
|
+
# order = client.orders.finalize(
|
|
258
256
|
# order_id: 'GKj7A8lM5wEGRUvbqpI4bkDFsQvpqVyh5fqePNnb'
|
|
259
257
|
# )
|
|
260
258
|
#
|
|
261
|
-
# puts "Order finalized at: #{
|
|
259
|
+
# puts "Order finalized at: #{order.sealed_at}"
|
|
262
260
|
#
|
|
263
261
|
# @see https://studio.inttegro.com/order-lifecycle for order states
|
|
264
262
|
def finalize(order_id:, request_meta: nil)
|
|
265
|
-
@http.post_model(
|
|
263
|
+
response = @http.post_model(
|
|
266
264
|
"/orders/finalize",
|
|
267
|
-
Inttegro::
|
|
265
|
+
Inttegro::FinalizeOrderEnvelope,
|
|
268
266
|
{
|
|
269
267
|
order_id: order_id,
|
|
270
268
|
request_meta: request_meta || stable_order_request_meta("finalize", order_id)
|
|
271
269
|
}
|
|
272
270
|
)
|
|
271
|
+
T.must(response.order)
|
|
273
272
|
end
|
|
274
273
|
|
|
275
274
|
# Send the hosted invoice link for an existing order.
|
|
276
275
|
#
|
|
277
276
|
# @param order_id [String] Unique identifier of the order whose invoice should be sent (required)
|
|
278
277
|
#
|
|
279
|
-
# @return [Inttegro::
|
|
278
|
+
# @return [Inttegro::OrderDocumentDeliveryResult] Order and delivery details
|
|
280
279
|
def send_invoice(order_id:)
|
|
281
280
|
@http.post_model(
|
|
282
281
|
"/orders/send_invoice",
|
|
283
|
-
Inttegro::
|
|
282
|
+
Inttegro::OrderDocumentDeliveryResult,
|
|
284
283
|
{ order_id: order_id }
|
|
285
284
|
)
|
|
286
285
|
end
|
|
@@ -289,11 +288,11 @@ module Inttegro
|
|
|
289
288
|
#
|
|
290
289
|
# @param order_id [String] Unique identifier of the paid order whose receipt should be sent (required)
|
|
291
290
|
#
|
|
292
|
-
# @return [Inttegro::
|
|
291
|
+
# @return [Inttegro::OrderDocumentDeliveryResult] Order and delivery details
|
|
293
292
|
def send_receipt(order_id:)
|
|
294
293
|
@http.post_model(
|
|
295
294
|
"/orders/send_receipt",
|
|
296
|
-
Inttegro::
|
|
295
|
+
Inttegro::OrderDocumentDeliveryResult,
|
|
297
296
|
{ order_id: order_id }
|
|
298
297
|
)
|
|
299
298
|
end
|
|
@@ -308,14 +307,14 @@ module Inttegro
|
|
|
308
307
|
# @option payload [String] :order_id Unique identifier of the order to complete (required)
|
|
309
308
|
# @option payload [Boolean] :paid_out_of_band Set to true if payment received outside Inttegro (default: false)
|
|
310
309
|
#
|
|
311
|
-
# @return [Inttegro::
|
|
310
|
+
# @return [Inttegro::Order] Completed order object
|
|
312
311
|
#
|
|
313
312
|
# @example Complete order after fulfillment
|
|
314
|
-
#
|
|
313
|
+
# order = client.orders.complete(
|
|
315
314
|
# order_id: 'GKj7A8lM5wEGRUvbqpI4bkDFsQvpqVyh5fqePNnb'
|
|
316
315
|
# )
|
|
317
316
|
#
|
|
318
|
-
# puts "Order completed at: #{
|
|
317
|
+
# puts "Order completed at: #{order.completed_at}"
|
|
319
318
|
#
|
|
320
319
|
# @example Complete order with offline payment
|
|
321
320
|
# result = client.orders.complete(
|
|
@@ -325,7 +324,8 @@ module Inttegro
|
|
|
325
324
|
#
|
|
326
325
|
# @see https://studio.inttegro.com/order-lifecycle for order states
|
|
327
326
|
def complete(payload)
|
|
328
|
-
@http.post_model("/orders/complete", Inttegro::
|
|
327
|
+
response = @http.post_model("/orders/complete", Inttegro::CompleteOrderEnvelope, payload)
|
|
328
|
+
T.must(response.order)
|
|
329
329
|
end
|
|
330
330
|
|
|
331
331
|
# Cancel an order, stopping payment execution and preventing further processing.
|
|
@@ -336,80 +336,83 @@ module Inttegro
|
|
|
336
336
|
# @param order_id [String] Unique identifier of the order to cancel (required)
|
|
337
337
|
# @param request_meta [Hash, nil] Request controls such as idempotency_key (optional)
|
|
338
338
|
#
|
|
339
|
-
# @return [Inttegro::
|
|
339
|
+
# @return [Inttegro::Order] Cancelled order object
|
|
340
340
|
#
|
|
341
341
|
# @example Cancel an order
|
|
342
|
-
#
|
|
342
|
+
# order = client.orders.cancel(
|
|
343
343
|
# order_id: 'GKj7A8lM5wEGRUvbqpI4bkDFsQvpqVyh5fqePNnb'
|
|
344
344
|
# )
|
|
345
345
|
#
|
|
346
|
-
# puts "Order #{
|
|
346
|
+
# puts "Order #{order.id} has been cancelled"
|
|
347
347
|
#
|
|
348
348
|
# @see https://studio.inttegro.com/order-lifecycle for order states
|
|
349
349
|
def cancel(order_id:, request_meta: nil)
|
|
350
350
|
@http.post_model(
|
|
351
351
|
"/orders/cancel",
|
|
352
|
-
Inttegro::
|
|
352
|
+
Inttegro::OrderEnvelope,
|
|
353
353
|
{
|
|
354
354
|
order_id: order_id,
|
|
355
355
|
request_meta: request_meta || stable_order_request_meta("cancel", order_id)
|
|
356
356
|
}
|
|
357
|
-
)
|
|
357
|
+
).order
|
|
358
358
|
end
|
|
359
359
|
|
|
360
|
-
#
|
|
360
|
+
# Create a refund through the /orders/refund compatibility alias.
|
|
361
361
|
#
|
|
362
|
-
#
|
|
363
|
-
#
|
|
362
|
+
# This accepts the same line-item payload as client.refunds.create and returns
|
|
363
|
+
# the created Refund directly. New integrations should use that canonical method.
|
|
364
364
|
#
|
|
365
|
-
# @param
|
|
365
|
+
# @param payload [Hash] Create-refund payload containing order_id, reason, and line_items
|
|
366
366
|
#
|
|
367
|
-
# @return [Inttegro::
|
|
367
|
+
# @return [Inttegro::Refund] Created refund
|
|
368
368
|
#
|
|
369
369
|
# @example Refund an order
|
|
370
|
-
#
|
|
371
|
-
# order_id: '
|
|
370
|
+
# refund = client.orders.refund(
|
|
371
|
+
# order_id: 'or_0123456789abcdefghijklmnopqrstuvwxyzABCD',
|
|
372
|
+
# reason: 'requested_by_customer',
|
|
373
|
+
# line_items: [{
|
|
374
|
+
# order_line_item_id: 'oli_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN',
|
|
375
|
+
# refund_amount: { currency: 'ghs', value: 2500 }
|
|
376
|
+
# }]
|
|
372
377
|
# )
|
|
373
378
|
#
|
|
374
|
-
# puts "Refund created: #{
|
|
379
|
+
# puts "Refund created: #{refund.id}"
|
|
375
380
|
#
|
|
376
|
-
# @see https://studio.inttegro.com/
|
|
381
|
+
# @see https://studio.inttegro.com/refunds
|
|
377
382
|
def refund(payload)
|
|
378
|
-
@http.post_model("/orders/refund", Inttegro::
|
|
383
|
+
@http.post_model("/orders/refund", Inttegro::RefundResponse, payload).refund
|
|
379
384
|
end
|
|
380
385
|
|
|
381
386
|
# Retrieve a paginated list of orders.
|
|
382
387
|
#
|
|
383
|
-
# Returns orders in reverse chronological order (most recent first).
|
|
384
|
-
# and page parameter to navigate through results. Supports filtering by status and time range.
|
|
388
|
+
# Returns orders in reverse chronological order (most recent first).
|
|
385
389
|
#
|
|
386
390
|
# @param payload [Hash] Pagination and filter parameters (optional)
|
|
387
|
-
# @option payload [Integer] :page
|
|
388
|
-
# @option payload [Integer] :
|
|
389
|
-
# @option payload [String] :
|
|
390
|
-
# @option payload [String] :created_after Filter orders created after this timestamp (ISO 8601)
|
|
391
|
-
# @option payload [String] :created_before Filter orders created before this timestamp (ISO 8601)
|
|
391
|
+
# @option payload [Integer] :page_number Zero-based page index to retrieve (0-10)
|
|
392
|
+
# @option payload [Integer] :page_size Number of orders per page (1-256)
|
|
393
|
+
# @option payload [String] :customer_id Optional customer whose orders should be returned
|
|
392
394
|
#
|
|
393
|
-
# @return [Inttegro::
|
|
395
|
+
# @return [Inttegro::OrderPage] Paginated list of orders
|
|
394
396
|
#
|
|
395
397
|
# @example Get first page of orders
|
|
396
|
-
#
|
|
397
|
-
#
|
|
398
|
-
#
|
|
398
|
+
# page = client.orders.page(
|
|
399
|
+
# page_size: 25,
|
|
400
|
+
# page_number: 0
|
|
399
401
|
# )
|
|
400
402
|
#
|
|
401
|
-
# puts "Retrieved #{
|
|
403
|
+
# puts "Retrieved #{page.orders&.length || 0} orders"
|
|
402
404
|
#
|
|
403
|
-
# @example
|
|
404
|
-
#
|
|
405
|
-
#
|
|
406
|
-
#
|
|
405
|
+
# @example Restrict the page to one customer
|
|
406
|
+
# customer_orders = client.orders.page(
|
|
407
|
+
# customer_id: 'cu_123',
|
|
408
|
+
# page_size: 50
|
|
407
409
|
# )
|
|
408
410
|
#
|
|
409
411
|
# @see https://studio.inttegro.com/pagination for pagination guide
|
|
410
412
|
# @see https://studio.inttegro.com/orders for API reference
|
|
411
413
|
def page(payload = {})
|
|
412
|
-
@http.post_model("/orders/page", Inttegro::
|
|
414
|
+
response = @http.post_model("/orders/page", Inttegro::PageOrdersEnvelope, payload || {})
|
|
415
|
+
T.must(response.page)
|
|
413
416
|
end
|
|
414
417
|
|
|
415
418
|
private
|
|
@@ -9,21 +9,21 @@ module Inttegro
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def initiate(payload)
|
|
12
|
-
@http.post_model("/otp/initiate", Inttegro::
|
|
12
|
+
@http.post_model("/otp/initiate", Inttegro::InitiateOTPResponse, 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::VerifyOTPResponse, payload)
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def lookup(payload)
|
|
22
|
-
@http.post_model("/otp/lookup", Inttegro::
|
|
22
|
+
@http.post_model("/otp/lookup", Inttegro::LookupOTPResponse, payload)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def cancel(payload)
|
|
26
|
-
@http.post_model("/otp/cancel", Inttegro::
|
|
26
|
+
@http.post_model("/otp/cancel", Inttegro::CancelOtpResponse, 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::TokenizePaymentMethodResponse] Tokenized payment method
|
|
33
33
|
#
|
|
34
34
|
# @example Tokenize a mobile money payment method
|
|
35
35
|
# result = client.payment_methods.tokenize(
|
|
@@ -50,7 +50,7 @@ module Inttegro
|
|
|
50
50
|
def tokenize(payload)
|
|
51
51
|
@http.post_model(
|
|
52
52
|
"/payment_methods/tokenize",
|
|
53
|
-
Inttegro::
|
|
53
|
+
Inttegro::TokenizePaymentMethodResponse,
|
|
54
54
|
payload
|
|
55
55
|
)
|
|
56
56
|
end
|
|
@@ -64,7 +64,7 @@ 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::PaymentMethodVerificationResponse] Verification details
|
|
68
68
|
#
|
|
69
69
|
# @example Verify a payment method
|
|
70
70
|
# result = client.payment_methods.verify(
|
|
@@ -77,7 +77,7 @@ module Inttegro
|
|
|
77
77
|
def verify(payment_method_id:, request_meta: nil)
|
|
78
78
|
@http.post_model(
|
|
79
79
|
"/payment_methods/verify",
|
|
80
|
-
Inttegro::
|
|
80
|
+
Inttegro::PaymentMethodVerificationResponse,
|
|
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::PaymentMethodResponse] Verified payment method
|
|
98
98
|
#
|
|
99
99
|
# @example Confirm verification with OTP
|
|
100
100
|
# result = client.payment_methods.confirm_verification(
|
|
@@ -110,7 +110,7 @@ module Inttegro
|
|
|
110
110
|
def confirm_verification(payload)
|
|
111
111
|
@http.post_model(
|
|
112
112
|
"/payment_methods/confirm_verification",
|
|
113
|
-
Inttegro::
|
|
113
|
+
Inttegro::LookupPaymentMethodResponse,
|
|
114
114
|
payload
|
|
115
115
|
)
|
|
116
116
|
end
|
|
@@ -122,7 +122,7 @@ 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::LookupPaymentMethodResponse] Payment method details
|
|
126
126
|
#
|
|
127
127
|
# @example Lookup a payment method
|
|
128
128
|
# result = client.payment_methods.lookup(
|
|
@@ -135,7 +135,7 @@ module Inttegro
|
|
|
135
135
|
def lookup(payment_method_id:)
|
|
136
136
|
@http.post_model(
|
|
137
137
|
"/payment_methods/lookup",
|
|
138
|
-
Inttegro::
|
|
138
|
+
Inttegro::LookupPaymentMethodResponse,
|
|
139
139
|
{ payment_method_id: payment_method_id }
|
|
140
140
|
)
|
|
141
141
|
end
|
|
@@ -143,7 +143,7 @@ module Inttegro
|
|
|
143
143
|
def page(payload = {})
|
|
144
144
|
@http.post_model(
|
|
145
145
|
"/payment_methods/page",
|
|
146
|
-
Inttegro::
|
|
146
|
+
Inttegro::PaymentMethodPageResponse,
|
|
147
147
|
payload || {}
|
|
148
148
|
)
|
|
149
149
|
end
|
|
@@ -151,7 +151,7 @@ module Inttegro
|
|
|
151
151
|
def update(payload)
|
|
152
152
|
@http.post_model(
|
|
153
153
|
"/payment_methods/update",
|
|
154
|
-
Inttegro::
|
|
154
|
+
Inttegro::UpdatePaymentMethodResponse,
|
|
155
155
|
payload
|
|
156
156
|
)
|
|
157
157
|
end
|
|
@@ -159,7 +159,7 @@ module Inttegro
|
|
|
159
159
|
def activate(payment_method_id:)
|
|
160
160
|
@http.post_model(
|
|
161
161
|
"/payment_methods/activate",
|
|
162
|
-
Inttegro::
|
|
162
|
+
Inttegro::ActivatePaymentMethodResponse,
|
|
163
163
|
{ payment_method_id: payment_method_id }
|
|
164
164
|
)
|
|
165
165
|
end
|
|
@@ -167,7 +167,7 @@ module Inttegro
|
|
|
167
167
|
def disactivate(payment_method_id:)
|
|
168
168
|
@http.post_model(
|
|
169
169
|
"/payment_methods/disactivate",
|
|
170
|
-
Inttegro::
|
|
170
|
+
Inttegro::DisactivatePaymentMethodResponse,
|
|
171
171
|
{ payment_method_id: payment_method_id }
|
|
172
172
|
)
|
|
173
173
|
end
|
|
@@ -177,7 +177,7 @@ module Inttegro
|
|
|
177
177
|
def archive(payment_method_id:)
|
|
178
178
|
@http.post_model(
|
|
179
179
|
"/payment_methods/archive",
|
|
180
|
-
Inttegro::
|
|
180
|
+
Inttegro::ArchivePaymentMethodResponse,
|
|
181
181
|
{ payment_method_id: payment_method_id }
|
|
182
182
|
)
|
|
183
183
|
end
|
|
@@ -185,7 +185,7 @@ module Inttegro
|
|
|
185
185
|
def unarchive(payment_method_id:)
|
|
186
186
|
@http.post_model(
|
|
187
187
|
"/payment_methods/unarchive",
|
|
188
|
-
Inttegro::
|
|
188
|
+
Inttegro::UnarchivePaymentMethodResponse,
|
|
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::PaymentMethodDeleteResponse] Deletion confirmation
|
|
202
202
|
#
|
|
203
203
|
# @example Delete a payment method
|
|
204
204
|
# result = client.payment_methods.delete(
|
|
@@ -211,7 +211,7 @@ module Inttegro
|
|
|
211
211
|
def delete(payment_method_id:, request_meta: nil)
|
|
212
212
|
@http.post_model(
|
|
213
213
|
"/payment_methods/delete",
|
|
214
|
-
Inttegro::
|
|
214
|
+
Inttegro::PaymentMethodDeleteResponse,
|
|
215
215
|
{
|
|
216
216
|
payment_method_id: payment_method_id,
|
|
217
217
|
request_meta: request_meta || stable_payment_method_request_meta("delete", payment_method_id)
|
|
@@ -224,7 +224,7 @@ module Inttegro
|
|
|
224
224
|
# Returns settings that control payment method behavior, including whether verification
|
|
225
225
|
# is required before charging and supported payment method types.
|
|
226
226
|
#
|
|
227
|
-
# @return [Inttegro::
|
|
227
|
+
# @return [Inttegro::GetPaymentMethodSettingsResponse] Payment method settings
|
|
228
228
|
#
|
|
229
229
|
# @example Get payment method settings
|
|
230
230
|
# result = client.payment_methods.settings
|
|
@@ -235,7 +235,7 @@ module Inttegro
|
|
|
235
235
|
def settings
|
|
236
236
|
@http.post_model(
|
|
237
237
|
"/payment_methods/settings",
|
|
238
|
-
Inttegro::
|
|
238
|
+
Inttegro::GetPaymentMethodSettingsResponse,
|
|
239
239
|
{}
|
|
240
240
|
)
|
|
241
241
|
end
|