moov_ruby 26.4.0.pre.dev.16 → 26.4.0.pre.dev.18

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 (106) hide show
  1. checksums.yaml +4 -4
  2. data/lib/moov/apple_pay.rb +5 -5
  3. data/lib/moov/card_issuing.rb +22 -13
  4. data/lib/moov/client.rb +2 -1
  5. data/lib/moov/google_pay.rb +210 -0
  6. data/lib/moov/models/components/batchgettransfersrequest.rb +32 -0
  7. data/lib/moov/models/components/batchgettransfersrequest.rbi +13 -0
  8. data/lib/moov/models/components/cardpayouttype.rb +18 -0
  9. data/lib/moov/models/components/cardpayouttype.rbi +11 -0
  10. data/lib/moov/models/components/createtransferdestinationcard.rb +6 -2
  11. data/lib/moov/models/components/createtransferdestinationcard.rbi +2 -0
  12. data/lib/moov/models/components/disbursementpaymentmethodtype.rb +2 -0
  13. data/lib/moov/models/components/googlepayintermediatesigningkey.rb +36 -0
  14. data/lib/moov/models/components/googlepayintermediatesigningkey.rbi +15 -0
  15. data/lib/moov/models/components/googlepaypaymentmethod.rb +40 -0
  16. data/lib/moov/models/components/googlepaypaymentmethod.rbi +17 -0
  17. data/lib/moov/models/components/googlepaypaymentmethod_paymentmethodtype.rb +18 -0
  18. data/lib/moov/models/components/googlepaypaymentmethod_paymentmethodtype.rbi +11 -0
  19. data/lib/moov/models/components/googlepayresponse.rb +50 -0
  20. data/lib/moov/models/components/googlepayresponse.rbi +21 -0
  21. data/lib/moov/models/components/googlepaytoken.rb +47 -0
  22. data/lib/moov/models/components/googlepaytoken.rbi +19 -0
  23. data/lib/moov/models/components/googlepaytransferpaymentmethod.rb +40 -0
  24. data/lib/moov/models/components/googlepaytransferpaymentmethod.rbi +17 -0
  25. data/lib/moov/models/components/googlepaytransferpaymentmethod_paymentmethodtype.rb +18 -0
  26. data/lib/moov/models/components/googlepaytransferpaymentmethod_paymentmethodtype.rbi +11 -0
  27. data/lib/moov/models/components/linkedgooglepaypaymentmethod.rb +40 -0
  28. data/lib/moov/models/components/linkedgooglepaypaymentmethod.rbi +17 -0
  29. data/lib/moov/models/components/linkedgooglepaypaymentmethod_paymentmethodtype.rb +18 -0
  30. data/lib/moov/models/components/linkedgooglepaypaymentmethod_paymentmethodtype.rbi +11 -0
  31. data/lib/moov/models/components/linkgooglepay.rb +38 -0
  32. data/lib/moov/models/components/linkgooglepay.rbi +13 -0
  33. data/lib/moov/models/components/paymentmethodtype.rb +5 -0
  34. data/lib/moov/models/components/pullfromapplepaypaymentmethod.rb +40 -0
  35. data/lib/moov/models/components/pullfromapplepaypaymentmethod.rbi +17 -0
  36. data/lib/moov/models/components/pullfromapplepaypaymentmethod_paymentmethodtype.rb +18 -0
  37. data/lib/moov/models/components/pullfromapplepaypaymentmethod_paymentmethodtype.rbi +11 -0
  38. data/lib/moov/models/components/pullfromapplepaytransferpaymentmethod.rb +40 -0
  39. data/lib/moov/models/components/pullfromapplepaytransferpaymentmethod.rbi +17 -0
  40. data/lib/moov/models/components/pullfromapplepaytransferpaymentmethod_paymentmethodtype.rb +18 -0
  41. data/lib/moov/models/components/pullfromapplepaytransferpaymentmethod_paymentmethodtype.rbi +11 -0
  42. data/lib/moov/models/components/pullfromgooglepaypaymentmethod.rb +40 -0
  43. data/lib/moov/models/components/pullfromgooglepaypaymentmethod.rbi +17 -0
  44. data/lib/moov/models/components/pullfromgooglepaypaymentmethod_paymentmethodtype.rb +18 -0
  45. data/lib/moov/models/components/pullfromgooglepaypaymentmethod_paymentmethodtype.rbi +11 -0
  46. data/lib/moov/models/components/pullfromgooglepaytransferpaymentmethod.rb +40 -0
  47. data/lib/moov/models/components/pullfromgooglepaytransferpaymentmethod.rbi +17 -0
  48. data/lib/moov/models/components/pullfromgooglepaytransferpaymentmethod_paymentmethodtype.rb +18 -0
  49. data/lib/moov/models/components/pullfromgooglepaytransferpaymentmethod_paymentmethodtype.rbi +11 -0
  50. data/lib/moov/models/components/pushtoapplepaypaymentmethod.rb +40 -0
  51. data/lib/moov/models/components/pushtoapplepaypaymentmethod.rbi +17 -0
  52. data/lib/moov/models/components/pushtoapplepaypaymentmethod_paymentmethodtype.rb +18 -0
  53. data/lib/moov/models/components/pushtoapplepaypaymentmethod_paymentmethodtype.rbi +11 -0
  54. data/lib/moov/models/components/pushtoapplepaytransferpaymentmethod.rb +40 -0
  55. data/lib/moov/models/components/pushtoapplepaytransferpaymentmethod.rbi +17 -0
  56. data/lib/moov/models/components/pushtoapplepaytransferpaymentmethod_paymentmethodtype.rb +18 -0
  57. data/lib/moov/models/components/pushtoapplepaytransferpaymentmethod_paymentmethodtype.rbi +11 -0
  58. data/lib/moov/models/components/pushtogooglepaypaymentmethod.rb +40 -0
  59. data/lib/moov/models/components/pushtogooglepaypaymentmethod.rbi +17 -0
  60. data/lib/moov/models/components/pushtogooglepaypaymentmethod_paymentmethodtype.rb +18 -0
  61. data/lib/moov/models/components/pushtogooglepaypaymentmethod_paymentmethodtype.rbi +11 -0
  62. data/lib/moov/models/components/pushtogooglepaytransferpaymentmethod.rb +40 -0
  63. data/lib/moov/models/components/pushtogooglepaytransferpaymentmethod.rbi +17 -0
  64. data/lib/moov/models/components/pushtogooglepaytransferpaymentmethod_paymentmethodtype.rb +18 -0
  65. data/lib/moov/models/components/pushtogooglepaytransferpaymentmethod_paymentmethodtype.rbi +11 -0
  66. data/lib/moov/models/components/resolutionlink.rb +6 -2
  67. data/lib/moov/models/components/resolutionlink.rbi +2 -0
  68. data/lib/moov/models/components/resolutionlinkstatus.rb +22 -0
  69. data/lib/moov/models/components/resolutionlinkstatus.rbi +11 -0
  70. data/lib/moov/models/components/rtpdetails.rb +58 -0
  71. data/lib/moov/models/components/rtpdetails.rbi +25 -0
  72. data/lib/moov/models/components/rtpfailurecode.rb +27 -0
  73. data/lib/moov/models/components/rtpfailurecode.rbi +11 -0
  74. data/lib/moov/models/components/rtptransactionstatus.rb +21 -0
  75. data/lib/moov/models/components/rtptransactionstatus.rbi +11 -0
  76. data/lib/moov/models/components/transferdestination.rb +6 -2
  77. data/lib/moov/models/components/transferdestination.rbi +2 -0
  78. data/lib/moov/models/components/transferoptions.rb +3 -3
  79. data/lib/moov/models/components/transferpaymentmethodtype.rb +5 -0
  80. data/lib/moov/models/components/webhookbillingstatementcreated.rb +6 -2
  81. data/lib/moov/models/components/webhookbillingstatementcreated.rbi +2 -0
  82. data/lib/moov/models/components.rb +32 -0
  83. data/lib/moov/models/errors/linkgooglepayerror.rb +40 -0
  84. data/lib/moov/models/errors/linkgooglepayerror.rbi +17 -0
  85. data/lib/moov/models/errors.rb +1 -0
  86. data/lib/moov/models/operations/batchgettransfers_request.rb +36 -0
  87. data/lib/moov/models/operations/batchgettransfers_request.rbi +15 -0
  88. data/lib/moov/models/operations/batchgettransfers_response.rb +48 -0
  89. data/lib/moov/models/operations/batchgettransfers_response.rbi +21 -0
  90. data/lib/moov/models/operations/getpaymentmethod_response.rb +2 -2
  91. data/lib/moov/models/operations/linkapplepaytoken_response.rb +5 -5
  92. data/lib/moov/models/operations/linkapplepaytoken_response.rbi +2 -2
  93. data/lib/moov/models/operations/linkgooglepaytoken_request.rb +36 -0
  94. data/lib/moov/models/operations/linkgooglepaytoken_request.rbi +15 -0
  95. data/lib/moov/models/operations/linkgooglepaytoken_response.rb +48 -0
  96. data/lib/moov/models/operations/linkgooglepaytoken_response.rbi +21 -0
  97. data/lib/moov/models/operations/listpaymentmethods_response.rb +2 -2
  98. data/lib/moov/models/operations/updateissuedcard_response.rb +6 -2
  99. data/lib/moov/models/operations/updateissuedcard_response.rbi +2 -0
  100. data/lib/moov/models/operations.rb +4 -0
  101. data/lib/moov/payment_methods.rb +2 -2
  102. data/lib/moov/sdkconfiguration.rb +3 -3
  103. data/lib/moov/transfers.rb +139 -0
  104. data/lib/moov/utils/security.rb +22 -11
  105. data/lib/moov_ruby.rb +1 -0
  106. metadata +77 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a66ab76ab826cddf071ee0c86e98ee1033cefadf08b71c726e995d29bfc0507
4
- data.tar.gz: bf8bc9fbf1068127a2d9615e862c94baa1c19ce08270afa9ea88f589aa1cd9c1
3
+ metadata.gz: 4dc36e7a6da53a2e7865d3ae8b38804ced469a62130ca24e4877a14f77c7cc62
4
+ data.tar.gz: 22e9a3ad4dde3899263fceb45cf188aef01ec25db171e52580cf748b4cb4bd03
5
5
  SHA512:
6
- metadata.gz: c88d396ab8bf831cc8d7ec1214c1c6336f7743ca02ecf6d9dae4ac2600d1c8454f90e6780bdd7ad27e2e9aa2eaab22f6c35528e2fad5b513326fc2f71b17b35b
7
- data.tar.gz: c160d643c8859349644d68d2a42aa139d5352a4067b726b5dcc7543b56104b776f91cb1d36949f5533418161e308b4761c43e640f20c83190b353c1547ee06b5
6
+ metadata.gz: 0f3358a13dbb542d8a82caf3cc09412150a6462bcc64079c5795d8bfc94f916321336e4f07591534971ac769f94853c7dc0fcc9aca47e8b56fe76e4173450846
7
+ data.tar.gz: 5d59f12892169b6972a2552e78b3d594d93544d1a6e86f6b6cdaaed1f3dc014f8ce076dad7887ecd8a7c488a71f30a38cb089fc0d02a505d468b433f98419402
@@ -617,12 +617,12 @@ module Moov
617
617
 
618
618
  sig { params(link_apple_pay: Models::Components::LinkApplePay, account_id: ::String, timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::LinkApplePayTokenResponse) }
619
619
  def link_token(link_apple_pay:, account_id:, timeout_ms: nil, http_headers: nil)
620
- # link_token - Connect an Apple Pay token to the specified account.
620
+ # link_token - Connect an Apple Pay token to the specified account.
621
621
  #
622
- # Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
622
+ # Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
623
623
  # The `token` data is defined by Apple Pay and should be passed through from Apple Pay's response unmodified.
624
624
  #
625
- # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
625
+ # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
626
626
  # you'll need to specify the `/accounts/{accountID}/cards.write` scope.
627
627
  request = Models::Operations::LinkApplePayTokenRequest.new(
628
628
  account_id: account_id,
@@ -725,13 +725,13 @@ module Moov
725
725
  response: http_response
726
726
  )
727
727
  response_data = http_response.env.response_body
728
- obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::LinkedApplePayPaymentMethod)
728
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Crystalline::Array.new(Models::Components::LinkedApplePayPaymentMethod))
729
729
  response = Models::Operations::LinkApplePayTokenResponse.new(
730
730
  status_code: http_response.status,
731
731
  content_type: content_type,
732
732
  raw_response: http_response,
733
733
  headers: http_response.headers,
734
- linked_apple_pay_payment_method: T.unsafe(obj)
734
+ linked_apple_pay_payment_methods: T.unsafe(obj)
735
735
  )
736
736
 
737
737
  return response
@@ -555,19 +555,28 @@ module Moov
555
555
  end
556
556
 
557
557
  content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
558
- if Utils.match_status_code(http_response.status, ['204'])
559
- http_response = @sdk_configuration.hooks.after_success(
560
- hook_ctx: SDKHooks::AfterSuccessHookContext.new(
561
- hook_ctx: hook_ctx
562
- ),
563
- response: http_response
564
- )
565
- return Models::Operations::UpdateIssuedCardResponse.new(
566
- status_code: http_response.status,
567
- content_type: content_type,
568
- raw_response: http_response,
569
- headers: {}
570
- )
558
+ if Utils.match_status_code(http_response.status, ['200'])
559
+ if Utils.match_content_type(content_type, 'application/json')
560
+ http_response = @sdk_configuration.hooks.after_success(
561
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
562
+ hook_ctx: hook_ctx
563
+ ),
564
+ response: http_response
565
+ )
566
+ response_data = http_response.env.response_body
567
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::IssuedCard)
568
+ response = Models::Operations::UpdateIssuedCardResponse.new(
569
+ status_code: http_response.status,
570
+ content_type: content_type,
571
+ raw_response: http_response,
572
+ headers: http_response.headers,
573
+ issued_card: T.unsafe(obj)
574
+ )
575
+
576
+ return response
577
+ else
578
+ 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'
579
+ end
571
580
  elsif Utils.match_status_code(http_response.status, ['400', '409'])
572
581
  if Utils.match_content_type(content_type, 'application/json')
573
582
  http_response = @sdk_configuration.hooks.after_success(
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, :resolution_links, :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
19
+ attr_accessor :accounts, :adjustments, :apple_pay, :bank_accounts, :branding, :capabilities, :cards, :disputes, :fee_plans, :files, :google_pay, :images, :invoices, :payment_links, :payment_methods, :products, :representatives, :resolution_links, :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
  #
@@ -88,6 +88,7 @@ module Moov
88
88
  @disputes = Disputes.new(@sdk_configuration)
89
89
  @fee_plans = FeePlans.new(@sdk_configuration)
90
90
  @files = Files.new(@sdk_configuration)
91
+ @google_pay = GooglePay.new(@sdk_configuration)
91
92
  @images = Images.new(@sdk_configuration)
92
93
  @invoices = Invoices.new(@sdk_configuration)
93
94
  @payment_links = PaymentLinks.new(@sdk_configuration)
@@ -0,0 +1,210 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+ require 'faraday'
7
+ require 'faraday/multipart'
8
+ require 'faraday/retry'
9
+ require 'sorbet-runtime'
10
+ require_relative 'sdk_hooks/hooks'
11
+ require_relative 'utils/retries'
12
+
13
+ module Moov
14
+ extend T::Sig
15
+ class GooglePay
16
+ extend T::Sig
17
+
18
+
19
+
20
+ sig { params(sdk_config: SDKConfiguration).void }
21
+ def initialize(sdk_config)
22
+ @sdk_configuration = sdk_config
23
+
24
+ end
25
+
26
+ sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) }
27
+ def get_url(base_url:, url_variables: nil)
28
+ sd_base_url, sd_options = @sdk_configuration.get_server_details
29
+
30
+ if base_url.nil?
31
+ base_url = sd_base_url
32
+ end
33
+
34
+ if url_variables.nil?
35
+ url_variables = sd_options
36
+ end
37
+
38
+ return Utils.template_url base_url, url_variables
39
+ end
40
+
41
+
42
+
43
+
44
+ sig { params(link_google_pay: Models::Components::LinkGooglePay, account_id: ::String, timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::LinkGooglePayTokenResponse) }
45
+ def link_token(link_google_pay:, account_id:, timeout_ms: nil, http_headers: nil)
46
+ # link_token - Connect a Google Pay token to the specified account.
47
+ #
48
+ # The `token` data is defined by Google Pay and should be passed through from Google Pay's response unmodified.
49
+ #
50
+ # To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
51
+ # you'll need to specify the `/accounts/{accountID}/cards.write` scope.
52
+ request = Models::Operations::LinkGooglePayTokenRequest.new(
53
+ account_id: account_id,
54
+ link_google_pay: link_google_pay
55
+ )
56
+ url, params = @sdk_configuration.get_server_details
57
+ base_url = Utils.template_url(url, params)
58
+ url = Utils.generate_url(
59
+ Models::Operations::LinkGooglePayTokenRequest,
60
+ base_url,
61
+ '/accounts/{accountID}/google-pay/tokens',
62
+ request
63
+ )
64
+ headers = {}
65
+ headers = T.cast(headers, T::Hash[String, String])
66
+ req_content_type, data, form = Utils.serialize_request_body(request, false, false, :link_google_pay, :json)
67
+ headers['content-type'] = req_content_type
68
+ raise StandardError, 'request body is required' if data.nil? && form.nil?
69
+
70
+ if form && !form.empty?
71
+ body = Utils.encode_form(form)
72
+ elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
73
+ body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object]))
74
+ else
75
+ body = data
76
+ end
77
+ headers['Accept'] = 'application/json'
78
+ headers['user-agent'] = @sdk_configuration.user_agent
79
+
80
+ security = @sdk_configuration.security_source&.call
81
+
82
+ timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
83
+ timeout ||= @sdk_configuration.timeout
84
+
85
+
86
+ connection = @sdk_configuration.client
87
+
88
+ hook_ctx = SDKHooks::HookContext.new(
89
+ config: @sdk_configuration,
90
+ base_url: base_url,
91
+ oauth2_scopes: nil,
92
+ operation_id: 'linkGooglePayToken',
93
+ security_source: @sdk_configuration.security_source
94
+ )
95
+
96
+ error = T.let(nil, T.nilable(StandardError))
97
+ http_response = T.let(nil, T.nilable(Faraday::Response))
98
+
99
+
100
+ begin
101
+ http_response = T.must(connection).post(url) do |req|
102
+ req.body = body
103
+ req.headers.merge!(headers)
104
+ req.options.timeout = timeout unless timeout.nil?
105
+ Utils.configure_request_security(req, security)
106
+ http_headers&.each do |key, value|
107
+ req.headers[key.to_s] = value
108
+ end
109
+
110
+ @sdk_configuration.hooks.before_request(
111
+ hook_ctx: SDKHooks::BeforeRequestHookContext.new(
112
+ hook_ctx: hook_ctx
113
+ ),
114
+ request: req
115
+ )
116
+ end
117
+ rescue StandardError => e
118
+ error = e
119
+ ensure
120
+ if http_response.nil? || Utils.error_status?(http_response.status)
121
+ http_response = @sdk_configuration.hooks.after_error(
122
+ error: error,
123
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
124
+ hook_ctx: hook_ctx
125
+ ),
126
+ response: http_response
127
+ )
128
+ else
129
+ http_response = @sdk_configuration.hooks.after_success(
130
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
131
+ hook_ctx: hook_ctx
132
+ ),
133
+ response: http_response
134
+ )
135
+ end
136
+
137
+ if http_response.nil?
138
+ raise error if !error.nil?
139
+ raise 'no response'
140
+ end
141
+ end
142
+
143
+ content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
144
+ if Utils.match_status_code(http_response.status, ['200'])
145
+ if Utils.match_content_type(content_type, 'application/json')
146
+ http_response = @sdk_configuration.hooks.after_success(
147
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
148
+ hook_ctx: hook_ctx
149
+ ),
150
+ response: http_response
151
+ )
152
+ response_data = http_response.env.response_body
153
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Crystalline::Array.new(Models::Components::LinkedGooglePayPaymentMethod))
154
+ response = Models::Operations::LinkGooglePayTokenResponse.new(
155
+ status_code: http_response.status,
156
+ content_type: content_type,
157
+ raw_response: http_response,
158
+ headers: http_response.headers,
159
+ linked_google_pay_payment_methods: T.unsafe(obj)
160
+ )
161
+
162
+ return response
163
+ else
164
+ 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'
165
+ end
166
+ elsif Utils.match_status_code(http_response.status, ['400', '409'])
167
+ if Utils.match_content_type(content_type, 'application/json')
168
+ http_response = @sdk_configuration.hooks.after_success(
169
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
170
+ hook_ctx: hook_ctx
171
+ ),
172
+ response: http_response
173
+ )
174
+ response_data = http_response.env.response_body
175
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::GenericError)
176
+ obj.raw_response = http_response
177
+ raise obj
178
+ else
179
+ 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'
180
+ end
181
+ elsif Utils.match_status_code(http_response.status, ['422'])
182
+ if Utils.match_content_type(content_type, 'application/json')
183
+ http_response = @sdk_configuration.hooks.after_success(
184
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
185
+ hook_ctx: hook_ctx
186
+ ),
187
+ response: http_response
188
+ )
189
+ response_data = http_response.env.response_body
190
+ obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::LinkGooglePayError)
191
+ obj.raw_response = http_response
192
+ raise obj
193
+ else
194
+ 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'
195
+ end
196
+ elsif Utils.match_status_code(http_response.status, ['401', '403', '404', '429'])
197
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
198
+ elsif Utils.match_status_code(http_response.status, ['500', '504'])
199
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
200
+ elsif Utils.match_status_code(http_response.status, ['4XX'])
201
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
202
+ elsif Utils.match_status_code(http_response.status, ['5XX'])
203
+ raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
204
+ else
205
+ 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'
206
+
207
+ end
208
+ end
209
+ end
210
+ 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
+ # Array of transfer IDs to fetch.
11
+ class BatchGetTransfersRequest
12
+ extend T::Sig
13
+ include Crystalline::MetadataFields
14
+
15
+
16
+ field :transfer_i_ds, Crystalline::Array.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('transferIDs'), required: true } }
17
+
18
+ sig { params(transfer_i_ds: T::Array[::String]).void }
19
+ def initialize(transfer_i_ds:)
20
+ @transfer_i_ds = transfer_i_ds
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 @transfer_i_ds == other.transfer_i_ds
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::BatchGetTransfersRequest
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::BatchGetTransfersRequest
11
+ def transfer_i_ds(); end
12
+ def transfer_i_ds=(str_); end
13
+ 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
+ # CardPayoutType - Specifies the type of card payout for push-to-card transfers, used to determine the business application identifier (BAI) sent to the card network.
11
+ class CardPayoutType < T::Enum
12
+ enums do
13
+ LOYALTY = new('loyalty')
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::CardPayoutType
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::CardPayoutType
11
+ end
@@ -14,16 +14,20 @@ module Moov
14
14
 
15
15
  # An optional override of the default card statement descriptor for a transfer. Accounts must be enabled by Moov to set this field.
16
16
  field :dynamic_descriptor, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('dynamicDescriptor') } }
17
+ # An optional field to specify the type of card payout, used to route the transfer with the appropriate business application identifier (BAI).
18
+ field :payout_type, Crystalline::Nilable.new(Models::Components::CardPayoutType), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('payoutType'), 'decoder': ::Moov::Utils.enum_from_string(Models::Components::CardPayoutType, true) } }
17
19
 
18
- sig { params(dynamic_descriptor: T.nilable(::String)).void }
19
- def initialize(dynamic_descriptor: nil)
20
+ sig { params(dynamic_descriptor: T.nilable(::String), payout_type: T.nilable(Models::Components::CardPayoutType)).void }
21
+ def initialize(dynamic_descriptor: nil, payout_type: nil)
20
22
  @dynamic_descriptor = dynamic_descriptor
23
+ @payout_type = payout_type
21
24
  end
22
25
 
23
26
  sig { params(other: T.untyped).returns(T::Boolean) }
24
27
  def ==(other)
25
28
  return false unless other.is_a? self.class
26
29
  return false unless @dynamic_descriptor == other.dynamic_descriptor
30
+ return false unless @payout_type == other.payout_type
27
31
  true
28
32
  end
29
33
  end
@@ -10,4 +10,6 @@ end
10
10
  class Moov::Models::Components::CreateTransferDestinationCard
11
11
  def dynamic_descriptor(); end
12
12
  def dynamic_descriptor=(str_); end
13
+ def payout_type(); end
14
+ def payout_type=(str_); end
13
15
  end
@@ -14,6 +14,8 @@ module Moov
14
14
  RTP_CREDIT = new('rtp-credit')
15
15
  ACH_CREDIT_SAME_DAY = new('ach-credit-same-day')
16
16
  ACH_CREDIT_STANDARD = new('ach-credit-standard')
17
+ PUSH_TO_APPLE_PAY = new('push-to-apple-pay')
18
+ PUSH_TO_GOOGLE_PAY = new('push-to-google-pay')
17
19
  end
18
20
  end
19
21
  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
+ # Contains the intermediate signing key for verification.
11
+ class GooglePayIntermediateSigningKey
12
+ extend T::Sig
13
+ include Crystalline::MetadataFields
14
+
15
+ # A JSON-encoded serialized string containing the signing key data.
16
+ field :signed_key, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('signedKey'), required: true } }
17
+ # Base64-encoded signatures of the `signedKey`.
18
+ field :signatures, Crystalline::Array.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('signatures'), required: true } }
19
+
20
+ sig { params(signed_key: ::String, signatures: T::Array[::String]).void }
21
+ def initialize(signed_key:, signatures:)
22
+ @signed_key = signed_key
23
+ @signatures = signatures
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 @signed_key == other.signed_key
30
+ return false unless @signatures == other.signatures
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::GooglePayIntermediateSigningKey
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::GooglePayIntermediateSigningKey
11
+ def signed_key(); end
12
+ def signed_key=(str_); end
13
+ def signatures(); end
14
+ def signatures=(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
+
11
+ class GooglePayPaymentMethod
12
+ extend T::Sig
13
+ include Crystalline::MetadataFields
14
+
15
+ # ID of the payment method.
16
+ field :payment_method_id, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('paymentMethodID'), required: true } }
17
+
18
+ field :payment_method_type, Models::Components::GooglePayPaymentMethodPaymentMethodType, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('paymentMethodType'), required: true, 'decoder': ::Moov::Utils.enum_from_string(Models::Components::GooglePayPaymentMethodPaymentMethodType, false) } }
19
+ # Describes a Google Pay token on a Moov account.
20
+ field :google_pay, Models::Components::GooglePayResponse, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('googlePay'), required: true } }
21
+
22
+ sig { params(payment_method_id: ::String, payment_method_type: Models::Components::GooglePayPaymentMethodPaymentMethodType, google_pay: Models::Components::GooglePayResponse).void }
23
+ def initialize(payment_method_id:, payment_method_type:, google_pay:)
24
+ @payment_method_id = payment_method_id
25
+ @payment_method_type = payment_method_type
26
+ @google_pay = google_pay
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 @payment_method_id == other.payment_method_id
33
+ return false unless @payment_method_type == other.payment_method_type
34
+ return false unless @google_pay == other.google_pay
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::GooglePayPaymentMethod
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::GooglePayPaymentMethod
11
+ def payment_method_id(); end
12
+ def payment_method_id=(str_); end
13
+ def payment_method_type(); end
14
+ def payment_method_type=(str_); end
15
+ def google_pay(); end
16
+ def google_pay=(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 GooglePayPaymentMethodPaymentMethodType < T::Enum
12
+ enums do
13
+ GOOGLE_PAY = new('google-pay')
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::GooglePayPaymentMethodPaymentMethodType
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::GooglePayPaymentMethodPaymentMethodType
11
+ end
@@ -0,0 +1,50 @@
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
+ # Describes a Google Pay token on a Moov account.
11
+ class GooglePayResponse
12
+ extend T::Sig
13
+ include Crystalline::MetadataFields
14
+
15
+ # The card brand.
16
+ field :brand, Models::Components::CardBrand, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('brand'), required: true, 'decoder': ::Moov::Utils.enum_from_string(Models::Components::CardBrand, false) } }
17
+ # The last four digits of the underlying card number.
18
+ field :card_details, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('cardDetails'), required: true } }
19
+ # Uniquely identifies a linked payment card or token.
20
+ # For Apple Pay, the fingerprint is based on the tokenized card number and may vary based on the user's device.
21
+ # This field can be used to identify specific payment methods across multiple accounts on your platform.
22
+ field :fingerprint, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('fingerprint'), required: true } }
23
+ # The expiration date of the card or token.
24
+ field :expiration, Models::Components::CardExpiration, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('expiration'), required: true } }
25
+ # Country where the underlying card was issued.
26
+ field :issuer_country, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('issuerCountry') } }
27
+
28
+ sig { params(brand: Models::Components::CardBrand, card_details: ::String, fingerprint: ::String, expiration: Models::Components::CardExpiration, issuer_country: T.nilable(::String)).void }
29
+ def initialize(brand:, card_details:, fingerprint:, expiration:, issuer_country: nil)
30
+ @brand = brand
31
+ @card_details = card_details
32
+ @fingerprint = fingerprint
33
+ @expiration = expiration
34
+ @issuer_country = issuer_country
35
+ end
36
+
37
+ sig { params(other: T.untyped).returns(T::Boolean) }
38
+ def ==(other)
39
+ return false unless other.is_a? self.class
40
+ return false unless @brand == other.brand
41
+ return false unless @card_details == other.card_details
42
+ return false unless @fingerprint == other.fingerprint
43
+ return false unless @expiration == other.expiration
44
+ return false unless @issuer_country == other.issuer_country
45
+ true
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,21 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class Moov::Models::Components::GooglePayResponse
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class Moov::Models::Components::GooglePayResponse
11
+ def brand(); end
12
+ def brand=(str_); end
13
+ def card_details(); end
14
+ def card_details=(str_); end
15
+ def fingerprint(); end
16
+ def fingerprint=(str_); end
17
+ def expiration(); end
18
+ def expiration=(str_); end
19
+ def issuer_country(); end
20
+ def issuer_country=(str_); end
21
+ end