moov_ruby 26.7.6 → 26.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/lib/moov/invoices.rb +180 -0
  3. data/lib/moov/models/components/createdtransfer.rb +2 -1
  4. data/lib/moov/models/components/createinvoice.rb +14 -2
  5. data/lib/moov/models/components/createinvoice.rbi +6 -0
  6. data/lib/moov/models/components/createinvoicenotification.rb +32 -0
  7. data/lib/moov/models/components/createinvoicenotification.rbi +13 -0
  8. data/lib/moov/models/components/invoice.rb +6 -2
  9. data/lib/moov/models/components/invoice.rbi +2 -0
  10. data/lib/moov/models/components/invoicenotificationlimitedchannel.rb +36 -0
  11. data/lib/moov/models/components/invoicenotificationlimitedchannel.rbi +15 -0
  12. data/lib/moov/models/components/invoicepaymentoptions.rb +40 -0
  13. data/lib/moov/models/components/invoicepaymentoptions.rbi +17 -0
  14. data/lib/moov/models/components/invoicepaymentoptionserror.rb +40 -0
  15. data/lib/moov/models/components/invoicepaymentoptionserror.rbi +17 -0
  16. data/lib/moov/models/components/invoicepaymentoptionsupdate.rb +40 -0
  17. data/lib/moov/models/components/invoicepaymentoptionsupdate.rbi +17 -0
  18. data/lib/moov/models/components/notificationchannel.rb +18 -0
  19. data/lib/moov/models/components/notificationchannel.rbi +11 -0
  20. data/lib/moov/models/components/transfer.rb +2 -1
  21. data/lib/moov/models/components/updateinvoice.rb +6 -2
  22. data/lib/moov/models/components/updateinvoice.rbi +2 -0
  23. data/lib/moov/models/components/webhookdatatransferstatus.rb +1 -0
  24. data/lib/moov/models/components.rb +6 -0
  25. data/lib/moov/models/errors/createinvoiceerror.rb +14 -2
  26. data/lib/moov/models/errors/createinvoiceerror.rbi +6 -0
  27. data/lib/moov/models/errors/invoicenotificationerror.rb +36 -0
  28. data/lib/moov/models/errors/invoicenotificationerror.rbi +15 -0
  29. data/lib/moov/models/errors/invoicenotificationratelimitederror.rb +44 -0
  30. data/lib/moov/models/errors/invoicenotificationratelimitederror.rbi +19 -0
  31. data/lib/moov/models/errors/transfer_error.rb +2 -1
  32. data/lib/moov/models/errors/updateinvoiceerror.rb +6 -2
  33. data/lib/moov/models/errors/updateinvoiceerror.rbi +2 -0
  34. data/lib/moov/models/errors.rb +2 -0
  35. data/lib/moov/models/operations/createcancellation_request.rb +7 -2
  36. data/lib/moov/models/operations/createcancellation_request.rbi +2 -0
  37. data/lib/moov/models/operations/createinvoicenotification_request.rb +40 -0
  38. data/lib/moov/models/operations/createinvoicenotification_request.rbi +17 -0
  39. data/lib/moov/models/operations/createinvoicenotification_response.rb +44 -0
  40. data/lib/moov/models/operations/createinvoicenotification_response.rbi +19 -0
  41. data/lib/moov/models/operations/initiaterefund_request.rb +1 -1
  42. data/lib/moov/models/operations/listtransfers_request.rb +6 -2
  43. data/lib/moov/models/operations/listtransfers_request.rbi +2 -0
  44. data/lib/moov/models/operations.rb +2 -0
  45. data/lib/moov/sdkconfiguration.rb +3 -3
  46. data/lib/moov/transfers.rb +6 -4
  47. metadata +22 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbdc3bfeeaa1eeacfe4697a3d039bdc2c3ea8b32bbbdae9503f7b8bd9095943b
4
- data.tar.gz: fa96bc77d5f0ded970566ed8815755ce996eacbc81fafb18d6a51ece39c45901
3
+ metadata.gz: '056404601592483f61cd96209f30f7fa2e6678857334b8ddb1e2031a5ebaad19'
4
+ data.tar.gz: aa948b716cdf93fdcaf5ab6c38fb4bd8fd2a1ca27210c46f00c6012d44248597
5
5
  SHA512:
6
- metadata.gz: 9c37cf4b253bb6251578dd52ea3f3285d283a2703ea39cd4717af853200d4851919a81eeb4d058455cbe5dad4fd5151aa3a2552f8fb4a282be946ee5aa326487
7
- data.tar.gz: 29fc5925c23635f28225d1069dde0cea188e697f4bdb9207d321665ab1bde882ebdfe01621941c302f55e03118855f2c55ab610ca9731c907a3d124e47aa9177
6
+ metadata.gz: eb4103b1ab602aa2ec46013374683d53b567154e20ac375592c6b81d28bd9d0be72ec9f6447be0cb60063800613c2311523500ca0a5c6fcda84ac65ff00589a3
7
+ data.tar.gz: c18153fa936791c5420e0810f7db97347b3b4200f964d60615cad84f8e3ff3b5126647a9db414376e36a12765ee20b8c9020a6d9944e97874e780afcbd4b67bd
data/lib/moov/invoices.rb CHANGED
@@ -766,6 +766,186 @@ module Moov
766
766
  end
767
767
 
768
768
 
769
+ sig { params(create_invoice_notification: Models::Components::CreateInvoiceNotification, account_id: ::String, invoice_id: ::String, timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::CreateInvoiceNotificationResponse) }
770
+ def create_invoice_notification(create_invoice_notification:, account_id:, invoice_id:, timeout_ms: nil, http_headers: nil)
771
+ # create_invoice_notification - Create a notification for an invoice, which resends the invoice email to the customer. The required
772
+ # `channels` body lists the channels to notify on; today only `email` is supported. Returns a 409
773
+ # if the invoice is not in `unpaid` or `overdue` status, or if the merchant or customer account has no
774
+ # email set.
775
+ #
776
+ # The request is all-or-nothing: if any requested channel is rate limited, nothing is sent. Each channel
777
+ # can be sent at most once every 24 hours, and not within 24 hours of the invoice being sent. A 429
778
+ # response lists the limited channels with `availableOn` and lists the `availableChannels` that can be
779
+ # sent in a new request.
780
+ #
781
+ # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
782
+ # you'll need to specify the `/accounts/{accountID}/invoices.write` scope.
783
+ request = Models::Operations::CreateInvoiceNotificationRequest.new(
784
+ account_id: account_id,
785
+ invoice_id: invoice_id,
786
+ create_invoice_notification: create_invoice_notification
787
+ )
788
+ url, params = @sdk_configuration.get_server_details
789
+ base_url = Utils.template_url(url, params)
790
+ url = Utils.generate_url(
791
+ Models::Operations::CreateInvoiceNotificationRequest,
792
+ base_url,
793
+ '/accounts/{accountID}/invoices/{invoiceID}/notifications',
794
+ request
795
+ )
796
+ headers = {}
797
+ headers = T.cast(headers, T::Hash[String, String])
798
+ req_content_type, data, form = Utils.serialize_request_body(request, false, false, :create_invoice_notification, :json)
799
+ headers['content-type'] = req_content_type
800
+ raise StandardError, 'request body is required' if data.nil? && form.nil?
801
+
802
+ if form && !form.empty?
803
+ body = Utils.encode_form(form)
804
+ elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
805
+ body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object]))
806
+ else
807
+ body = data
808
+ end
809
+ headers['Accept'] = 'application/json'
810
+ headers['user-agent'] = @sdk_configuration.user_agent
811
+
812
+ security = @sdk_configuration.security_source&.call
813
+
814
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
815
+ timeout ||= @sdk_configuration.timeout
816
+
817
+
818
+ connection = @sdk_configuration.client
819
+
820
+ hook_ctx = SDKHooks::HookContext.new(
821
+ config: @sdk_configuration,
822
+ base_url: base_url,
823
+ oauth2_scopes: nil,
824
+ operation_id: 'createInvoiceNotification',
825
+ security_source: @sdk_configuration.security_source
826
+ )
827
+
828
+ error = T.let(nil, T.nilable(StandardError))
829
+ http_response = T.let(nil, T.nilable(Faraday::Response))
830
+
831
+
832
+ begin
833
+ http_response = T.must(connection).post(url) do |req|
834
+ req.body = body
835
+ req.headers.merge!(headers)
836
+ req.options.timeout = timeout unless timeout.nil?
837
+ Utils.configure_request_security(req, security)
838
+ http_headers&.each do |key, value|
839
+ req.headers[key.to_s] = value
840
+ end
841
+
842
+ @sdk_configuration.hooks.before_request(
843
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
844
+ hook_ctx: hook_ctx
845
+ ),
846
+ request: req
847
+ )
848
+ end
849
+ rescue StandardError => e
850
+ error = e
851
+ ensure
852
+ if http_response.nil? || Utils.error_status?(http_response.status)
853
+ http_response = @sdk_configuration.hooks.after_error(
854
+ error: error,
855
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
856
+ hook_ctx: hook_ctx
857
+ ),
858
+ response: http_response
859
+ )
860
+ else
861
+ http_response = @sdk_configuration.hooks.after_success(
862
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
863
+ hook_ctx: hook_ctx
864
+ ),
865
+ response: http_response
866
+ )
867
+ end
868
+
869
+ if http_response.nil?
870
+ raise error if !error.nil?
871
+ raise 'no response'
872
+ end
873
+ end
874
+
875
+ content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
876
+ if Utils.match_status_code(http_response.status, ['204'])
877
+ http_response = @sdk_configuration.hooks.after_success(
878
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
879
+ hook_ctx: hook_ctx
880
+ ),
881
+ response: http_response
882
+ )
883
+ return Models::Operations::CreateInvoiceNotificationResponse.new(
884
+ status_code: http_response.status,
885
+ content_type: content_type,
886
+ raw_response: http_response,
887
+ headers: {}
888
+ )
889
+ elsif Utils.match_status_code(http_response.status, ['401', '403', '404'])
890
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
891
+ elsif Utils.match_status_code(http_response.status, ['400', '409'])
892
+ if Utils.match_content_type(content_type, 'application/json')
893
+ http_response = @sdk_configuration.hooks.after_success(
894
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
895
+ hook_ctx: hook_ctx
896
+ ),
897
+ response: http_response
898
+ )
899
+ response_data = http_response.env.response_body
900
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::GenericError)
901
+ obj.raw_response = http_response
902
+ raise obj
903
+ else
904
+ 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'
905
+ end
906
+ elsif Utils.match_status_code(http_response.status, ['422'])
907
+ if Utils.match_content_type(content_type, 'application/json')
908
+ http_response = @sdk_configuration.hooks.after_success(
909
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
910
+ hook_ctx: hook_ctx
911
+ ),
912
+ response: http_response
913
+ )
914
+ response_data = http_response.env.response_body
915
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InvoiceNotificationError)
916
+ obj.raw_response = http_response
917
+ raise obj
918
+ else
919
+ 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'
920
+ end
921
+ elsif Utils.match_status_code(http_response.status, ['429'])
922
+ if Utils.match_content_type(content_type, 'application/json')
923
+ http_response = @sdk_configuration.hooks.after_success(
924
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
925
+ hook_ctx: hook_ctx
926
+ ),
927
+ response: http_response
928
+ )
929
+ response_data = http_response.env.response_body
930
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InvoiceNotificationRateLimitedError)
931
+ obj.raw_response = http_response
932
+ raise obj
933
+ else
934
+ 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'
935
+ end
936
+ elsif Utils.match_status_code(http_response.status, ['500', '504'])
937
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
938
+ elsif Utils.match_status_code(http_response.status, ['4XX'])
939
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
940
+ elsif Utils.match_status_code(http_response.status, ['5XX'])
941
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
942
+ else
943
+ 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'
944
+
945
+ end
946
+ end
947
+
948
+
769
949
  sig { params(create_invoice_payment: Models::Components::CreateInvoicePayment, account_id: ::String, invoice_id: ::String, timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::CreateInvoicePaymentResponse) }
770
950
  def create_invoice_payment(create_invoice_payment:, account_id:, invoice_id:, timeout_ms: nil, http_headers: nil)
771
951
  # create_invoice_payment - Creates a payment resource to represent that an invoice was paid outside of the Moov platform.
@@ -68,7 +68,8 @@ module Moov
68
68
  # An optional collection of line items for a transfer.
69
69
  # When line items are provided, their total plus tax must equal the transfer amount.
70
70
  field :line_items, Crystalline::Nilable.new(Models::Components::TransferLineItems), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('lineItems') } }
71
-
71
+ # The tip, tax, and surcharge portion of the transfer amount.
72
+ # For an auth-capture `card-payment` transfer, this is the aggregate of all captures' `amountDetails`.
72
73
  field :amount_details, Crystalline::Nilable.new(Models::Components::TransferAmountDetails), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('amountDetails') } }
73
74
  # The card authorization and capture IDs associated with a transfer.
74
75
  field :capture, Crystalline::Nilable.new(Models::Components::TransferCapture), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('capture') } }
@@ -16,22 +16,31 @@ module Moov
16
16
  field :customer_account_id, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('customerAccountID'), required: true } }
17
17
  # A collection of line items for an invoice.
18
18
  field :line_items, Models::Components::CreateInvoiceLineItems, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('lineItems'), required: true } }
19
+ # Email address to use for invoice checkout OTP verification instead of the customer account email.
20
+ field :customer_email, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('customerEmail') } }
21
+ # Optional merchant-defined invoice number, up to 64 characters. Must be unique for the account. If omitted, empty, or whitespace-only, the next number in the INV-<n> sequence is assigned automatically.
22
+ field :invoice_number, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('invoiceNumber') } }
19
23
 
20
24
  field :description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('description') } }
21
25
 
22
26
  field :invoice_date, Crystalline::Nilable.new(::DateTime), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('invoiceDate'), 'decoder': ::Moov::Utils.datetime_from_iso_format(true) } }
23
27
 
24
28
  field :due_date, Crystalline::Nilable.new(::DateTime), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('dueDate'), 'decoder': ::Moov::Utils.datetime_from_iso_format(true) } }
29
+ # Payment options for the invoice.
30
+ field :payment, Crystalline::Nilable.new(Models::Components::InvoicePaymentOptions), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('payment') } }
25
31
 
26
32
  field :amount_details, Crystalline::Nilable.new(Models::Components::AmountDetails), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('amountDetails') } }
27
33
 
28
- sig { params(customer_account_id: ::String, line_items: Models::Components::CreateInvoiceLineItems, description: T.nilable(::String), invoice_date: T.nilable(::DateTime), due_date: T.nilable(::DateTime), amount_details: T.nilable(Models::Components::AmountDetails)).void }
29
- def initialize(customer_account_id:, line_items:, description: nil, invoice_date: nil, due_date: nil, amount_details: nil)
34
+ sig { params(customer_account_id: ::String, line_items: Models::Components::CreateInvoiceLineItems, customer_email: T.nilable(::String), invoice_number: T.nilable(::String), description: T.nilable(::String), invoice_date: T.nilable(::DateTime), due_date: T.nilable(::DateTime), payment: T.nilable(Models::Components::InvoicePaymentOptions), amount_details: T.nilable(Models::Components::AmountDetails)).void }
35
+ def initialize(customer_account_id:, line_items:, customer_email: nil, invoice_number: nil, description: nil, invoice_date: nil, due_date: nil, payment: nil, amount_details: nil)
30
36
  @customer_account_id = customer_account_id
31
37
  @line_items = line_items
38
+ @customer_email = customer_email
39
+ @invoice_number = invoice_number
32
40
  @description = description
33
41
  @invoice_date = invoice_date
34
42
  @due_date = due_date
43
+ @payment = payment
35
44
  @amount_details = amount_details
36
45
  end
37
46
 
@@ -40,9 +49,12 @@ module Moov
40
49
  return false unless other.is_a? self.class
41
50
  return false unless @customer_account_id == other.customer_account_id
42
51
  return false unless @line_items == other.line_items
52
+ return false unless @customer_email == other.customer_email
53
+ return false unless @invoice_number == other.invoice_number
43
54
  return false unless @description == other.description
44
55
  return false unless @invoice_date == other.invoice_date
45
56
  return false unless @due_date == other.due_date
57
+ return false unless @payment == other.payment
46
58
  return false unless @amount_details == other.amount_details
47
59
  true
48
60
  end
@@ -12,12 +12,18 @@ class Moov::Models::Components::CreateInvoice
12
12
  def customer_account_id=(str_); end
13
13
  def line_items(); end
14
14
  def line_items=(str_); end
15
+ def customer_email(); end
16
+ def customer_email=(str_); end
17
+ def invoice_number(); end
18
+ def invoice_number=(str_); end
15
19
  def description(); end
16
20
  def description=(str_); end
17
21
  def invoice_date(); end
18
22
  def invoice_date=(str_); end
19
23
  def due_date(); end
20
24
  def due_date=(str_); end
25
+ def payment(); end
26
+ def payment=(str_); end
21
27
  def amount_details(); end
22
28
  def amount_details=(str_); end
23
29
  end
@@ -0,0 +1,32 @@
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
+ class CreateInvoiceNotification
12
+ extend T::Sig
13
+ include Crystalline::MetadataFields
14
+
15
+ # The channels to send the notification on. Required, must contain at least one channel.
16
+ field :channels, Crystalline::Array.new(Models::Components::NotificationChannel), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('channels'), required: true } }
17
+
18
+ sig { params(channels: T::Array[Models::Components::NotificationChannel]).void }
19
+ def initialize(channels:)
20
+ @channels = channels
21
+ end
22
+
23
+ sig { params(other: T.untyped).returns(T::Boolean) }
24
+ def ==(other)
25
+ return false unless other.is_a? self.class
26
+ return false unless @channels == other.channels
27
+ true
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,13 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::CreateInvoiceNotification
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::CreateInvoiceNotification
11
+ def channels(); end
12
+ def channels=(str_); end
13
+ end
@@ -50,6 +50,8 @@ module Moov
50
50
  field :payment_link_code, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('paymentLinkCode') } }
51
51
  # URL to the hosted payment link for the invoice.
52
52
  field :payment_link_url, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('paymentLinkURL') } }
53
+ # Payment options for the invoice.
54
+ field :payment, Crystalline::Nilable.new(Models::Components::InvoicePaymentOptions), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('payment') } }
53
55
  # Payment made towards an invoice, will be either a transfer or an external payment.
54
56
  field :invoice_payments, Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::InvoicePayment)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('invoicePayments') } }
55
57
 
@@ -65,8 +67,8 @@ module Moov
65
67
 
66
68
  field :disabled_on, Crystalline::Nilable.new(::DateTime), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('disabledOn'), 'decoder': ::Moov::Utils.datetime_from_iso_format(true) } }
67
69
 
68
- sig { params(invoice_id: ::String, invoice_number: ::String, customer_account_id: ::String, customer_display_name: ::String, customer_email: ::String, partner_account_id: ::String, status: Models::Components::InvoiceStatus, line_items: Models::Components::InvoiceLineItems, subtotal_amount: Models::Components::AmountDecimal, total_amount: Models::Components::AmountDecimal, pending_amount: Models::Components::AmountDecimal, paid_amount: Models::Components::AmountDecimal, refunded_amount: Models::Components::AmountDecimal, disputed_amount: Models::Components::AmountDecimal, created_on: ::DateTime, description: T.nilable(::String), amount_details: T.nilable(Models::Components::AmountDetails), payment_link_code: T.nilable(::String), payment_link_url: T.nilable(::String), invoice_payments: T.nilable(T::Array[Models::Components::InvoicePayment]), invoice_date: T.nilable(::DateTime), due_date: T.nilable(::DateTime), sent_on: T.nilable(::DateTime), paid_on: T.nilable(::DateTime), canceled_on: T.nilable(::DateTime), disabled_on: T.nilable(::DateTime)).void }
69
- def initialize(invoice_id:, invoice_number:, customer_account_id:, customer_display_name:, customer_email:, partner_account_id:, status:, line_items:, subtotal_amount:, total_amount:, pending_amount:, paid_amount:, refunded_amount:, disputed_amount:, created_on:, description: nil, amount_details: nil, payment_link_code: nil, payment_link_url: nil, invoice_payments: nil, invoice_date: nil, due_date: nil, sent_on: nil, paid_on: nil, canceled_on: nil, disabled_on: nil)
70
+ sig { params(invoice_id: ::String, invoice_number: ::String, customer_account_id: ::String, customer_display_name: ::String, customer_email: ::String, partner_account_id: ::String, status: Models::Components::InvoiceStatus, line_items: Models::Components::InvoiceLineItems, subtotal_amount: Models::Components::AmountDecimal, total_amount: Models::Components::AmountDecimal, pending_amount: Models::Components::AmountDecimal, paid_amount: Models::Components::AmountDecimal, refunded_amount: Models::Components::AmountDecimal, disputed_amount: Models::Components::AmountDecimal, created_on: ::DateTime, description: T.nilable(::String), amount_details: T.nilable(Models::Components::AmountDetails), payment_link_code: T.nilable(::String), payment_link_url: T.nilable(::String), payment: T.nilable(Models::Components::InvoicePaymentOptions), invoice_payments: T.nilable(T::Array[Models::Components::InvoicePayment]), invoice_date: T.nilable(::DateTime), due_date: T.nilable(::DateTime), sent_on: T.nilable(::DateTime), paid_on: T.nilable(::DateTime), canceled_on: T.nilable(::DateTime), disabled_on: T.nilable(::DateTime)).void }
71
+ def initialize(invoice_id:, invoice_number:, customer_account_id:, customer_display_name:, customer_email:, partner_account_id:, status:, line_items:, subtotal_amount:, total_amount:, pending_amount:, paid_amount:, refunded_amount:, disputed_amount:, created_on:, description: nil, amount_details: nil, payment_link_code: nil, payment_link_url: nil, payment: nil, invoice_payments: nil, invoice_date: nil, due_date: nil, sent_on: nil, paid_on: nil, canceled_on: nil, disabled_on: nil)
70
72
  @invoice_id = invoice_id
71
73
  @invoice_number = invoice_number
72
74
  @customer_account_id = customer_account_id
@@ -86,6 +88,7 @@ module Moov
86
88
  @amount_details = amount_details
87
89
  @payment_link_code = payment_link_code
88
90
  @payment_link_url = payment_link_url
91
+ @payment = payment
89
92
  @invoice_payments = invoice_payments
90
93
  @invoice_date = invoice_date
91
94
  @due_date = due_date
@@ -117,6 +120,7 @@ module Moov
117
120
  return false unless @amount_details == other.amount_details
118
121
  return false unless @payment_link_code == other.payment_link_code
119
122
  return false unless @payment_link_url == other.payment_link_url
123
+ return false unless @payment == other.payment
120
124
  return false unless @invoice_payments == other.invoice_payments
121
125
  return false unless @invoice_date == other.invoice_date
122
126
  return false unless @due_date == other.due_date
@@ -46,6 +46,8 @@ class Moov::Models::Components::Invoice
46
46
  def payment_link_code=(str_); end
47
47
  def payment_link_url(); end
48
48
  def payment_link_url=(str_); end
49
+ def payment(); end
50
+ def payment=(str_); end
49
51
  def invoice_payments(); end
50
52
  def invoice_payments=(str_); end
51
53
  def invoice_date(); end
@@ -0,0 +1,36 @@
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
+ class InvoiceNotificationLimitedChannel
12
+ extend T::Sig
13
+ include Crystalline::MetadataFields
14
+
15
+
16
+ field :channel, Models::Components::NotificationChannel, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('channel'), required: true, 'decoder': ::Moov::Utils.enum_from_string(Models::Components::NotificationChannel, false) } }
17
+ # When a notification to the channel can be sent again.
18
+ field :available_on, ::DateTime, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('availableOn'), required: true, 'decoder': ::Moov::Utils.datetime_from_iso_format(false) } }
19
+
20
+ sig { params(channel: Models::Components::NotificationChannel, available_on: ::DateTime).void }
21
+ def initialize(channel:, available_on:)
22
+ @channel = channel
23
+ @available_on = available_on
24
+ end
25
+
26
+ sig { params(other: T.untyped).returns(T::Boolean) }
27
+ def ==(other)
28
+ return false unless other.is_a? self.class
29
+ return false unless @channel == other.channel
30
+ return false unless @available_on == other.available_on
31
+ true
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,15 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::InvoiceNotificationLimitedChannel
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::InvoiceNotificationLimitedChannel
11
+ def channel(); end
12
+ def channel=(str_); end
13
+ def available_on(); end
14
+ def available_on=(str_); end
15
+ end
@@ -0,0 +1,40 @@
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
+ # Payment options for an invoice.
11
+ class InvoicePaymentOptions
12
+ extend T::Sig
13
+ include Crystalline::MetadataFields
14
+
15
+ # Payment methods the customer can use to pay the invoice. If omitted, all methods the merchant supports are allowed. The request is rejected if a listed method is not supported by the merchant.
16
+ field :allowed_methods, Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::CollectionPaymentMethodType)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('allowedMethods') } }
17
+ # Options for payment links used to collect a card payment.
18
+ field :card_details, Crystalline::Nilable.new(Models::Components::CardPaymentDetails), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('cardDetails') } }
19
+ # Options for payment links used to collect an ACH payment.
20
+ field :ach_details, Crystalline::Nilable.new(Models::Components::ACHPaymentDetails), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('achDetails') } }
21
+
22
+ sig { params(allowed_methods: T.nilable(T::Array[Models::Components::CollectionPaymentMethodType]), card_details: T.nilable(Models::Components::CardPaymentDetails), ach_details: T.nilable(Models::Components::ACHPaymentDetails)).void }
23
+ def initialize(allowed_methods: nil, card_details: nil, ach_details: nil)
24
+ @allowed_methods = allowed_methods
25
+ @card_details = card_details
26
+ @ach_details = ach_details
27
+ end
28
+
29
+ sig { params(other: T.untyped).returns(T::Boolean) }
30
+ def ==(other)
31
+ return false unless other.is_a? self.class
32
+ return false unless @allowed_methods == other.allowed_methods
33
+ return false unless @card_details == other.card_details
34
+ return false unless @ach_details == other.ach_details
35
+ true
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,17 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::InvoicePaymentOptions
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::InvoicePaymentOptions
11
+ def allowed_methods(); end
12
+ def allowed_methods=(str_); end
13
+ def card_details(); end
14
+ def card_details=(str_); end
15
+ def ach_details(); end
16
+ def ach_details=(str_); end
17
+ end
@@ -0,0 +1,40 @@
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
+ class InvoicePaymentOptionsError
12
+ extend T::Sig
13
+ include Crystalline::MetadataFields
14
+
15
+
16
+ field :allowed_methods, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('allowedMethods') } }
17
+
18
+ field :card_details, Crystalline::Nilable.new(Models::Components::CardPaymentDetailsError), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('cardDetails') } }
19
+
20
+ field :ach_details, Crystalline::Nilable.new(Models::Components::ACHPaymentDetailsError), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('achDetails') } }
21
+
22
+ sig { params(allowed_methods: T.nilable(::String), card_details: T.nilable(Models::Components::CardPaymentDetailsError), ach_details: T.nilable(Models::Components::ACHPaymentDetailsError)).void }
23
+ def initialize(allowed_methods: nil, card_details: nil, ach_details: nil)
24
+ @allowed_methods = allowed_methods
25
+ @card_details = card_details
26
+ @ach_details = ach_details
27
+ end
28
+
29
+ sig { params(other: T.untyped).returns(T::Boolean) }
30
+ def ==(other)
31
+ return false unless other.is_a? self.class
32
+ return false unless @allowed_methods == other.allowed_methods
33
+ return false unless @card_details == other.card_details
34
+ return false unless @ach_details == other.ach_details
35
+ true
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,17 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::InvoicePaymentOptionsError
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::InvoicePaymentOptionsError
11
+ def allowed_methods(); end
12
+ def allowed_methods=(str_); end
13
+ def card_details(); end
14
+ def card_details=(str_); end
15
+ def ach_details(); end
16
+ def ach_details=(str_); end
17
+ end
@@ -0,0 +1,40 @@
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
+ # Payment options to update on an invoice.
11
+ class InvoicePaymentOptionsUpdate
12
+ extend T::Sig
13
+ include Crystalline::MetadataFields
14
+
15
+ # Options for payment links used to collect a card payment.
16
+ field :card_details, Crystalline::Nilable.new(Models::Components::CardPaymentDetails), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('cardDetails') } }
17
+ # Options for payment links used to collect an ACH payment.
18
+ field :ach_details, Crystalline::Nilable.new(Models::Components::ACHPaymentDetails), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('achDetails') } }
19
+ # Payment methods the customer can use to pay the invoice. Omit to leave unchanged. Set to null to allow all methods the merchant supports. The request is rejected if a listed method is not supported by the merchant.
20
+ field :allowed_methods, Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::CollectionPaymentMethodType)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('allowedMethods') } }
21
+
22
+ sig { params(card_details: T.nilable(Models::Components::CardPaymentDetails), ach_details: T.nilable(Models::Components::ACHPaymentDetails), allowed_methods: T.nilable(T::Array[Models::Components::CollectionPaymentMethodType])).void }
23
+ def initialize(card_details: nil, ach_details: nil, allowed_methods: nil)
24
+ @card_details = card_details
25
+ @ach_details = ach_details
26
+ @allowed_methods = allowed_methods
27
+ end
28
+
29
+ sig { params(other: T.untyped).returns(T::Boolean) }
30
+ def ==(other)
31
+ return false unless other.is_a? self.class
32
+ return false unless @card_details == other.card_details
33
+ return false unless @ach_details == other.ach_details
34
+ return false unless @allowed_methods == other.allowed_methods
35
+ true
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,17 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::InvoicePaymentOptionsUpdate
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::InvoicePaymentOptionsUpdate
11
+ def card_details(); end
12
+ def card_details=(str_); end
13
+ def ach_details(); end
14
+ def ach_details=(str_); end
15
+ def allowed_methods(); end
16
+ def allowed_methods=(str_); end
17
+ end
@@ -0,0 +1,18 @@
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
+ class NotificationChannel < T::Enum
12
+ enums do
13
+ EMAIL = new('email')
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,11 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::NotificationChannel
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::NotificationChannel
11
+ end
@@ -72,7 +72,8 @@ module Moov
72
72
  field :line_items, Crystalline::Nilable.new(Models::Components::TransferLineItems), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('lineItems') } }
73
73
  # ID of the invoice that the transfer is associated with.
74
74
  field :invoice_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('invoiceID') } }
75
-
75
+ # The tip, tax, and surcharge portion of the transfer amount.
76
+ # For an auth-capture `card-payment` transfer, this is the aggregate of all captures' `amountDetails`.
76
77
  field :amount_details, Crystalline::Nilable.new(Models::Components::TransferAmountDetails), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('amountDetails') } }
77
78
  # The card authorization and capture IDs associated with a transfer.
78
79
  field :capture, Crystalline::Nilable.new(Models::Components::TransferCapture), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('capture') } }