moov_ruby 0.3.21 → 0.3.23
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/lib/moov/client.rb +2 -1
- data/lib/moov/invoices.rb +288 -0
- data/lib/moov/models/components/achtransactiondetails.rb +6 -2
- data/lib/moov/models/components/achtransactiondetails.rbi +2 -0
- data/lib/moov/models/components/createinvoicepayment.rb +41 -0
- data/lib/moov/models/components/createinvoicepayment.rbi +17 -0
- data/lib/moov/models/components/createtransferachaddendarecord.rb +33 -0
- data/lib/moov/models/components/createtransferachaddendarecord.rbi +13 -0
- data/lib/moov/models/components/createtransferdestinationach.rb +6 -2
- data/lib/moov/models/components/createtransferdestinationach.rbi +2 -0
- data/lib/moov/models/components/createtransfersourceach.rb +6 -2
- data/lib/moov/models/components/createtransfersourceach.rbi +2 -0
- data/lib/moov/models/components/createwebhook.rb +45 -0
- data/lib/moov/models/components/createwebhook.rbi +19 -0
- data/lib/moov/models/components/eventtype.rb +41 -0
- data/lib/moov/models/components/eventtype.rbi +17 -0
- data/lib/moov/models/components/invoiceexternalpayment.rb +2 -6
- data/lib/moov/models/components/invoiceexternalpayment.rbi +0 -2
- data/lib/moov/models/components/invoicepayment.rb +9 -5
- data/lib/moov/models/components/invoicepayment.rbi +4 -2
- data/lib/moov/models/components/invoicetransferpayment.rb +2 -6
- data/lib/moov/models/components/invoicetransferpayment.rbi +0 -2
- data/lib/moov/models/components/pingresponse.rb +41 -0
- data/lib/moov/models/components/pingresponse.rbi +17 -0
- data/lib/moov/models/components/transferachaddendarecord.rb +37 -0
- data/lib/moov/models/components/transferachaddendarecord.rbi +15 -0
- data/lib/moov/models/components/updatewebhook.rb +45 -0
- data/lib/moov/models/components/updatewebhook.rbi +19 -0
- data/lib/moov/models/components/webhook.rb +61 -0
- data/lib/moov/models/components/webhook.rbi +27 -0
- data/lib/moov/models/components/webhooksecret.rb +33 -0
- data/lib/moov/models/components/webhooksecret.rbi +13 -0
- data/lib/moov/models/components/{invoiceexternalpayment_paymenttype.rb → webhookstatus.rb} +4 -3
- data/lib/moov/models/components/webhookstatus.rbi +11 -0
- data/lib/moov/models/components.rb +10 -2
- data/lib/moov/models/errors/createinvoicepaymenterror.rb +45 -0
- data/lib/moov/models/errors/createinvoicepaymenterror.rbi +19 -0
- data/lib/moov/models/errors/createwebhookvalidationerror.rb +49 -0
- data/lib/moov/models/errors/createwebhookvalidationerror.rbi +21 -0
- data/lib/moov/models/errors/updatewebhookvalidationerror.rb +49 -0
- data/lib/moov/models/errors/updatewebhookvalidationerror.rbi +21 -0
- data/lib/moov/models/errors.rb +3 -0
- data/lib/moov/models/operations/createinvoicepayment_request.rb +54 -0
- data/lib/moov/models/operations/createinvoicepayment_request.rbi +19 -0
- data/lib/moov/models/operations/createinvoicepayment_response.rb +49 -0
- data/lib/moov/models/operations/createinvoicepayment_response.rbi +21 -0
- data/lib/moov/models/operations/createwebhook_request.rb +46 -0
- data/lib/moov/models/operations/createwebhook_request.rbi +15 -0
- data/lib/moov/models/operations/createwebhook_response.rb +49 -0
- data/lib/moov/models/operations/createwebhook_response.rbi +21 -0
- data/lib/moov/models/operations/disablewebhook_request.rb +46 -0
- data/lib/moov/models/operations/disablewebhook_request.rbi +15 -0
- data/lib/moov/models/operations/disablewebhook_response.rb +45 -0
- data/lib/moov/models/operations/disablewebhook_response.rbi +19 -0
- data/lib/moov/models/operations/getwebhook_request.rb +46 -0
- data/lib/moov/models/operations/getwebhook_request.rbi +15 -0
- data/lib/moov/models/operations/getwebhook_response.rb +49 -0
- data/lib/moov/models/operations/getwebhook_response.rbi +21 -0
- data/lib/moov/models/operations/getwebhooksecret_request.rb +46 -0
- data/lib/moov/models/operations/getwebhooksecret_request.rbi +15 -0
- data/lib/moov/models/operations/getwebhooksecret_response.rb +49 -0
- data/lib/moov/models/operations/getwebhooksecret_response.rbi +21 -0
- data/lib/moov/models/operations/listeventtypes_request.rb +42 -0
- data/lib/moov/models/operations/listeventtypes_request.rbi +13 -0
- data/lib/moov/models/operations/listeventtypes_response.rb +49 -0
- data/lib/moov/models/operations/listeventtypes_response.rbi +21 -0
- data/lib/moov/models/operations/listinvoicepayments_request.rb +50 -0
- data/lib/moov/models/operations/listinvoicepayments_request.rbi +17 -0
- data/lib/moov/models/operations/listinvoicepayments_response.rb +49 -0
- data/lib/moov/models/operations/listinvoicepayments_response.rbi +21 -0
- data/lib/moov/models/operations/listwebhooks_request.rb +42 -0
- data/lib/moov/models/operations/listwebhooks_request.rbi +13 -0
- data/lib/moov/models/operations/listwebhooks_response.rb +49 -0
- data/lib/moov/models/operations/listwebhooks_response.rbi +21 -0
- data/lib/moov/models/operations/pingwebhook_request.rb +46 -0
- data/lib/moov/models/operations/pingwebhook_request.rbi +15 -0
- data/lib/moov/models/operations/pingwebhook_response.rb +49 -0
- data/lib/moov/models/operations/pingwebhook_response.rbi +21 -0
- data/lib/moov/models/operations/updatewebhook_request.rb +50 -0
- data/lib/moov/models/operations/updatewebhook_request.rbi +17 -0
- data/lib/moov/models/operations/updatewebhook_response.rb +49 -0
- data/lib/moov/models/operations/updatewebhook_response.rbi +21 -0
- data/lib/moov/models/operations.rb +20 -0
- data/lib/moov/sdkconfiguration.rb +2 -2
- data/lib/moov/webhooks.rb +1056 -0
- data/lib/moov_ruby.rb +1 -0
- metadata +69 -6
- data/lib/moov/models/components/invoiceexternalpayment_paymenttype.rbi +0 -11
- data/lib/moov/models/components/invoicetransferpayment_paymenttype.rb +0 -21
- data/lib/moov/models/components/invoicetransferpayment_paymenttype.rbi +0 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b938c13ffea98d10ce59eafa2f3082b0ebdf4493466c3a96e1116ba693417ce3
|
|
4
|
+
data.tar.gz: 8026d785fb2e95d93e8da13672b32e7057ba811a59cbca106c72a2069bdfaee9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1f651e623ab43f490808d4ac1722f3b7ae19e6fe981ae51c13421e156a83159ec81dd5cf05ab1f9755eee89a2bbe223f447281b5489bd97a0fac052c29122b56
|
|
7
|
+
data.tar.gz: 94ecf0b055ea098c1ec08b87ad7f3b4313f142647d423ca56c33c1362e776ec5ba1c1d56fb578166f623cc9c0f3309f7e3ff210d4ef7ee3ab63ed00d5f24ff44
|
data/lib/moov/client.rb
CHANGED
|
@@ -16,7 +16,7 @@ module Moov
|
|
|
16
16
|
class Client
|
|
17
17
|
extend T::Sig
|
|
18
18
|
|
|
19
|
-
attr_accessor :accounts, :adjustments, :apple_pay, :bank_accounts, :branding, :capabilities, :cards, :disputes, :fee_plans, :files, :images, :invoices, :payment_links, :payment_methods, :products, :representatives, :scheduling, :statements, :sweeps, :account_terminal_applications, :support, :transfers, :underwriting, :wallets, :wallet_transactions, :avatars, :end_to_end_encryption, :enriched_address, :enriched_profile, :industries, :institutions, :issuing_transactions, :card_issuing, :authentication, :onboarding, :ping, :receipts, :terminal_applications
|
|
19
|
+
attr_accessor :accounts, :adjustments, :apple_pay, :bank_accounts, :branding, :capabilities, :cards, :disputes, :fee_plans, :files, :images, :invoices, :payment_links, :payment_methods, :products, :representatives, :scheduling, :statements, :sweeps, :account_terminal_applications, :support, :transfers, :underwriting, :wallets, :wallet_transactions, :avatars, :end_to_end_encryption, :enriched_address, :enriched_profile, :webhooks, :industries, :institutions, :issuing_transactions, :card_issuing, :authentication, :onboarding, :ping, :receipts, :terminal_applications
|
|
20
20
|
|
|
21
21
|
# Instantiates the SDK, configuring it with the provided parameters.
|
|
22
22
|
#
|
|
@@ -122,6 +122,7 @@ module Moov
|
|
|
122
122
|
@end_to_end_encryption = EndToEndEncryption.new(@sdk_configuration)
|
|
123
123
|
@enriched_address = EnrichedAddress.new(@sdk_configuration)
|
|
124
124
|
@enriched_profile = EnrichedProfile.new(@sdk_configuration)
|
|
125
|
+
@webhooks = Webhooks.new(@sdk_configuration)
|
|
125
126
|
@industries = Industries.new(@sdk_configuration)
|
|
126
127
|
@institutions = Institutions.new(@sdk_configuration)
|
|
127
128
|
@issuing_transactions = IssuingTransactions.new(@sdk_configuration)
|
data/lib/moov/invoices.rb
CHANGED
|
@@ -622,5 +622,293 @@ module Moov
|
|
|
622
622
|
|
|
623
623
|
end
|
|
624
624
|
end
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
sig { params(create_invoice_payment: Models::Components::CreateInvoicePayment, account_id: ::String, invoice_id: ::String, x_moov_version: T.nilable(::String), timeout_ms: T.nilable(Integer)).returns(Models::Operations::CreateInvoicePaymentResponse) }
|
|
628
|
+
def create_invoice_payment(create_invoice_payment:, account_id:, invoice_id:, x_moov_version: nil, timeout_ms: nil)
|
|
629
|
+
# create_invoice_payment - Creates a payment resource to represent that an invoice was paid outside of the Moov platform.
|
|
630
|
+
# If a payment link was created for the invoice, the corresponding payment link is canceled, but a receipt is still sent.
|
|
631
|
+
#
|
|
632
|
+
# To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
633
|
+
# you'll need to specify the `/accounts/{accountID}/invoices.write` scope.
|
|
634
|
+
request = Models::Operations::CreateInvoicePaymentRequest.new(
|
|
635
|
+
account_id: account_id,
|
|
636
|
+
invoice_id: invoice_id,
|
|
637
|
+
create_invoice_payment: create_invoice_payment,
|
|
638
|
+
x_moov_version: x_moov_version
|
|
639
|
+
)
|
|
640
|
+
url, params = @sdk_configuration.get_server_details
|
|
641
|
+
base_url = Utils.template_url(url, params)
|
|
642
|
+
url = Utils.generate_url(
|
|
643
|
+
Models::Operations::CreateInvoicePaymentRequest,
|
|
644
|
+
base_url,
|
|
645
|
+
'/accounts/{accountID}/invoices/{invoiceID}/payments',
|
|
646
|
+
request,
|
|
647
|
+
@sdk_configuration.globals
|
|
648
|
+
)
|
|
649
|
+
headers = Utils.get_headers(request, @sdk_configuration.globals)
|
|
650
|
+
headers = T.cast(headers, T::Hash[String, String])
|
|
651
|
+
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :create_invoice_payment, :json)
|
|
652
|
+
headers['content-type'] = req_content_type
|
|
653
|
+
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
|
654
|
+
|
|
655
|
+
if form
|
|
656
|
+
body = Utils.encode_form(form)
|
|
657
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
658
|
+
body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object]))
|
|
659
|
+
else
|
|
660
|
+
body = data
|
|
661
|
+
end
|
|
662
|
+
headers['Accept'] = 'application/json'
|
|
663
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
664
|
+
|
|
665
|
+
security = @sdk_configuration.security_source&.call
|
|
666
|
+
|
|
667
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
668
|
+
timeout ||= @sdk_configuration.timeout
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
connection = @sdk_configuration.client
|
|
672
|
+
|
|
673
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
674
|
+
config: @sdk_configuration,
|
|
675
|
+
base_url: base_url,
|
|
676
|
+
oauth2_scopes: nil,
|
|
677
|
+
operation_id: 'createInvoicePayment',
|
|
678
|
+
security_source: @sdk_configuration.security_source
|
|
679
|
+
)
|
|
680
|
+
|
|
681
|
+
error = T.let(nil, T.nilable(StandardError))
|
|
682
|
+
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
begin
|
|
686
|
+
http_response = T.must(connection).post(url) do |req|
|
|
687
|
+
req.body = body
|
|
688
|
+
req.headers.merge!(headers)
|
|
689
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
690
|
+
Utils.configure_request_security(req, security)
|
|
691
|
+
|
|
692
|
+
@sdk_configuration.hooks.before_request(
|
|
693
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
694
|
+
hook_ctx: hook_ctx
|
|
695
|
+
),
|
|
696
|
+
request: req
|
|
697
|
+
)
|
|
698
|
+
end
|
|
699
|
+
rescue StandardError => e
|
|
700
|
+
error = e
|
|
701
|
+
ensure
|
|
702
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
703
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
704
|
+
error: error,
|
|
705
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
706
|
+
hook_ctx: hook_ctx
|
|
707
|
+
),
|
|
708
|
+
response: http_response
|
|
709
|
+
)
|
|
710
|
+
else
|
|
711
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
712
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
713
|
+
hook_ctx: hook_ctx
|
|
714
|
+
),
|
|
715
|
+
response: http_response
|
|
716
|
+
)
|
|
717
|
+
end
|
|
718
|
+
|
|
719
|
+
if http_response.nil?
|
|
720
|
+
raise error if !error.nil?
|
|
721
|
+
raise 'no response'
|
|
722
|
+
end
|
|
723
|
+
end
|
|
724
|
+
|
|
725
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
726
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
727
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
728
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
729
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
730
|
+
hook_ctx: hook_ctx
|
|
731
|
+
),
|
|
732
|
+
response: http_response
|
|
733
|
+
)
|
|
734
|
+
response_data = http_response.env.response_body
|
|
735
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::InvoicePayment)
|
|
736
|
+
response = Models::Operations::CreateInvoicePaymentResponse.new(
|
|
737
|
+
status_code: http_response.status,
|
|
738
|
+
content_type: content_type,
|
|
739
|
+
raw_response: http_response,
|
|
740
|
+
headers: http_response.headers,
|
|
741
|
+
invoice_payment: T.unsafe(obj)
|
|
742
|
+
)
|
|
743
|
+
|
|
744
|
+
return response
|
|
745
|
+
else
|
|
746
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
747
|
+
end
|
|
748
|
+
elsif Utils.match_status_code(http_response.status, ['400', '409'])
|
|
749
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
750
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
751
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
752
|
+
hook_ctx: hook_ctx
|
|
753
|
+
),
|
|
754
|
+
response: http_response
|
|
755
|
+
)
|
|
756
|
+
response_data = http_response.env.response_body
|
|
757
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::GenericError)
|
|
758
|
+
obj.raw_response = http_response
|
|
759
|
+
raise obj
|
|
760
|
+
else
|
|
761
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
762
|
+
end
|
|
763
|
+
elsif Utils.match_status_code(http_response.status, ['422'])
|
|
764
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
765
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
766
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
767
|
+
hook_ctx: hook_ctx
|
|
768
|
+
),
|
|
769
|
+
response: http_response
|
|
770
|
+
)
|
|
771
|
+
response_data = http_response.env.response_body
|
|
772
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::CreateInvoicePaymentError)
|
|
773
|
+
obj.raw_response = http_response
|
|
774
|
+
raise obj
|
|
775
|
+
else
|
|
776
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
777
|
+
end
|
|
778
|
+
elsif Utils.match_status_code(http_response.status, ['401', '403', '404', '429'])
|
|
779
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
780
|
+
elsif Utils.match_status_code(http_response.status, ['500', '504'])
|
|
781
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
782
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
783
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
784
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
785
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
786
|
+
else
|
|
787
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
|
788
|
+
|
|
789
|
+
end
|
|
790
|
+
end
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
sig { params(account_id: ::String, invoice_id: ::String, x_moov_version: T.nilable(::String), timeout_ms: T.nilable(Integer)).returns(Models::Operations::ListInvoicePaymentsResponse) }
|
|
794
|
+
def list_invoice_payments(account_id:, invoice_id:, x_moov_version: nil, timeout_ms: nil)
|
|
795
|
+
# list_invoice_payments - List all the payments made towards an invoice.
|
|
796
|
+
#
|
|
797
|
+
# To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
798
|
+
# you'll need to specify the `/accounts/{accountID}/invoices.read` scope.
|
|
799
|
+
request = Models::Operations::ListInvoicePaymentsRequest.new(
|
|
800
|
+
account_id: account_id,
|
|
801
|
+
invoice_id: invoice_id,
|
|
802
|
+
x_moov_version: x_moov_version
|
|
803
|
+
)
|
|
804
|
+
url, params = @sdk_configuration.get_server_details
|
|
805
|
+
base_url = Utils.template_url(url, params)
|
|
806
|
+
url = Utils.generate_url(
|
|
807
|
+
Models::Operations::ListInvoicePaymentsRequest,
|
|
808
|
+
base_url,
|
|
809
|
+
'/accounts/{accountID}/invoices/{invoiceID}/payments',
|
|
810
|
+
request,
|
|
811
|
+
@sdk_configuration.globals
|
|
812
|
+
)
|
|
813
|
+
headers = Utils.get_headers(request, @sdk_configuration.globals)
|
|
814
|
+
headers = T.cast(headers, T::Hash[String, String])
|
|
815
|
+
headers['Accept'] = 'application/json'
|
|
816
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
817
|
+
|
|
818
|
+
security = @sdk_configuration.security_source&.call
|
|
819
|
+
|
|
820
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
821
|
+
timeout ||= @sdk_configuration.timeout
|
|
822
|
+
|
|
823
|
+
|
|
824
|
+
connection = @sdk_configuration.client
|
|
825
|
+
|
|
826
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
827
|
+
config: @sdk_configuration,
|
|
828
|
+
base_url: base_url,
|
|
829
|
+
oauth2_scopes: nil,
|
|
830
|
+
operation_id: 'listInvoicePayments',
|
|
831
|
+
security_source: @sdk_configuration.security_source
|
|
832
|
+
)
|
|
833
|
+
|
|
834
|
+
error = T.let(nil, T.nilable(StandardError))
|
|
835
|
+
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
begin
|
|
839
|
+
http_response = T.must(connection).get(url) do |req|
|
|
840
|
+
req.headers.merge!(headers)
|
|
841
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
842
|
+
Utils.configure_request_security(req, security)
|
|
843
|
+
|
|
844
|
+
@sdk_configuration.hooks.before_request(
|
|
845
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
846
|
+
hook_ctx: hook_ctx
|
|
847
|
+
),
|
|
848
|
+
request: req
|
|
849
|
+
)
|
|
850
|
+
end
|
|
851
|
+
rescue StandardError => e
|
|
852
|
+
error = e
|
|
853
|
+
ensure
|
|
854
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
855
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
856
|
+
error: error,
|
|
857
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
858
|
+
hook_ctx: hook_ctx
|
|
859
|
+
),
|
|
860
|
+
response: http_response
|
|
861
|
+
)
|
|
862
|
+
else
|
|
863
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
864
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
865
|
+
hook_ctx: hook_ctx
|
|
866
|
+
),
|
|
867
|
+
response: http_response
|
|
868
|
+
)
|
|
869
|
+
end
|
|
870
|
+
|
|
871
|
+
if http_response.nil?
|
|
872
|
+
raise error if !error.nil?
|
|
873
|
+
raise 'no response'
|
|
874
|
+
end
|
|
875
|
+
end
|
|
876
|
+
|
|
877
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
878
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
879
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
880
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
881
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
882
|
+
hook_ctx: hook_ctx
|
|
883
|
+
),
|
|
884
|
+
response: http_response
|
|
885
|
+
)
|
|
886
|
+
response_data = http_response.env.response_body
|
|
887
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Crystalline::Array.new(Models::Components::InvoicePayment))
|
|
888
|
+
response = Models::Operations::ListInvoicePaymentsResponse.new(
|
|
889
|
+
status_code: http_response.status,
|
|
890
|
+
content_type: content_type,
|
|
891
|
+
raw_response: http_response,
|
|
892
|
+
headers: http_response.headers,
|
|
893
|
+
invoice_payments: T.unsafe(obj)
|
|
894
|
+
)
|
|
895
|
+
|
|
896
|
+
return response
|
|
897
|
+
else
|
|
898
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
899
|
+
end
|
|
900
|
+
elsif Utils.match_status_code(http_response.status, ['401', '403', '429'])
|
|
901
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
902
|
+
elsif Utils.match_status_code(http_response.status, ['500', '504'])
|
|
903
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
904
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
905
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
906
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
907
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
908
|
+
else
|
|
909
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
|
910
|
+
|
|
911
|
+
end
|
|
912
|
+
end
|
|
625
913
|
end
|
|
626
914
|
end
|
|
@@ -44,8 +44,10 @@ module Moov
|
|
|
44
44
|
# An optional override of your default ACH hold period in banking days. The hold period must be longer than or equal to your default setting.
|
|
45
45
|
field :debit_hold_period, Crystalline::Nilable.new(Models::Components::DebitHoldPeriod), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('debitHoldPeriod'), 'decoder': Utils.enum_from_string(Models::Components::DebitHoldPeriod, true) } }
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
field :addenda, Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::TransferACHAddendaRecord)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('addenda') } }
|
|
48
|
+
|
|
49
|
+
sig { params(status: Models::Components::ACHTransactionStatus, trace_number: ::String, return_: T.nilable(Models::Components::ACHException), correction: T.nilable(Models::Components::ACHException), company_entry_description: T.nilable(::String), originating_company_name: T.nilable(::String), sec_code: T.nilable(Models::Components::SECCode), canceled_on: T.nilable(::DateTime), initiated_on: T.nilable(::DateTime), originated_on: T.nilable(::DateTime), corrected_on: T.nilable(::DateTime), returned_on: T.nilable(::DateTime), failed_on: T.nilable(::DateTime), completed_on: T.nilable(::DateTime), debit_hold_period: T.nilable(Models::Components::DebitHoldPeriod), addenda: T.nilable(T::Array[Models::Components::TransferACHAddendaRecord])).void }
|
|
50
|
+
def initialize(status:, trace_number:, return_: nil, correction: nil, company_entry_description: nil, originating_company_name: nil, sec_code: nil, canceled_on: nil, initiated_on: nil, originated_on: nil, corrected_on: nil, returned_on: nil, failed_on: nil, completed_on: nil, debit_hold_period: nil, addenda: nil)
|
|
49
51
|
@status = status
|
|
50
52
|
@trace_number = trace_number
|
|
51
53
|
@return_ = return_
|
|
@@ -61,6 +63,7 @@ module Moov
|
|
|
61
63
|
@failed_on = failed_on
|
|
62
64
|
@completed_on = completed_on
|
|
63
65
|
@debit_hold_period = debit_hold_period
|
|
66
|
+
@addenda = addenda
|
|
64
67
|
end
|
|
65
68
|
|
|
66
69
|
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
@@ -81,6 +84,7 @@ module Moov
|
|
|
81
84
|
return false unless @failed_on == other.failed_on
|
|
82
85
|
return false unless @completed_on == other.completed_on
|
|
83
86
|
return false unless @debit_hold_period == other.debit_hold_period
|
|
87
|
+
return false unless @addenda == other.addenda
|
|
84
88
|
true
|
|
85
89
|
end
|
|
86
90
|
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module Moov
|
|
8
|
+
module Models
|
|
9
|
+
module Components
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CreateInvoicePayment
|
|
13
|
+
extend T::Sig
|
|
14
|
+
include Crystalline::MetadataFields
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
field :foreign_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('foreignID') } }
|
|
18
|
+
|
|
19
|
+
field :description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('description') } }
|
|
20
|
+
|
|
21
|
+
field :payment_date, Crystalline::Nilable.new(::DateTime), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('paymentDate'), 'decoder': Utils.datetime_from_iso_format(true) } }
|
|
22
|
+
|
|
23
|
+
sig { params(foreign_id: T.nilable(::String), description: T.nilable(::String), payment_date: T.nilable(::DateTime)).void }
|
|
24
|
+
def initialize(foreign_id: nil, description: nil, payment_date: nil)
|
|
25
|
+
@foreign_id = foreign_id
|
|
26
|
+
@description = description
|
|
27
|
+
@payment_date = payment_date
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
31
|
+
def ==(other)
|
|
32
|
+
return false unless other.is_a? self.class
|
|
33
|
+
return false unless @foreign_id == other.foreign_id
|
|
34
|
+
return false unless @description == other.description
|
|
35
|
+
return false unless @payment_date == other.payment_date
|
|
36
|
+
true
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Moov::Models::Components::CreateInvoicePayment
|
|
6
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Moov::Models::Components::CreateInvoicePayment
|
|
11
|
+
def foreign_id(); end
|
|
12
|
+
def foreign_id=(str_); end
|
|
13
|
+
def description(); end
|
|
14
|
+
def description=(str_); end
|
|
15
|
+
def payment_date(); end
|
|
16
|
+
def payment_date=(str_); end
|
|
17
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module Moov
|
|
8
|
+
module Models
|
|
9
|
+
module Components
|
|
10
|
+
|
|
11
|
+
# An addenda record to be added to an ACH transfer
|
|
12
|
+
class CreateTransferACHAddendaRecord
|
|
13
|
+
extend T::Sig
|
|
14
|
+
include Crystalline::MetadataFields
|
|
15
|
+
|
|
16
|
+
# The raw ACH addenda record. Must only contain valid NACHA characters
|
|
17
|
+
field :record, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('record'), required: true } }
|
|
18
|
+
|
|
19
|
+
sig { params(record: ::String).void }
|
|
20
|
+
def initialize(record:)
|
|
21
|
+
@record = record
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
25
|
+
def ==(other)
|
|
26
|
+
return false unless other.is_a? self.class
|
|
27
|
+
return false unless @record == other.record
|
|
28
|
+
true
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Moov::Models::Components::CreateTransferACHAddendaRecord
|
|
6
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Moov::Models::Components::CreateTransferACHAddendaRecord
|
|
11
|
+
def record(); end
|
|
12
|
+
def record=(str_); end
|
|
13
|
+
end
|
|
@@ -18,10 +18,13 @@ module Moov
|
|
|
18
18
|
# An optional override of the default NACHA company name for a transfer.
|
|
19
19
|
field :originating_company_name, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('originatingCompanyName') } }
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
field :addenda, Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::CreateTransferACHAddendaRecord)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('addenda') } }
|
|
22
|
+
|
|
23
|
+
sig { params(company_entry_description: T.nilable(::String), originating_company_name: T.nilable(::String), addenda: T.nilable(T::Array[Models::Components::CreateTransferACHAddendaRecord])).void }
|
|
24
|
+
def initialize(company_entry_description: nil, originating_company_name: nil, addenda: nil)
|
|
23
25
|
@company_entry_description = company_entry_description
|
|
24
26
|
@originating_company_name = originating_company_name
|
|
27
|
+
@addenda = addenda
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
@@ -29,6 +32,7 @@ module Moov
|
|
|
29
32
|
return false unless other.is_a? self.class
|
|
30
33
|
return false unless @company_entry_description == other.company_entry_description
|
|
31
34
|
return false unless @originating_company_name == other.originating_company_name
|
|
35
|
+
return false unless @addenda == other.addenda
|
|
32
36
|
true
|
|
33
37
|
end
|
|
34
38
|
end
|
|
@@ -22,12 +22,15 @@ module Moov
|
|
|
22
22
|
# Code used to identify the ACH authorization method.
|
|
23
23
|
field :sec_code, Crystalline::Nilable.new(Models::Components::SECCode), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('secCode'), 'decoder': Utils.enum_from_string(Models::Components::SECCode, true) } }
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
field :addenda, Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::CreateTransferACHAddendaRecord)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('addenda') } }
|
|
26
|
+
|
|
27
|
+
sig { params(company_entry_description: T.nilable(::String), originating_company_name: T.nilable(::String), debit_hold_period: T.nilable(Models::Components::DebitHoldPeriod), sec_code: T.nilable(Models::Components::SECCode), addenda: T.nilable(T::Array[Models::Components::CreateTransferACHAddendaRecord])).void }
|
|
28
|
+
def initialize(company_entry_description: nil, originating_company_name: nil, debit_hold_period: nil, sec_code: nil, addenda: nil)
|
|
27
29
|
@company_entry_description = company_entry_description
|
|
28
30
|
@originating_company_name = originating_company_name
|
|
29
31
|
@debit_hold_period = debit_hold_period
|
|
30
32
|
@sec_code = sec_code
|
|
33
|
+
@addenda = addenda
|
|
31
34
|
end
|
|
32
35
|
|
|
33
36
|
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
@@ -37,6 +40,7 @@ module Moov
|
|
|
37
40
|
return false unless @originating_company_name == other.originating_company_name
|
|
38
41
|
return false unless @debit_hold_period == other.debit_hold_period
|
|
39
42
|
return false unless @sec_code == other.sec_code
|
|
43
|
+
return false unless @addenda == other.addenda
|
|
40
44
|
true
|
|
41
45
|
end
|
|
42
46
|
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module Moov
|
|
8
|
+
module Models
|
|
9
|
+
module Components
|
|
10
|
+
|
|
11
|
+
# Request body for creating a new webhook.
|
|
12
|
+
class CreateWebhook
|
|
13
|
+
extend T::Sig
|
|
14
|
+
include Crystalline::MetadataFields
|
|
15
|
+
|
|
16
|
+
# The URL where webhook events will be sent.
|
|
17
|
+
field :url, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('url'), required: true } }
|
|
18
|
+
# The status of the webhook.
|
|
19
|
+
field :status, Models::Components::WebhookStatus, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('status'), required: true, 'decoder': Utils.enum_from_string(Models::Components::WebhookStatus, false) } }
|
|
20
|
+
# The list of event types this webhook should subscribe to.
|
|
21
|
+
field :event_types, Crystalline::Array.new(Models::Components::WebhookEventType), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('eventTypes'), required: true } }
|
|
22
|
+
# A description of the webhook for reference. Can be an empty string.
|
|
23
|
+
field :description, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('description'), required: true } }
|
|
24
|
+
|
|
25
|
+
sig { params(url: ::String, status: Models::Components::WebhookStatus, event_types: T::Array[Models::Components::WebhookEventType], description: ::String).void }
|
|
26
|
+
def initialize(url:, status:, event_types:, description:)
|
|
27
|
+
@url = url
|
|
28
|
+
@status = status
|
|
29
|
+
@event_types = event_types
|
|
30
|
+
@description = description
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
34
|
+
def ==(other)
|
|
35
|
+
return false unless other.is_a? self.class
|
|
36
|
+
return false unless @url == other.url
|
|
37
|
+
return false unless @status == other.status
|
|
38
|
+
return false unless @event_types == other.event_types
|
|
39
|
+
return false unless @description == other.description
|
|
40
|
+
true
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Moov::Models::Components::CreateWebhook
|
|
6
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Moov::Models::Components::CreateWebhook
|
|
11
|
+
def url(); end
|
|
12
|
+
def url=(str_); end
|
|
13
|
+
def status(); end
|
|
14
|
+
def status=(str_); end
|
|
15
|
+
def event_types(); end
|
|
16
|
+
def event_types=(str_); end
|
|
17
|
+
def description(); end
|
|
18
|
+
def description=(str_); end
|
|
19
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module Moov
|
|
8
|
+
module Models
|
|
9
|
+
module Components
|
|
10
|
+
|
|
11
|
+
# Describes an available event type that can be subscribed to.
|
|
12
|
+
class EventType
|
|
13
|
+
extend T::Sig
|
|
14
|
+
include Crystalline::MetadataFields
|
|
15
|
+
|
|
16
|
+
# Unique identifier for the event type.
|
|
17
|
+
field :event_type_id, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('eventTypeID'), required: true } }
|
|
18
|
+
# The type identifier string.
|
|
19
|
+
field :type, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('type'), required: true } }
|
|
20
|
+
# A human-readable description of the event type.
|
|
21
|
+
field :description, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('description'), required: true } }
|
|
22
|
+
|
|
23
|
+
sig { params(event_type_id: ::String, type: ::String, description: ::String).void }
|
|
24
|
+
def initialize(event_type_id:, type:, description:)
|
|
25
|
+
@event_type_id = event_type_id
|
|
26
|
+
@type = type
|
|
27
|
+
@description = description
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
31
|
+
def ==(other)
|
|
32
|
+
return false unless other.is_a? self.class
|
|
33
|
+
return false unless @event_type_id == other.event_type_id
|
|
34
|
+
return false unless @type == other.type
|
|
35
|
+
return false unless @description == other.description
|
|
36
|
+
true
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|