moov_ruby 26.7.7 → 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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/lib/moov/invoices.rb +180 -0
  3. data/lib/moov/models/components/createinvoice.rb +10 -2
  4. data/lib/moov/models/components/createinvoice.rbi +4 -0
  5. data/lib/moov/models/components/createinvoicenotification.rb +32 -0
  6. data/lib/moov/models/components/createinvoicenotification.rbi +13 -0
  7. data/lib/moov/models/components/invoice.rb +6 -2
  8. data/lib/moov/models/components/invoice.rbi +2 -0
  9. data/lib/moov/models/components/invoicenotificationlimitedchannel.rb +36 -0
  10. data/lib/moov/models/components/invoicenotificationlimitedchannel.rbi +15 -0
  11. data/lib/moov/models/components/invoicepaymentoptions.rb +40 -0
  12. data/lib/moov/models/components/invoicepaymentoptions.rbi +17 -0
  13. data/lib/moov/models/components/invoicepaymentoptionserror.rb +40 -0
  14. data/lib/moov/models/components/invoicepaymentoptionserror.rbi +17 -0
  15. data/lib/moov/models/components/invoicepaymentoptionsupdate.rb +40 -0
  16. data/lib/moov/models/components/invoicepaymentoptionsupdate.rbi +17 -0
  17. data/lib/moov/models/components/notificationchannel.rb +18 -0
  18. data/lib/moov/models/components/notificationchannel.rbi +11 -0
  19. data/lib/moov/models/components/updateinvoice.rb +6 -2
  20. data/lib/moov/models/components/updateinvoice.rbi +2 -0
  21. data/lib/moov/models/components.rb +6 -0
  22. data/lib/moov/models/errors/createinvoiceerror.rb +10 -2
  23. data/lib/moov/models/errors/createinvoiceerror.rbi +4 -0
  24. data/lib/moov/models/errors/invoicenotificationerror.rb +36 -0
  25. data/lib/moov/models/errors/invoicenotificationerror.rbi +15 -0
  26. data/lib/moov/models/errors/invoicenotificationratelimitederror.rb +44 -0
  27. data/lib/moov/models/errors/invoicenotificationratelimitederror.rbi +19 -0
  28. data/lib/moov/models/errors/updateinvoiceerror.rb +6 -2
  29. data/lib/moov/models/errors/updateinvoiceerror.rbi +2 -0
  30. data/lib/moov/models/errors.rb +2 -0
  31. data/lib/moov/models/operations/createcancellation_request.rb +7 -2
  32. data/lib/moov/models/operations/createcancellation_request.rbi +2 -0
  33. data/lib/moov/models/operations/createinvoicenotification_request.rb +40 -0
  34. data/lib/moov/models/operations/createinvoicenotification_request.rbi +17 -0
  35. data/lib/moov/models/operations/createinvoicenotification_response.rb +44 -0
  36. data/lib/moov/models/operations/createinvoicenotification_response.rbi +19 -0
  37. data/lib/moov/models/operations/initiaterefund_request.rb +1 -1
  38. data/lib/moov/models/operations.rb +2 -0
  39. data/lib/moov/sdkconfiguration.rb +3 -3
  40. data/lib/moov/transfers.rb +6 -4
  41. metadata +22 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4fb28a2fd539bca96c2002a5cf4df5b35f6a6c01993cffa4a37d74759bcc0dd1
4
- data.tar.gz: 7df6a2a14f578b4a83c170ffe0e6381fb25bea584359d94f0b5c895cb7d8c130
3
+ metadata.gz: '056404601592483f61cd96209f30f7fa2e6678857334b8ddb1e2031a5ebaad19'
4
+ data.tar.gz: aa948b716cdf93fdcaf5ab6c38fb4bd8fd2a1ca27210c46f00c6012d44248597
5
5
  SHA512:
6
- metadata.gz: 518fb908dd3eccf2d837a99b8cd58323e4709c8fef827c87994967a6ec11f9c10f3bb399167b9624a8480d723caa5fb0d2dc0c119a4bc9497ec9c55093d74bcd
7
- data.tar.gz: 26eb8d589372d8ca20a57d113562ccc6cc4a9d58ae3426aa56c2d3ec0196fd939f1b7ba2530658c25261e5e2cbb0ef480d62d2dc485cf8ffdf1a7db5afb2197f
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.
@@ -18,23 +18,29 @@ module Moov
18
18
  field :line_items, Models::Components::CreateInvoiceLineItems, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('lineItems'), required: true } }
19
19
  # Email address to use for invoice checkout OTP verification instead of the customer account email.
20
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') } }
21
23
 
22
24
  field :description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('description') } }
23
25
 
24
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) } }
25
27
 
26
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') } }
27
31
 
28
32
  field :amount_details, Crystalline::Nilable.new(Models::Components::AmountDetails), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('amountDetails') } }
29
33
 
30
- sig { params(customer_account_id: ::String, line_items: Models::Components::CreateInvoiceLineItems, customer_email: T.nilable(::String), description: T.nilable(::String), invoice_date: T.nilable(::DateTime), due_date: T.nilable(::DateTime), amount_details: T.nilable(Models::Components::AmountDetails)).void }
31
- def initialize(customer_account_id:, line_items:, customer_email: nil, 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)
32
36
  @customer_account_id = customer_account_id
33
37
  @line_items = line_items
34
38
  @customer_email = customer_email
39
+ @invoice_number = invoice_number
35
40
  @description = description
36
41
  @invoice_date = invoice_date
37
42
  @due_date = due_date
43
+ @payment = payment
38
44
  @amount_details = amount_details
39
45
  end
40
46
 
@@ -44,9 +50,11 @@ module Moov
44
50
  return false unless @customer_account_id == other.customer_account_id
45
51
  return false unless @line_items == other.line_items
46
52
  return false unless @customer_email == other.customer_email
53
+ return false unless @invoice_number == other.invoice_number
47
54
  return false unless @description == other.description
48
55
  return false unless @invoice_date == other.invoice_date
49
56
  return false unless @due_date == other.due_date
57
+ return false unless @payment == other.payment
50
58
  return false unless @amount_details == other.amount_details
51
59
  true
52
60
  end
@@ -14,12 +14,16 @@ class Moov::Models::Components::CreateInvoice
14
14
  def line_items=(str_); end
15
15
  def customer_email(); end
16
16
  def customer_email=(str_); end
17
+ def invoice_number(); end
18
+ def invoice_number=(str_); end
17
19
  def description(); end
18
20
  def description=(str_); end
19
21
  def invoice_date(); end
20
22
  def invoice_date=(str_); end
21
23
  def due_date(); end
22
24
  def due_date=(str_); end
25
+ def payment(); end
26
+ def payment=(str_); end
23
27
  def amount_details(); end
24
28
  def amount_details=(str_); end
25
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
@@ -23,6 +23,8 @@ module Moov
23
23
  # To completely discard an invoice created by mistake, use the delete endpoint instead.
24
24
  # - `unpaid`: Can only be set if the current status is `draft`. Setting the status to `unpaid` finalizes the invoice and sends an email with a payment link to the customer.
25
25
  field :status, Crystalline::Nilable.new(Models::Components::InvoiceStatus), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('status'), 'decoder': ::Moov::Utils.open_enum_from_string(Models::Components::InvoiceStatus, true) } }
26
+ # Payment options to update on the invoice.
27
+ field :payment, Crystalline::Nilable.new(Models::Components::InvoicePaymentOptionsUpdate), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('payment') } }
26
28
 
27
29
  field :amount_details, Crystalline::Nilable.new(Models::Components::AmountDetailsUpdate), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('amountDetails') } }
28
30
 
@@ -30,11 +32,12 @@ module Moov
30
32
 
31
33
  field :due_date, Crystalline::Nilable.new(::DateTime), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('dueDate'), 'decoder': ::Moov::Utils.datetime_from_iso_format(true) } }
32
34
 
33
- sig { params(description: T.nilable(::String), line_items: T.nilable(Models::Components::CreateInvoiceLineItemsUpdate), status: T.nilable(Models::Components::InvoiceStatus), amount_details: T.nilable(Models::Components::AmountDetailsUpdate), invoice_date: T.nilable(::DateTime), due_date: T.nilable(::DateTime)).void }
34
- def initialize(description: nil, line_items: nil, status: nil, amount_details: nil, invoice_date: nil, due_date: nil)
35
+ sig { params(description: T.nilable(::String), line_items: T.nilable(Models::Components::CreateInvoiceLineItemsUpdate), status: T.nilable(Models::Components::InvoiceStatus), payment: T.nilable(Models::Components::InvoicePaymentOptionsUpdate), amount_details: T.nilable(Models::Components::AmountDetailsUpdate), invoice_date: T.nilable(::DateTime), due_date: T.nilable(::DateTime)).void }
36
+ def initialize(description: nil, line_items: nil, status: nil, payment: nil, amount_details: nil, invoice_date: nil, due_date: nil)
35
37
  @description = description
36
38
  @line_items = line_items
37
39
  @status = status
40
+ @payment = payment
38
41
  @amount_details = amount_details
39
42
  @invoice_date = invoice_date
40
43
  @due_date = due_date
@@ -46,6 +49,7 @@ module Moov
46
49
  return false unless @description == other.description
47
50
  return false unless @line_items == other.line_items
48
51
  return false unless @status == other.status
52
+ return false unless @payment == other.payment
49
53
  return false unless @amount_details == other.amount_details
50
54
  return false unless @invoice_date == other.invoice_date
51
55
  return false unless @due_date == other.due_date