jamm 1.6.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/Gemfile.lock +2 -4
- data/lib/jamm/api/api/payment_api.rb +272 -0
- data/lib/jamm/api/models/v1_async_status.rb +44 -0
- data/lib/jamm/api/models/v1_charge_result.rb +37 -4
- data/lib/jamm/api/models/v1_charge_status.rb +46 -0
- data/lib/jamm/api/models/v1_error_type.rb +16 -1
- data/lib/jamm/api/models/v1_event_type.rb +2 -2
- data/lib/jamm/api/models/v1_off_session_payment_async_request.rb +224 -0
- data/lib/jamm/api/models/v1_off_session_payment_async_response.rb +257 -0
- data/lib/jamm/api/models/v1_on_session_payment_data.rb +13 -4
- data/lib/jamm/api/models/v1_on_session_payment_error_code.rb +2 -1
- data/lib/jamm/api/models/v1_on_session_payment_request.rb +11 -1
- data/lib/jamm/api/models/v1_refund_request.rb +226 -0
- data/lib/jamm/api/models/v1_refund_response.rb +226 -0
- data/lib/jamm/api/models/{v1_get_major_banks_response.rb → v1_withdraw_async_request.rb} +17 -25
- data/lib/jamm/api/models/v1_withdraw_async_response.rb +257 -0
- data/lib/jamm/api/models/v1_withdraw_async_status_request.rb +215 -0
- data/lib/jamm/api/models/v1_withdraw_async_status_response.rb +257 -0
- data/lib/jamm/api.rb +10 -1
- data/lib/jamm/api_patches.rb +1 -1
- data/lib/jamm/client.rb +15 -1
- data/lib/jamm/customer.rb +17 -10
- data/lib/jamm/healthcheck.rb +3 -2
- data/lib/jamm/payment.rb +32 -10
- data/lib/jamm/version.rb +1 -1
- data/lib/jamm/webhook.rb +3 -2
- data/lib/jamm.rb +20 -7
- metadata +12 -5
- data/lib/jamm/charge.rb +0 -65
- data/lib/jamm/contract.rb +0 -39
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e3e4e58bcc8b6bba8c4f54b6102212fc8e8f220b7bf311ad6df4d3455636bdbe
|
|
4
|
+
data.tar.gz: e3b4f96bcc5fa1b8b58e941884e300980e2b34074ce91733d31476c94a89253f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a1ffa31922c27280624f72f00005f508f967b0efc8e1c3f1b369c77a4ab36cb40fd78ba23eed62c805b1722560c5e80a5a41e73675e021b9579e024368975ad
|
|
7
|
+
data.tar.gz: 90a9a314ced4d6c3179f2369b9c601f58a824e9dc106fb0a42ff272fe1c3d1bd7d67b858a7bbf1847a4909dd22891ace8829211f2d7b2e0b855d063cb647ea74
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
jamm (
|
|
4
|
+
jamm (2.0.0)
|
|
5
5
|
rest-client (~> 2.0)
|
|
6
6
|
typhoeus (~> 1.0, >= 1.0.1)
|
|
7
7
|
|
|
@@ -22,9 +22,7 @@ GEM
|
|
|
22
22
|
ffi (>= 1.15.0)
|
|
23
23
|
faker (3.5.1)
|
|
24
24
|
i18n (>= 1.8.11, < 2)
|
|
25
|
-
ffi (1.17.0
|
|
26
|
-
ffi (1.17.0-arm64-darwin)
|
|
27
|
-
ffi (1.17.0-x86_64-linux-gnu)
|
|
25
|
+
ffi (1.17.0)
|
|
28
26
|
gimei (1.5.0)
|
|
29
27
|
hashdiff (1.1.0)
|
|
30
28
|
http-accept (1.7.0)
|
|
@@ -355,6 +355,142 @@ module Api
|
|
|
355
355
|
return data, status_code, headers
|
|
356
356
|
end
|
|
357
357
|
|
|
358
|
+
# Initiate async withdraw (internal)
|
|
359
|
+
# Internal-only endpoint for initiating asynchronous withdrawal processing.
|
|
360
|
+
# @param body [WithdrawAsyncRequest] This message represents a request to withdraw money from a customer asynchronously. It contains the customer ID and the amount to withdraw.
|
|
361
|
+
# @param [Hash] opts the optional parameters
|
|
362
|
+
# @return [WithdrawAsyncResponse]
|
|
363
|
+
def internal_withdraw_async(body, opts = {})
|
|
364
|
+
data, _status_code, _headers = internal_withdraw_async_with_http_info(body, opts)
|
|
365
|
+
data
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
# Initiate async withdraw (internal)
|
|
369
|
+
# Internal-only endpoint for initiating asynchronous withdrawal processing.
|
|
370
|
+
# @param body [WithdrawAsyncRequest] This message represents a request to withdraw money from a customer asynchronously. It contains the customer ID and the amount to withdraw.
|
|
371
|
+
# @param [Hash] opts the optional parameters
|
|
372
|
+
# @return [Array<(WithdrawAsyncResponse, Integer, Hash)>] WithdrawAsyncResponse data, response status code and response headers
|
|
373
|
+
def internal_withdraw_async_with_http_info(body, opts = {})
|
|
374
|
+
if @api_client.config.debugging
|
|
375
|
+
@api_client.config.logger.debug 'Calling API: PaymentApi.internal_withdraw_async ...'
|
|
376
|
+
end
|
|
377
|
+
# verify the required parameter 'body' is set
|
|
378
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
379
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling PaymentApi.internal_withdraw_async"
|
|
380
|
+
end
|
|
381
|
+
# resource path
|
|
382
|
+
local_var_path = '/v1/withdraw/async'
|
|
383
|
+
|
|
384
|
+
# query parameters
|
|
385
|
+
query_params = opts[:query_params] || {}
|
|
386
|
+
|
|
387
|
+
# header parameters
|
|
388
|
+
header_params = opts[:header_params] || {}
|
|
389
|
+
# HTTP header 'Accept' (if needed)
|
|
390
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
391
|
+
# HTTP header 'Content-Type'
|
|
392
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
393
|
+
if !content_type.nil?
|
|
394
|
+
header_params['Content-Type'] = content_type
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
# form parameters
|
|
398
|
+
form_params = opts[:form_params] || {}
|
|
399
|
+
|
|
400
|
+
# http body (model)
|
|
401
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
|
402
|
+
|
|
403
|
+
# return_type
|
|
404
|
+
return_type = opts[:debug_return_type] || 'WithdrawAsyncResponse'
|
|
405
|
+
|
|
406
|
+
# auth_names
|
|
407
|
+
auth_names = opts[:debug_auth_names] || []
|
|
408
|
+
|
|
409
|
+
new_options = opts.merge(
|
|
410
|
+
:operation => :"PaymentApi.internal_withdraw_async",
|
|
411
|
+
:header_params => header_params,
|
|
412
|
+
:query_params => query_params,
|
|
413
|
+
:form_params => form_params,
|
|
414
|
+
:body => post_body,
|
|
415
|
+
:auth_names => auth_names,
|
|
416
|
+
:return_type => return_type
|
|
417
|
+
)
|
|
418
|
+
|
|
419
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
420
|
+
if @api_client.config.debugging
|
|
421
|
+
@api_client.config.logger.debug "API called: PaymentApi#internal_withdraw_async\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
422
|
+
end
|
|
423
|
+
return data, status_code, headers
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
# Get async withdraw status (internal)
|
|
427
|
+
# Internal-only endpoint for retrieving async withdraw processing status.
|
|
428
|
+
# @param body [WithdrawAsyncStatusRequest] This message represents a request to get the status of an asynchronous withdrawal.
|
|
429
|
+
# @param [Hash] opts the optional parameters
|
|
430
|
+
# @return [WithdrawAsyncStatusResponse]
|
|
431
|
+
def internal_withdraw_async_status(body, opts = {})
|
|
432
|
+
data, _status_code, _headers = internal_withdraw_async_status_with_http_info(body, opts)
|
|
433
|
+
data
|
|
434
|
+
end
|
|
435
|
+
|
|
436
|
+
# Get async withdraw status (internal)
|
|
437
|
+
# Internal-only endpoint for retrieving async withdraw processing status.
|
|
438
|
+
# @param body [WithdrawAsyncStatusRequest] This message represents a request to get the status of an asynchronous withdrawal.
|
|
439
|
+
# @param [Hash] opts the optional parameters
|
|
440
|
+
# @return [Array<(WithdrawAsyncStatusResponse, Integer, Hash)>] WithdrawAsyncStatusResponse data, response status code and response headers
|
|
441
|
+
def internal_withdraw_async_status_with_http_info(body, opts = {})
|
|
442
|
+
if @api_client.config.debugging
|
|
443
|
+
@api_client.config.logger.debug 'Calling API: PaymentApi.internal_withdraw_async_status ...'
|
|
444
|
+
end
|
|
445
|
+
# verify the required parameter 'body' is set
|
|
446
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
447
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling PaymentApi.internal_withdraw_async_status"
|
|
448
|
+
end
|
|
449
|
+
# resource path
|
|
450
|
+
local_var_path = '/v1/withdraw/async/status'
|
|
451
|
+
|
|
452
|
+
# query parameters
|
|
453
|
+
query_params = opts[:query_params] || {}
|
|
454
|
+
|
|
455
|
+
# header parameters
|
|
456
|
+
header_params = opts[:header_params] || {}
|
|
457
|
+
# HTTP header 'Accept' (if needed)
|
|
458
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
459
|
+
# HTTP header 'Content-Type'
|
|
460
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
461
|
+
if !content_type.nil?
|
|
462
|
+
header_params['Content-Type'] = content_type
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
# form parameters
|
|
466
|
+
form_params = opts[:form_params] || {}
|
|
467
|
+
|
|
468
|
+
# http body (model)
|
|
469
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
|
470
|
+
|
|
471
|
+
# return_type
|
|
472
|
+
return_type = opts[:debug_return_type] || 'WithdrawAsyncStatusResponse'
|
|
473
|
+
|
|
474
|
+
# auth_names
|
|
475
|
+
auth_names = opts[:debug_auth_names] || []
|
|
476
|
+
|
|
477
|
+
new_options = opts.merge(
|
|
478
|
+
:operation => :"PaymentApi.internal_withdraw_async_status",
|
|
479
|
+
:header_params => header_params,
|
|
480
|
+
:query_params => query_params,
|
|
481
|
+
:form_params => form_params,
|
|
482
|
+
:body => post_body,
|
|
483
|
+
:auth_names => auth_names,
|
|
484
|
+
:return_type => return_type
|
|
485
|
+
)
|
|
486
|
+
|
|
487
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
488
|
+
if @api_client.config.debugging
|
|
489
|
+
@api_client.config.logger.debug "API called: PaymentApi#internal_withdraw_async_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
490
|
+
end
|
|
491
|
+
return data, status_code, headers
|
|
492
|
+
end
|
|
493
|
+
|
|
358
494
|
# Process payment directly without redirect
|
|
359
495
|
# Execute a payment off-session within your application without redirecting to a payment page.
|
|
360
496
|
# @param body [OffSessionPaymentRequest] This message represents a request to process a payment directly within the application. It contains the customer ID and charge details to be processed.
|
|
@@ -423,6 +559,74 @@ module Api
|
|
|
423
559
|
return data, status_code, headers
|
|
424
560
|
end
|
|
425
561
|
|
|
562
|
+
# Initiate async off-session payment
|
|
563
|
+
# Starts asynchronous off-session payment processing and returns request tracking information.
|
|
564
|
+
# @param body [OffSessionPaymentAsyncRequest] This message represents a request to process an off-session payment asynchronously. It contains the customer ID and the amount to charge.
|
|
565
|
+
# @param [Hash] opts the optional parameters
|
|
566
|
+
# @return [OffSessionPaymentAsyncResponse]
|
|
567
|
+
def off_session_payment_async(body, opts = {})
|
|
568
|
+
data, _status_code, _headers = off_session_payment_async_with_http_info(body, opts)
|
|
569
|
+
data
|
|
570
|
+
end
|
|
571
|
+
|
|
572
|
+
# Initiate async off-session payment
|
|
573
|
+
# Starts asynchronous off-session payment processing and returns request tracking information.
|
|
574
|
+
# @param body [OffSessionPaymentAsyncRequest] This message represents a request to process an off-session payment asynchronously. It contains the customer ID and the amount to charge.
|
|
575
|
+
# @param [Hash] opts the optional parameters
|
|
576
|
+
# @return [Array<(OffSessionPaymentAsyncResponse, Integer, Hash)>] OffSessionPaymentAsyncResponse data, response status code and response headers
|
|
577
|
+
def off_session_payment_async_with_http_info(body, opts = {})
|
|
578
|
+
if @api_client.config.debugging
|
|
579
|
+
@api_client.config.logger.debug 'Calling API: PaymentApi.off_session_payment_async ...'
|
|
580
|
+
end
|
|
581
|
+
# verify the required parameter 'body' is set
|
|
582
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
583
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling PaymentApi.off_session_payment_async"
|
|
584
|
+
end
|
|
585
|
+
# resource path
|
|
586
|
+
local_var_path = '/v1/payments/off-session/async'
|
|
587
|
+
|
|
588
|
+
# query parameters
|
|
589
|
+
query_params = opts[:query_params] || {}
|
|
590
|
+
|
|
591
|
+
# header parameters
|
|
592
|
+
header_params = opts[:header_params] || {}
|
|
593
|
+
# HTTP header 'Accept' (if needed)
|
|
594
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
595
|
+
# HTTP header 'Content-Type'
|
|
596
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
597
|
+
if !content_type.nil?
|
|
598
|
+
header_params['Content-Type'] = content_type
|
|
599
|
+
end
|
|
600
|
+
|
|
601
|
+
# form parameters
|
|
602
|
+
form_params = opts[:form_params] || {}
|
|
603
|
+
|
|
604
|
+
# http body (model)
|
|
605
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
|
606
|
+
|
|
607
|
+
# return_type
|
|
608
|
+
return_type = opts[:debug_return_type] || 'OffSessionPaymentAsyncResponse'
|
|
609
|
+
|
|
610
|
+
# auth_names
|
|
611
|
+
auth_names = opts[:debug_auth_names] || []
|
|
612
|
+
|
|
613
|
+
new_options = opts.merge(
|
|
614
|
+
:operation => :"PaymentApi.off_session_payment_async",
|
|
615
|
+
:header_params => header_params,
|
|
616
|
+
:query_params => query_params,
|
|
617
|
+
:form_params => form_params,
|
|
618
|
+
:body => post_body,
|
|
619
|
+
:auth_names => auth_names,
|
|
620
|
+
:return_type => return_type
|
|
621
|
+
)
|
|
622
|
+
|
|
623
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
624
|
+
if @api_client.config.debugging
|
|
625
|
+
@api_client.config.logger.debug "API called: PaymentApi#off_session_payment_async\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
626
|
+
end
|
|
627
|
+
return data, status_code, headers
|
|
628
|
+
end
|
|
629
|
+
|
|
426
630
|
# Process payment with optional redirect
|
|
427
631
|
# Unified interface for creating payments - supports existing customers, new customers with charges, and contract-only creation.
|
|
428
632
|
# @param body [OnSessionPaymentRequest] Request message for the unified payment interface. The system intelligently routes the request to the appropriate payment method based on the provided parameters.
|
|
@@ -491,6 +695,74 @@ module Api
|
|
|
491
695
|
return data, status_code, headers
|
|
492
696
|
end
|
|
493
697
|
|
|
698
|
+
# Refund a charge
|
|
699
|
+
# Refunds a charge. If the same-day cancellation window has not passed, cancels the charge directly. Otherwise, creates a bank transfer refund request.
|
|
700
|
+
# @param body [RefundRequest] Request message for refunding a charge. The refund is always processed asynchronously. The final result is delivered via webhook (`charge_refund`).
|
|
701
|
+
# @param [Hash] opts the optional parameters
|
|
702
|
+
# @return [RefundResponse]
|
|
703
|
+
def refund(body, opts = {})
|
|
704
|
+
data, _status_code, _headers = refund_with_http_info(body, opts)
|
|
705
|
+
data
|
|
706
|
+
end
|
|
707
|
+
|
|
708
|
+
# Refund a charge
|
|
709
|
+
# Refunds a charge. If the same-day cancellation window has not passed, cancels the charge directly. Otherwise, creates a bank transfer refund request.
|
|
710
|
+
# @param body [RefundRequest] Request message for refunding a charge. The refund is always processed asynchronously. The final result is delivered via webhook (`charge_refund`).
|
|
711
|
+
# @param [Hash] opts the optional parameters
|
|
712
|
+
# @return [Array<(RefundResponse, Integer, Hash)>] RefundResponse data, response status code and response headers
|
|
713
|
+
def refund_with_http_info(body, opts = {})
|
|
714
|
+
if @api_client.config.debugging
|
|
715
|
+
@api_client.config.logger.debug 'Calling API: PaymentApi.refund ...'
|
|
716
|
+
end
|
|
717
|
+
# verify the required parameter 'body' is set
|
|
718
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
719
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling PaymentApi.refund"
|
|
720
|
+
end
|
|
721
|
+
# resource path
|
|
722
|
+
local_var_path = '/v1/refund'
|
|
723
|
+
|
|
724
|
+
# query parameters
|
|
725
|
+
query_params = opts[:query_params] || {}
|
|
726
|
+
|
|
727
|
+
# header parameters
|
|
728
|
+
header_params = opts[:header_params] || {}
|
|
729
|
+
# HTTP header 'Accept' (if needed)
|
|
730
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
731
|
+
# HTTP header 'Content-Type'
|
|
732
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
733
|
+
if !content_type.nil?
|
|
734
|
+
header_params['Content-Type'] = content_type
|
|
735
|
+
end
|
|
736
|
+
|
|
737
|
+
# form parameters
|
|
738
|
+
form_params = opts[:form_params] || {}
|
|
739
|
+
|
|
740
|
+
# http body (model)
|
|
741
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
|
742
|
+
|
|
743
|
+
# return_type
|
|
744
|
+
return_type = opts[:debug_return_type] || 'RefundResponse'
|
|
745
|
+
|
|
746
|
+
# auth_names
|
|
747
|
+
auth_names = opts[:debug_auth_names] || []
|
|
748
|
+
|
|
749
|
+
new_options = opts.merge(
|
|
750
|
+
:operation => :"PaymentApi.refund",
|
|
751
|
+
:header_params => header_params,
|
|
752
|
+
:query_params => query_params,
|
|
753
|
+
:form_params => form_params,
|
|
754
|
+
:body => post_body,
|
|
755
|
+
:auth_names => auth_names,
|
|
756
|
+
:return_type => return_type
|
|
757
|
+
)
|
|
758
|
+
|
|
759
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
760
|
+
if @api_client.config.debugging
|
|
761
|
+
@api_client.config.logger.debug "API called: PaymentApi#refund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
762
|
+
end
|
|
763
|
+
return data, status_code, headers
|
|
764
|
+
end
|
|
765
|
+
|
|
494
766
|
# Withdraw money from customer immediately, without redirect
|
|
495
767
|
# This call is synchronous. The money will be withdrawn immediately.
|
|
496
768
|
# @param body [WithdrawRequest] This message represents a request to withdraw money from a customer. It contains the customer ID and the amount to withdraw.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Jamm API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.9.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Api
|
|
17
|
+
class AsyncStatus
|
|
18
|
+
UNSPECIFIED = "ASYNC_STATUS_UNSPECIFIED".freeze
|
|
19
|
+
PENDING = "ASYNC_STATUS_PENDING".freeze
|
|
20
|
+
RUNNING = "ASYNC_STATUS_RUNNING".freeze
|
|
21
|
+
SUCCEEDED = "ASYNC_STATUS_SUCCEEDED".freeze
|
|
22
|
+
FAILED_TO_START = "ASYNC_STATUS_FAILED_TO_START".freeze
|
|
23
|
+
FAILED = "ASYNC_STATUS_FAILED".freeze
|
|
24
|
+
|
|
25
|
+
def self.all_vars
|
|
26
|
+
@all_vars ||= [UNSPECIFIED, PENDING, RUNNING, SUCCEEDED, FAILED_TO_START, FAILED].freeze
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Builds the enum from string
|
|
30
|
+
# @param [String] The enum value in the form of the string
|
|
31
|
+
# @return [String] The enum value
|
|
32
|
+
def self.build_from_hash(value)
|
|
33
|
+
new.build_from_hash(value)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Builds the enum from string
|
|
37
|
+
# @param [String] The enum value in the form of the string
|
|
38
|
+
# @return [String] The enum value
|
|
39
|
+
def build_from_hash(value)
|
|
40
|
+
return value if AsyncStatus.all_vars.include?(value)
|
|
41
|
+
raise "Invalid ENUM value #{value} for class #AsyncStatus"
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -48,6 +48,30 @@ module Api
|
|
|
48
48
|
|
|
49
49
|
attr_accessor :processed_at
|
|
50
50
|
|
|
51
|
+
attr_accessor :charge_status
|
|
52
|
+
|
|
53
|
+
class EnumAttributeValidator
|
|
54
|
+
attr_reader :datatype
|
|
55
|
+
attr_reader :allowable_values
|
|
56
|
+
|
|
57
|
+
def initialize(datatype, allowable_values)
|
|
58
|
+
@allowable_values = allowable_values.map do |value|
|
|
59
|
+
case datatype.to_s
|
|
60
|
+
when /Integer/i
|
|
61
|
+
value.to_i
|
|
62
|
+
when /Float/i
|
|
63
|
+
value.to_f
|
|
64
|
+
else
|
|
65
|
+
value
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def valid?(value)
|
|
71
|
+
!value || allowable_values.include?(value)
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
51
75
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
52
76
|
def self.attribute_map
|
|
53
77
|
{
|
|
@@ -65,7 +89,8 @@ module Api
|
|
|
65
89
|
:'metadata' => :'metadata',
|
|
66
90
|
:'created_at' => :'createdAt',
|
|
67
91
|
:'updated_at' => :'updatedAt',
|
|
68
|
-
:'processed_at' => :'processedAt'
|
|
92
|
+
:'processed_at' => :'processedAt',
|
|
93
|
+
:'charge_status' => :'chargeStatus'
|
|
69
94
|
}
|
|
70
95
|
end
|
|
71
96
|
|
|
@@ -91,7 +116,8 @@ module Api
|
|
|
91
116
|
:'metadata' => :'Hash<String, String>',
|
|
92
117
|
:'created_at' => :'Time',
|
|
93
118
|
:'updated_at' => :'Time',
|
|
94
|
-
:'processed_at' => :'Time'
|
|
119
|
+
:'processed_at' => :'Time',
|
|
120
|
+
:'charge_status' => :'ChargeStatus'
|
|
95
121
|
}
|
|
96
122
|
end
|
|
97
123
|
|
|
@@ -177,6 +203,12 @@ module Api
|
|
|
177
203
|
if attributes.key?(:'processed_at')
|
|
178
204
|
self.processed_at = attributes[:'processed_at']
|
|
179
205
|
end
|
|
206
|
+
|
|
207
|
+
if attributes.key?(:'charge_status')
|
|
208
|
+
self.charge_status = attributes[:'charge_status']
|
|
209
|
+
else
|
|
210
|
+
self.charge_status = 'CHARGE_STATUS_UNSPECIFIED'
|
|
211
|
+
end
|
|
180
212
|
end
|
|
181
213
|
|
|
182
214
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -213,7 +245,8 @@ module Api
|
|
|
213
245
|
metadata == o.metadata &&
|
|
214
246
|
created_at == o.created_at &&
|
|
215
247
|
updated_at == o.updated_at &&
|
|
216
|
-
processed_at == o.processed_at
|
|
248
|
+
processed_at == o.processed_at &&
|
|
249
|
+
charge_status == o.charge_status
|
|
217
250
|
end
|
|
218
251
|
|
|
219
252
|
# @see the `==` method
|
|
@@ -225,7 +258,7 @@ module Api
|
|
|
225
258
|
# Calculates hash code according to all attributes.
|
|
226
259
|
# @return [Integer] Hash code
|
|
227
260
|
def hash
|
|
228
|
-
[charge_id, paid, reason, description, merchant_name, initial_amount, discount, final_amount, amount_refunded, currency, token_id, metadata, created_at, updated_at, processed_at].hash
|
|
261
|
+
[charge_id, paid, reason, description, merchant_name, initial_amount, discount, final_amount, amount_refunded, currency, token_id, metadata, created_at, updated_at, processed_at, charge_status].hash
|
|
229
262
|
end
|
|
230
263
|
|
|
231
264
|
# Builds the object from hash
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Jamm API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.9.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Api
|
|
17
|
+
class ChargeStatus
|
|
18
|
+
UNSPECIFIED = "CHARGE_STATUS_UNSPECIFIED".freeze
|
|
19
|
+
SUCCESS = "CHARGE_STATUS_SUCCESS".freeze
|
|
20
|
+
FAILURE = "CHARGE_STATUS_FAILURE".freeze
|
|
21
|
+
WAITING_EKYC = "CHARGE_STATUS_WAITING_EKYC".freeze
|
|
22
|
+
BLOCKING = "CHARGE_STATUS_BLOCKING".freeze
|
|
23
|
+
CANCELLED = "CHARGE_STATUS_CANCELLED".freeze
|
|
24
|
+
REFUNDED = "CHARGE_STATUS_REFUNDED".freeze
|
|
25
|
+
PENDING = "CHARGE_STATUS_PENDING".freeze
|
|
26
|
+
|
|
27
|
+
def self.all_vars
|
|
28
|
+
@all_vars ||= [UNSPECIFIED, SUCCESS, FAILURE, WAITING_EKYC, BLOCKING, CANCELLED, REFUNDED, PENDING].freeze
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Builds the enum from string
|
|
32
|
+
# @param [String] The enum value in the form of the string
|
|
33
|
+
# @return [String] The enum value
|
|
34
|
+
def self.build_from_hash(value)
|
|
35
|
+
new.build_from_hash(value)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Builds the enum from string
|
|
39
|
+
# @param [String] The enum value in the form of the string
|
|
40
|
+
# @return [String] The enum value
|
|
41
|
+
def build_from_hash(value)
|
|
42
|
+
return value if ChargeStatus.all_vars.include?(value)
|
|
43
|
+
raise "Invalid ENUM value #{value} for class #ChargeStatus"
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -35,9 +35,24 @@ module Api
|
|
|
35
35
|
PAYMENT_CHARGE_SUBSCRIPTION_EXPIRED = "ERROR_TYPE_PAYMENT_CHARGE_SUBSCRIPTION_EXPIRED".freeze
|
|
36
36
|
PAYMENT_LINK_EXPIRED = "ERROR_TYPE_PAYMENT_LINK_EXPIRED".freeze
|
|
37
37
|
PAYMENT_CHARGE_INSUFFICIENT_FUNDS = "ERROR_TYPE_PAYMENT_CHARGE_INSUFFICIENT_FUNDS".freeze
|
|
38
|
+
CSV_VALIDATION_FAILED = "ERROR_TYPE_CSV_VALIDATION_FAILED".freeze
|
|
39
|
+
CSV_TOTP_REQUIRED = "ERROR_TYPE_CSV_TOTP_REQUIRED".freeze
|
|
40
|
+
CSV_TOTP_INVALID = "ERROR_TYPE_CSV_TOTP_INVALID".freeze
|
|
41
|
+
CSV_TOTP_EXPIRED = "ERROR_TYPE_CSV_TOTP_EXPIRED".freeze
|
|
42
|
+
CSV_TOTP_LOCKED = "ERROR_TYPE_CSV_TOTP_LOCKED".freeze
|
|
43
|
+
CSV_BATCH_TOO_LARGE = "ERROR_TYPE_CSV_BATCH_TOO_LARGE".freeze
|
|
44
|
+
CSV_CUSTOMER_NOT_FOUND = "ERROR_TYPE_CSV_CUSTOMER_NOT_FOUND".freeze
|
|
45
|
+
CSV_PROCESSING_FAILED = "ERROR_TYPE_CSV_PROCESSING_FAILED".freeze
|
|
46
|
+
CSV_CHALLENGE_NOT_FOUND = "ERROR_TYPE_CSV_CHALLENGE_NOT_FOUND".freeze
|
|
47
|
+
CSV_DUPLICATE_USER = "ERROR_TYPE_CSV_DUPLICATE_USER".freeze
|
|
48
|
+
TOTP_SETUP_FAILED = "ERROR_TYPE_TOTP_SETUP_FAILED".freeze
|
|
49
|
+
TOTP_ALREADY_ENABLED = "ERROR_TYPE_TOTP_ALREADY_ENABLED".freeze
|
|
50
|
+
TOTP_NOT_ENABLED = "ERROR_TYPE_TOTP_NOT_ENABLED".freeze
|
|
51
|
+
TOTP_SETUP_INVALID = "ERROR_TYPE_TOTP_SETUP_INVALID".freeze
|
|
52
|
+
TOTP_DISABLE_FAILED = "ERROR_TYPE_TOTP_DISABLE_FAILED".freeze
|
|
38
53
|
|
|
39
54
|
def self.all_vars
|
|
40
|
-
@all_vars ||= [UNSPECIFIED, AUTH_FAILED, AUTH_REJECTED, ACCOUNT_CREATION_FAILED, ACCOUNT_MODIFICATION_FAILED, ACCOUNT_DELETION_FAILED, ACCOUNT_BANK_REGISTRATION_FAILED, KYC_REJECTED, NOTIFICATION_WEBHOOK_FAILED, NOTIFICATION_EMAIL_FAILED, NOTIFICATION_SMS_FAILED, PAYMENT_GATEWAY_UNAVAILABLE, PAYMENT_GATEWAY_FAILED, PAYMENT_VALIDATION_FAILED, PAYMENT_CHARGE_FAILED, PAYMENT_CHARGE_REJECTED, PAYMENT_CHARGE_OVER_LIMIT, PAYMENT_CHARGE_SUBSCRIPTION_EXPIRED, PAYMENT_LINK_EXPIRED, PAYMENT_CHARGE_INSUFFICIENT_FUNDS].freeze
|
|
55
|
+
@all_vars ||= [UNSPECIFIED, AUTH_FAILED, AUTH_REJECTED, ACCOUNT_CREATION_FAILED, ACCOUNT_MODIFICATION_FAILED, ACCOUNT_DELETION_FAILED, ACCOUNT_BANK_REGISTRATION_FAILED, KYC_REJECTED, NOTIFICATION_WEBHOOK_FAILED, NOTIFICATION_EMAIL_FAILED, NOTIFICATION_SMS_FAILED, PAYMENT_GATEWAY_UNAVAILABLE, PAYMENT_GATEWAY_FAILED, PAYMENT_VALIDATION_FAILED, PAYMENT_CHARGE_FAILED, PAYMENT_CHARGE_REJECTED, PAYMENT_CHARGE_OVER_LIMIT, PAYMENT_CHARGE_SUBSCRIPTION_EXPIRED, PAYMENT_LINK_EXPIRED, PAYMENT_CHARGE_INSUFFICIENT_FUNDS, CSV_VALIDATION_FAILED, CSV_TOTP_REQUIRED, CSV_TOTP_INVALID, CSV_TOTP_EXPIRED, CSV_TOTP_LOCKED, CSV_BATCH_TOO_LARGE, CSV_CUSTOMER_NOT_FOUND, CSV_PROCESSING_FAILED, CSV_CHALLENGE_NOT_FOUND, CSV_DUPLICATE_USER, TOTP_SETUP_FAILED, TOTP_ALREADY_ENABLED, TOTP_NOT_ENABLED, TOTP_SETUP_INVALID, TOTP_DISABLE_FAILED].freeze
|
|
41
56
|
end
|
|
42
57
|
|
|
43
58
|
# Builds the enum from string
|
|
@@ -20,13 +20,13 @@ module Api
|
|
|
20
20
|
CHARGE_UPDATED = "EVENT_TYPE_CHARGE_UPDATED".freeze
|
|
21
21
|
CHARGE_SUCCESS = "EVENT_TYPE_CHARGE_SUCCESS".freeze
|
|
22
22
|
CHARGE_FAIL = "EVENT_TYPE_CHARGE_FAIL".freeze
|
|
23
|
-
|
|
23
|
+
CHARGE_REFUND = "EVENT_TYPE_CHARGE_REFUND".freeze
|
|
24
24
|
CONTRACT_ACTIVATED = "EVENT_TYPE_CONTRACT_ACTIVATED".freeze
|
|
25
25
|
USER_ACCOUNT_DELETED = "EVENT_TYPE_USER_ACCOUNT_DELETED".freeze
|
|
26
26
|
TESTING = "EVENT_TYPE_TESTING".freeze
|
|
27
27
|
|
|
28
28
|
def self.all_vars
|
|
29
|
-
@all_vars ||= [UNSPECIFIED, CHARGE_CREATED, CHARGE_UPDATED, CHARGE_SUCCESS, CHARGE_FAIL,
|
|
29
|
+
@all_vars ||= [UNSPECIFIED, CHARGE_CREATED, CHARGE_UPDATED, CHARGE_SUCCESS, CHARGE_FAIL, CHARGE_REFUND, CONTRACT_ACTIVATED, USER_ACCOUNT_DELETED, TESTING].freeze
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# Builds the enum from string
|