straddle 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +53 -0
  3. data/README.md +23 -1
  4. data/lib/straddle/client.rb +15 -1
  5. data/lib/straddle/internal/transport/base_client.rb +5 -0
  6. data/lib/straddle/internal/util.rb +22 -7
  7. data/lib/straddle/models/charge_create_params.rb +2 -0
  8. data/lib/straddle/models/charge_unmask_response.rb +142 -11
  9. data/lib/straddle/models/charge_v1.rb +140 -11
  10. data/lib/straddle/models/embed/account_list_params.rb +8 -1
  11. data/lib/straddle/models/embed/representative.rb +2 -2
  12. data/lib/straddle/models/embed/representative_create_params.rb +2 -2
  13. data/lib/straddle/models/embed/representative_paged.rb +2 -2
  14. data/lib/straddle/models/embed/representative_update_params.rb +2 -2
  15. data/lib/straddle/models/paykey_list_params.rb +17 -1
  16. data/lib/straddle/models/payment_list_params.rb +55 -1
  17. data/lib/straddle/models/payment_summary_paged_v1.rb +98 -1
  18. data/lib/straddle/models/payout_create_params.rb +2 -0
  19. data/lib/straddle/models/payout_unmask_response.rb +145 -11
  20. data/lib/straddle/models/payout_upload_authorization_document_params.rb +57 -0
  21. data/lib/straddle/models/payout_v1.rb +140 -11
  22. data/lib/straddle/models.rb +2 -0
  23. data/lib/straddle/resources/embed/accounts.rb +5 -2
  24. data/lib/straddle/resources/paykeys.rb +7 -1
  25. data/lib/straddle/resources/payments.rb +19 -1
  26. data/lib/straddle/resources/payouts.rb +49 -0
  27. data/lib/straddle/version.rb +1 -1
  28. data/lib/straddle.rb +1 -0
  29. data/rbi/straddle/internal/util.rbi +8 -0
  30. data/rbi/straddle/models/charge_create_params.rbi +10 -0
  31. data/rbi/straddle/models/charge_unmask_response.rbi +287 -34
  32. data/rbi/straddle/models/charge_v1.rbi +268 -39
  33. data/rbi/straddle/models/embed/account_list_params.rbi +9 -0
  34. data/rbi/straddle/models/embed/representative.rbi +2 -2
  35. data/rbi/straddle/models/embed/representative_create_params.rbi +2 -2
  36. data/rbi/straddle/models/embed/representative_paged.rbi +2 -2
  37. data/rbi/straddle/models/embed/representative_update_params.rbi +2 -2
  38. data/rbi/straddle/models/paykey_list_params.rbi +22 -0
  39. data/rbi/straddle/models/payment_list_params.rbi +75 -0
  40. data/rbi/straddle/models/payment_summary_paged_v1.rbi +198 -3
  41. data/rbi/straddle/models/payout_create_params.rbi +10 -0
  42. data/rbi/straddle/models/payout_unmask_response.rbi +287 -34
  43. data/rbi/straddle/models/payout_upload_authorization_document_params.rbi +88 -0
  44. data/rbi/straddle/models/payout_v1.rbi +268 -39
  45. data/rbi/straddle/models.rbi +3 -0
  46. data/rbi/straddle/resources/embed/accounts.rbi +3 -0
  47. data/rbi/straddle/resources/paykeys.rbi +6 -0
  48. data/rbi/straddle/resources/payments.rbi +20 -0
  49. data/rbi/straddle/resources/payouts.rbi +33 -0
  50. data/sig/straddle/internal/util.rbs +4 -0
  51. data/sig/straddle/models/charge_create_params.rbs +4 -0
  52. data/sig/straddle/models/charge_unmask_response.rbs +120 -11
  53. data/sig/straddle/models/charge_v1.rbs +120 -11
  54. data/sig/straddle/models/embed/account_list_params.rbs +7 -0
  55. data/sig/straddle/models/paykey_list_params.rbs +14 -0
  56. data/sig/straddle/models/payment_list_params.rbs +57 -2
  57. data/sig/straddle/models/payment_summary_paged_v1.rbs +78 -3
  58. data/sig/straddle/models/payout_create_params.rbs +4 -0
  59. data/sig/straddle/models/payout_unmask_response.rbs +120 -11
  60. data/sig/straddle/models/payout_upload_authorization_document_params.rbs +59 -0
  61. data/sig/straddle/models/payout_v1.rbs +120 -11
  62. data/sig/straddle/models.rbs +2 -0
  63. data/sig/straddle/resources/embed/accounts.rbs +1 -0
  64. data/sig/straddle/resources/paykeys.rbs +2 -0
  65. data/sig/straddle/resources/payments.rbs +6 -0
  66. data/sig/straddle/resources/payouts.rbs +10 -0
  67. metadata +5 -2
@@ -85,6 +85,24 @@ module Straddle
85
85
  # @return [Array<String>]
86
86
  required :funding_ids, Straddle::Internal::Type::ArrayOf[String]
87
87
 
88
+ # @!attribute has_resubmit
89
+ # Has the payout been resubmitted.
90
+ #
91
+ # @return [Boolean]
92
+ required :has_resubmit, Straddle::Internal::Type::Boolean
93
+
94
+ # @!attribute is_refund
95
+ # Is the payout a refund of an original charge.
96
+ #
97
+ # @return [Boolean]
98
+ required :is_refund, Straddle::Internal::Type::Boolean
99
+
100
+ # @!attribute is_resubmit
101
+ # Is the payout a resubmit of an original payout.
102
+ #
103
+ # @return [Boolean]
104
+ required :is_resubmit, Straddle::Internal::Type::Boolean
105
+
88
106
  # @!attribute paykey
89
107
  # Paykey.
90
108
  #
@@ -133,6 +151,15 @@ module Straddle
133
151
  # @return [Straddle::Models::CustomerDetailsV1, nil]
134
152
  optional :customer_details, -> { Straddle::CustomerDetailsV1 }
135
153
 
154
+ # @!attribute documents
155
+ # Documents uploaded for this payout (e.g. proof of authorization), in the order
156
+ # they were uploaded.
157
+ #
158
+ # @return [Array<Straddle::Models::PayoutUnmaskResponse::Data::Document>, nil]
159
+ optional :documents,
160
+ -> { Straddle::Internal::Type::ArrayOf[Straddle::Models::PayoutUnmaskResponse::Data::Document] },
161
+ nil?: true
162
+
136
163
  # @!attribute effective_at
137
164
  # Effective at.
138
165
  #
@@ -165,9 +192,9 @@ module Straddle
165
192
  # @!attribute related_payments
166
193
  # Related payments.
167
194
  #
168
- # @return [Hash{Symbol=>Symbol, Straddle::Models::PayoutUnmaskResponse::Data::RelatedPayment}, nil]
195
+ # @return [Array<Straddle::Models::PayoutUnmaskResponse::Data::RelatedPayment>, nil]
169
196
  optional :related_payments,
170
- -> { Straddle::Internal::Type::HashOf[enum: Straddle::Models::PayoutUnmaskResponse::Data::RelatedPayment] },
197
+ -> { Straddle::Internal::Type::ArrayOf[Straddle::Models::PayoutUnmaskResponse::Data::RelatedPayment] },
171
198
  nil?: true
172
199
 
173
200
  # @!attribute updated_at
@@ -176,7 +203,10 @@ module Straddle
176
203
  # @return [Time, nil]
177
204
  optional :updated_at, Time, nil?: true
178
205
 
179
- # @!method initialize(id:, amount:, config:, currency:, description:, device:, external_id:, funding_ids:, paykey:, payment_date:, status:, status_details:, status_history:, trace_ids:, created_at: nil, customer_details: nil, effective_at: nil, metadata: nil, paykey_details: nil, payment_rail: nil, processed_at: nil, related_payments: nil, updated_at: nil)
206
+ # @!method initialize(id:, amount:, config:, currency:, description:, device:, external_id:, funding_ids:, has_resubmit:, is_refund:, is_resubmit:, paykey:, payment_date:, status:, status_details:, status_history:, trace_ids:, created_at: nil, customer_details: nil, documents: nil, effective_at: nil, metadata: nil, paykey_details: nil, payment_rail: nil, processed_at: nil, related_payments: nil, updated_at: nil)
207
+ # Some parameter documentations has been truncated, see
208
+ # {Straddle::Models::PayoutUnmaskResponse::Data} for more details.
209
+ #
180
210
  # @param id [String] Id.
181
211
  #
182
212
  # @param amount [Integer] Amount.
@@ -193,6 +223,12 @@ module Straddle
193
223
  #
194
224
  # @param funding_ids [Array<String>] Funding Ids
195
225
  #
226
+ # @param has_resubmit [Boolean] Has the payout been resubmitted.
227
+ #
228
+ # @param is_refund [Boolean] Is the payout a refund of an original charge.
229
+ #
230
+ # @param is_resubmit [Boolean] Is the payout a resubmit of an original payout.
231
+ #
196
232
  # @param paykey [String] Paykey.
197
233
  #
198
234
  # @param payment_date [Date] Payment date.
@@ -209,6 +245,8 @@ module Straddle
209
245
  #
210
246
  # @param customer_details [Straddle::Models::CustomerDetailsV1] Information about the customer associated with the charge or payout.
211
247
  #
248
+ # @param documents [Array<Straddle::Models::PayoutUnmaskResponse::Data::Document>, nil] Documents uploaded for this payout (e.g. proof of authorization), in the order t
249
+ #
212
250
  # @param effective_at [Time, nil] Effective at.
213
251
  #
214
252
  # @param metadata [Hash{Symbol=>String}, nil] Metadata.
@@ -219,7 +257,7 @@ module Straddle
219
257
  #
220
258
  # @param processed_at [Time, nil] Processed at.
221
259
  #
222
- # @param related_payments [Hash{Symbol=>Symbol, Straddle::Models::PayoutUnmaskResponse::Data::RelatedPayment}, nil] Related payments.
260
+ # @param related_payments [Array<Straddle::Models::PayoutUnmaskResponse::Data::RelatedPayment>, nil] Related payments.
223
261
  #
224
262
  # @param updated_at [Time, nil] Updated at.
225
263
 
@@ -268,6 +306,8 @@ module Straddle
268
306
  REVERSED_CUSTOMER_DISPUTE = :reversed_customer_dispute
269
307
  FAILED_CLOSED_BANK_ACCOUNT = :failed_closed_bank_account
270
308
  REVERSED_CLOSED_BANK_ACCOUNT = :reversed_closed_bank_account
309
+ FAILED_NOT_AUTHORIZED = :failed_not_authorized
310
+ REVERSED_NOT_AUTHORIZED = :reversed_not_authorized
271
311
 
272
312
  # @!method self.values
273
313
  # @return [Array<Symbol>]
@@ -438,6 +478,58 @@ module Straddle
438
478
  end
439
479
  end
440
480
 
481
+ class Document < Straddle::Internal::Type::BaseModel
482
+ # @!attribute document_id
483
+ # Unique identifier for this document.
484
+ #
485
+ # @return [String]
486
+ required :document_id, String
487
+
488
+ # @!attribute document_name
489
+ # The file name of this document as uploaded.
490
+ #
491
+ # @return [String]
492
+ required :document_name, String
493
+
494
+ # @!attribute document_size
495
+ # The size of this document in bytes.
496
+ #
497
+ # @return [Integer]
498
+ required :document_size, Integer
499
+
500
+ # @!attribute document_type
501
+ #
502
+ # @return [Symbol, Straddle::Models::PayoutUnmaskResponse::Data::Document::DocumentType]
503
+ required :document_type, enum: -> { Straddle::Models::PayoutUnmaskResponse::Data::Document::DocumentType }
504
+
505
+ # @!attribute uploaded_at
506
+ # The UTC timestamp when this document was uploaded.
507
+ #
508
+ # @return [Time]
509
+ required :uploaded_at, Time
510
+
511
+ # @!method initialize(document_id:, document_name:, document_size:, document_type:, uploaded_at:)
512
+ # @param document_id [String] Unique identifier for this document.
513
+ #
514
+ # @param document_name [String] The file name of this document as uploaded.
515
+ #
516
+ # @param document_size [Integer] The size of this document in bytes.
517
+ #
518
+ # @param document_type [Symbol, Straddle::Models::PayoutUnmaskResponse::Data::Document::DocumentType]
519
+ #
520
+ # @param uploaded_at [Time] The UTC timestamp when this document was uploaded.
521
+
522
+ # @see Straddle::Models::PayoutUnmaskResponse::Data::Document#document_type
523
+ module DocumentType
524
+ extend Straddle::Internal::Type::Enum
525
+
526
+ PAYMENT_AUTHORIZATION = :payment_authorization
527
+
528
+ # @!method self.values
529
+ # @return [Array<Symbol>]
530
+ end
531
+ end
532
+
441
533
  # The payment rail used for the charge or payout.
442
534
  #
443
535
  # @see Straddle::Models::PayoutUnmaskResponse::Data#payment_rail
@@ -450,15 +542,57 @@ module Straddle
450
542
  # @return [Array<Symbol>]
451
543
  end
452
544
 
453
- module RelatedPayment
454
- extend Straddle::Internal::Type::Enum
545
+ class RelatedPayment < Straddle::Internal::Type::BaseModel
546
+ # @!attribute id
547
+ # The ID of the related payment.
548
+ #
549
+ # @return [String]
550
+ required :id, String
455
551
 
456
- ORIGINAL = :original
457
- RESUBMIT = :resubmit
458
- REFUND = :refund
552
+ # @!attribute payment_type
553
+ # The type of payment.
554
+ #
555
+ # @return [Symbol, Straddle::Models::PayoutUnmaskResponse::Data::RelatedPayment::PaymentType]
556
+ required :payment_type,
557
+ enum: -> { Straddle::Models::PayoutUnmaskResponse::Data::RelatedPayment::PaymentType }
459
558
 
460
- # @!method self.values
461
- # @return [Array<Symbol>]
559
+ # @!attribute relationship
560
+ #
561
+ # @return [Symbol, Straddle::Models::PayoutUnmaskResponse::Data::RelatedPayment::Relationship]
562
+ required :relationship,
563
+ enum: -> { Straddle::Models::PayoutUnmaskResponse::Data::RelatedPayment::Relationship }
564
+
565
+ # @!method initialize(id:, payment_type:, relationship:)
566
+ # @param id [String] The ID of the related payment.
567
+ #
568
+ # @param payment_type [Symbol, Straddle::Models::PayoutUnmaskResponse::Data::RelatedPayment::PaymentType] The type of payment.
569
+ #
570
+ # @param relationship [Symbol, Straddle::Models::PayoutUnmaskResponse::Data::RelatedPayment::Relationship]
571
+
572
+ # The type of payment.
573
+ #
574
+ # @see Straddle::Models::PayoutUnmaskResponse::Data::RelatedPayment#payment_type
575
+ module PaymentType
576
+ extend Straddle::Internal::Type::Enum
577
+
578
+ CHARGE = :charge
579
+ PAYOUT = :payout
580
+
581
+ # @!method self.values
582
+ # @return [Array<Symbol>]
583
+ end
584
+
585
+ # @see Straddle::Models::PayoutUnmaskResponse::Data::RelatedPayment#relationship
586
+ module Relationship
587
+ extend Straddle::Internal::Type::Enum
588
+
589
+ ORIGINAL = :original
590
+ RESUBMIT = :resubmit
591
+ REFUND = :refund
592
+
593
+ # @!method self.values
594
+ # @return [Array<Symbol>]
595
+ end
462
596
  end
463
597
  end
464
598
 
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Straddle
4
+ module Models
5
+ # @see Straddle::Resources::Payouts#upload_authorization_document
6
+ class PayoutUploadAuthorizationDocumentParams < Straddle::Internal::Type::BaseModel
7
+ extend Straddle::Internal::Type::RequestParameters::Converter
8
+ include Straddle::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!attribute file
16
+ # The document file to upload as proof of authorization for this payout.
17
+ #
18
+ # @return [Pathname, StringIO, IO, String, Straddle::FilePart]
19
+ required :file, Straddle::Internal::Type::FileInput, api_name: :File
20
+
21
+ # @!attribute correlation_id
22
+ #
23
+ # @return [String, nil]
24
+ optional :correlation_id, String
25
+
26
+ # @!attribute idempotency_key
27
+ #
28
+ # @return [String, nil]
29
+ optional :idempotency_key, String
30
+
31
+ # @!attribute request_id
32
+ #
33
+ # @return [String, nil]
34
+ optional :request_id, String
35
+
36
+ # @!attribute straddle_account_id
37
+ #
38
+ # @return [String, nil]
39
+ optional :straddle_account_id, String
40
+
41
+ # @!method initialize(id:, file:, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {})
42
+ # @param id [String]
43
+ #
44
+ # @param file [Pathname, StringIO, IO, String, Straddle::FilePart] The document file to upload as proof of authorization for this payout.
45
+ #
46
+ # @param correlation_id [String]
47
+ #
48
+ # @param idempotency_key [String]
49
+ #
50
+ # @param request_id [String]
51
+ #
52
+ # @param straddle_account_id [String]
53
+ #
54
+ # @param request_options [Straddle::RequestOptions, Hash{Symbol=>Object}]
55
+ end
56
+ end
57
+ end
@@ -88,6 +88,24 @@ module Straddle
88
88
  # @return [Array<String>]
89
89
  required :funding_ids, Straddle::Internal::Type::ArrayOf[String]
90
90
 
91
+ # @!attribute has_resubmit
92
+ # Has the payout been resubmitted.
93
+ #
94
+ # @return [Boolean]
95
+ required :has_resubmit, Straddle::Internal::Type::Boolean
96
+
97
+ # @!attribute is_refund
98
+ # Is the payout a refund of an original charge.
99
+ #
100
+ # @return [Boolean]
101
+ required :is_refund, Straddle::Internal::Type::Boolean
102
+
103
+ # @!attribute is_resubmit
104
+ # Is the payout a resubmit of an original payout.
105
+ #
106
+ # @return [Boolean]
107
+ required :is_resubmit, Straddle::Internal::Type::Boolean
108
+
91
109
  # @!attribute paykey
92
110
  # Value of the `paykey` used for the payout.
93
111
  #
@@ -138,6 +156,15 @@ module Straddle
138
156
  # @return [Straddle::Models::CustomerDetailsV1, nil]
139
157
  optional :customer_details, -> { Straddle::CustomerDetailsV1 }
140
158
 
159
+ # @!attribute documents
160
+ # Documents uploaded for this payout (e.g. proof of authorization), in the order
161
+ # they were uploaded.
162
+ #
163
+ # @return [Array<Straddle::Models::PayoutV1::Data::Document>, nil]
164
+ optional :documents,
165
+ -> { Straddle::Internal::Type::ArrayOf[Straddle::PayoutV1::Data::Document] },
166
+ nil?: true
167
+
141
168
  # @!attribute effective_at
142
169
  # The actual date on which the payment occurred. For payouts, this is the date the
143
170
  # funds were sent from your bank account.
@@ -174,9 +201,9 @@ module Straddle
174
201
  # @!attribute related_payments
175
202
  # Related payments.
176
203
  #
177
- # @return [Hash{Symbol=>Symbol, Straddle::Models::PayoutV1::Data::RelatedPayment}, nil]
204
+ # @return [Array<Straddle::Models::PayoutV1::Data::RelatedPayment>, nil]
178
205
  optional :related_payments,
179
- -> { Straddle::Internal::Type::HashOf[enum: Straddle::PayoutV1::Data::RelatedPayment] },
206
+ -> { Straddle::Internal::Type::ArrayOf[Straddle::PayoutV1::Data::RelatedPayment] },
180
207
  nil?: true
181
208
 
182
209
  # @!attribute updated_at
@@ -185,7 +212,7 @@ module Straddle
185
212
  # @return [Time, nil]
186
213
  optional :updated_at, Time, nil?: true
187
214
 
188
- # @!method initialize(id:, amount:, config:, currency:, description:, device:, external_id:, funding_ids:, paykey:, payment_date:, status:, status_details:, status_history:, trace_ids:, created_at: nil, customer_details: nil, effective_at: nil, metadata: nil, paykey_details: nil, payment_rail: nil, processed_at: nil, related_payments: nil, updated_at: nil)
215
+ # @!method initialize(id:, amount:, config:, currency:, description:, device:, external_id:, funding_ids:, has_resubmit:, is_refund:, is_resubmit:, paykey:, payment_date:, status:, status_details:, status_history:, trace_ids:, created_at: nil, customer_details: nil, documents: nil, effective_at: nil, metadata: nil, paykey_details: nil, payment_rail: nil, processed_at: nil, related_payments: nil, updated_at: nil)
189
216
  # Some parameter documentations has been truncated, see
190
217
  # {Straddle::Models::PayoutV1::Data} for more details.
191
218
  #
@@ -205,6 +232,12 @@ module Straddle
205
232
  #
206
233
  # @param funding_ids [Array<String>] Funding Ids
207
234
  #
235
+ # @param has_resubmit [Boolean] Has the payout been resubmitted.
236
+ #
237
+ # @param is_refund [Boolean] Is the payout a refund of an original charge.
238
+ #
239
+ # @param is_resubmit [Boolean] Is the payout a resubmit of an original payout.
240
+ #
208
241
  # @param paykey [String] Value of the `paykey` used for the payout.
209
242
  #
210
243
  # @param payment_date [Date] The desired date on which the payment should be occur. For payouts, this means t
@@ -221,6 +254,8 @@ module Straddle
221
254
  #
222
255
  # @param customer_details [Straddle::Models::CustomerDetailsV1] Information about the customer associated with the payout.
223
256
  #
257
+ # @param documents [Array<Straddle::Models::PayoutV1::Data::Document>, nil] Documents uploaded for this payout (e.g. proof of authorization), in the order t
258
+ #
224
259
  # @param effective_at [Time, nil] The actual date on which the payment occurred. For payouts, this is the date the
225
260
  #
226
261
  # @param metadata [Hash{Symbol=>String}, nil] Up to 20 additional user-defined key-value pairs. Useful for storing additional
@@ -231,7 +266,7 @@ module Straddle
231
266
  #
232
267
  # @param processed_at [Time, nil] The time the payout was processed by Straddle and originated to the payment rail
233
268
  #
234
- # @param related_payments [Hash{Symbol=>Symbol, Straddle::Models::PayoutV1::Data::RelatedPayment}, nil] Related payments.
269
+ # @param related_payments [Array<Straddle::Models::PayoutV1::Data::RelatedPayment>, nil] Related payments.
235
270
  #
236
271
  # @param updated_at [Time, nil] The time the payout was last updated.
237
272
 
@@ -281,6 +316,8 @@ module Straddle
281
316
  REVERSED_CUSTOMER_DISPUTE = :reversed_customer_dispute
282
317
  FAILED_CLOSED_BANK_ACCOUNT = :failed_closed_bank_account
283
318
  REVERSED_CLOSED_BANK_ACCOUNT = :reversed_closed_bank_account
319
+ FAILED_NOT_AUTHORIZED = :failed_not_authorized
320
+ REVERSED_NOT_AUTHORIZED = :reversed_not_authorized
284
321
 
285
322
  # @!method self.values
286
323
  # @return [Array<Symbol>]
@@ -439,6 +476,58 @@ module Straddle
439
476
  end
440
477
  end
441
478
 
479
+ class Document < Straddle::Internal::Type::BaseModel
480
+ # @!attribute document_id
481
+ # Unique identifier for this document.
482
+ #
483
+ # @return [String]
484
+ required :document_id, String
485
+
486
+ # @!attribute document_name
487
+ # The file name of this document as uploaded.
488
+ #
489
+ # @return [String]
490
+ required :document_name, String
491
+
492
+ # @!attribute document_size
493
+ # The size of this document in bytes.
494
+ #
495
+ # @return [Integer]
496
+ required :document_size, Integer
497
+
498
+ # @!attribute document_type
499
+ #
500
+ # @return [Symbol, Straddle::Models::PayoutV1::Data::Document::DocumentType]
501
+ required :document_type, enum: -> { Straddle::PayoutV1::Data::Document::DocumentType }
502
+
503
+ # @!attribute uploaded_at
504
+ # The UTC timestamp when this document was uploaded.
505
+ #
506
+ # @return [Time]
507
+ required :uploaded_at, Time
508
+
509
+ # @!method initialize(document_id:, document_name:, document_size:, document_type:, uploaded_at:)
510
+ # @param document_id [String] Unique identifier for this document.
511
+ #
512
+ # @param document_name [String] The file name of this document as uploaded.
513
+ #
514
+ # @param document_size [Integer] The size of this document in bytes.
515
+ #
516
+ # @param document_type [Symbol, Straddle::Models::PayoutV1::Data::Document::DocumentType]
517
+ #
518
+ # @param uploaded_at [Time] The UTC timestamp when this document was uploaded.
519
+
520
+ # @see Straddle::Models::PayoutV1::Data::Document#document_type
521
+ module DocumentType
522
+ extend Straddle::Internal::Type::Enum
523
+
524
+ PAYMENT_AUTHORIZATION = :payment_authorization
525
+
526
+ # @!method self.values
527
+ # @return [Array<Symbol>]
528
+ end
529
+ end
530
+
442
531
  # The payment rail used for the payout.
443
532
  #
444
533
  # @see Straddle::Models::PayoutV1::Data#payment_rail
@@ -451,15 +540,55 @@ module Straddle
451
540
  # @return [Array<Symbol>]
452
541
  end
453
542
 
454
- module RelatedPayment
455
- extend Straddle::Internal::Type::Enum
543
+ class RelatedPayment < Straddle::Internal::Type::BaseModel
544
+ # @!attribute id
545
+ # The ID of the related payment.
546
+ #
547
+ # @return [String]
548
+ required :id, String
456
549
 
457
- ORIGINAL = :original
458
- RESUBMIT = :resubmit
459
- REFUND = :refund
550
+ # @!attribute payment_type
551
+ # The type of payment.
552
+ #
553
+ # @return [Symbol, Straddle::Models::PayoutV1::Data::RelatedPayment::PaymentType]
554
+ required :payment_type, enum: -> { Straddle::PayoutV1::Data::RelatedPayment::PaymentType }
460
555
 
461
- # @!method self.values
462
- # @return [Array<Symbol>]
556
+ # @!attribute relationship
557
+ #
558
+ # @return [Symbol, Straddle::Models::PayoutV1::Data::RelatedPayment::Relationship]
559
+ required :relationship, enum: -> { Straddle::PayoutV1::Data::RelatedPayment::Relationship }
560
+
561
+ # @!method initialize(id:, payment_type:, relationship:)
562
+ # @param id [String] The ID of the related payment.
563
+ #
564
+ # @param payment_type [Symbol, Straddle::Models::PayoutV1::Data::RelatedPayment::PaymentType] The type of payment.
565
+ #
566
+ # @param relationship [Symbol, Straddle::Models::PayoutV1::Data::RelatedPayment::Relationship]
567
+
568
+ # The type of payment.
569
+ #
570
+ # @see Straddle::Models::PayoutV1::Data::RelatedPayment#payment_type
571
+ module PaymentType
572
+ extend Straddle::Internal::Type::Enum
573
+
574
+ CHARGE = :charge
575
+ PAYOUT = :payout
576
+
577
+ # @!method self.values
578
+ # @return [Array<Symbol>]
579
+ end
580
+
581
+ # @see Straddle::Models::PayoutV1::Data::RelatedPayment#relationship
582
+ module Relationship
583
+ extend Straddle::Internal::Type::Enum
584
+
585
+ ORIGINAL = :original
586
+ RESUBMIT = :resubmit
587
+ REFUND = :refund
588
+
589
+ # @!method self.values
590
+ # @return [Array<Symbol>]
591
+ end
463
592
  end
464
593
  end
465
594
 
@@ -141,6 +141,8 @@ module Straddle
141
141
 
142
142
  PayoutUpdateParams = Straddle::Models::PayoutUpdateParams
143
143
 
144
+ PayoutUploadAuthorizationDocumentParams = Straddle::Models::PayoutUploadAuthorizationDocumentParams
145
+
144
146
  PayoutV1 = Straddle::Models::PayoutV1
145
147
 
146
148
  ReportCreateTotalCustomersByStatusParams = Straddle::Models::ReportCreateTotalCustomersByStatusParams
@@ -111,7 +111,9 @@ module Straddle
111
111
  # created accounts appearing first. This endpoint supports advanced sorting and
112
112
  # filtering options.
113
113
  #
114
- # @overload list(page_number: nil, page_size: nil, search_text: nil, sort_by: nil, sort_order: nil, status: nil, type: nil, correlation_id: nil, request_id: nil, request_options: {})
114
+ # @overload list(external_id: nil, page_number: nil, page_size: nil, search_text: nil, sort_by: nil, sort_order: nil, status: nil, type: nil, correlation_id: nil, request_id: nil, request_options: {})
115
+ #
116
+ # @param external_id [String] Query param
115
117
  #
116
118
  # @param page_number [Integer] Query param: Results page number. Starts at page 1. Default value: 1
117
119
  #
@@ -137,7 +139,8 @@ module Straddle
137
139
  #
138
140
  # @see Straddle::Models::Embed::AccountListParams
139
141
  def list(params = {})
140
- query_params = [:page_number, :page_size, :search_text, :sort_by, :sort_order, :status, :type]
142
+ query_params =
143
+ [:external_id, :page_number, :page_size, :search_text, :sort_by, :sort_order, :status, :type]
141
144
  parsed, options = Straddle::Embed::AccountListParams.dump_request(params)
142
145
  query = Straddle::Internal::Util.encode_query_params(parsed.slice(*query_params))
143
146
  @client.request(
@@ -22,7 +22,11 @@ module Straddle
22
22
  # Returns a list of paykeys associated with a Straddle account. This endpoint
23
23
  # supports advanced sorting and filtering options.
24
24
  #
25
- # @overload list(customer_id: nil, page_number: nil, page_size: nil, search_text: nil, sort_by: nil, sort_order: nil, source: nil, status: nil, unblock_eligible: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {})
25
+ # @overload list(created_from: nil, created_to: nil, customer_id: nil, page_number: nil, page_size: nil, search_text: nil, sort_by: nil, sort_order: nil, source: nil, status: nil, unblock_eligible: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {})
26
+ #
27
+ # @param created_from [Time] Query param: Start date for filtering by creation date.
28
+ #
29
+ # @param created_to [Time] Query param: End date for filtering by creation date.
26
30
  #
27
31
  # @param customer_id [String] Query param: Filter paykeys by related customer ID.
28
32
  #
@@ -56,6 +60,8 @@ module Straddle
56
60
  def list(params = {})
57
61
  query_params =
58
62
  [
63
+ :created_from,
64
+ :created_to,
59
65
  :customer_id,
60
66
  :page_number,
61
67
  :page_size,
@@ -11,7 +11,7 @@ module Straddle
11
11
  # Search for payments, including `charges` and `payouts`, using a variety of
12
12
  # criteria. This endpoint supports advanced sorting and filtering options.
13
13
  #
14
- # @overload list(customer_id: nil, default_page_size: nil, default_sort: nil, default_sort_order: nil, external_id: nil, funding_id: nil, include_metadata: nil, max_amount: nil, max_created_at: nil, max_effective_at: nil, max_payment_date: nil, min_amount: nil, min_created_at: nil, min_effective_at: nil, min_payment_date: nil, page_number: nil, page_size: nil, paykey: nil, paykey_id: nil, payment_id: nil, payment_status: nil, payment_type: nil, search_text: nil, sort_by: nil, sort_order: nil, status_reason: nil, status_source: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {})
14
+ # @overload list(customer_id: nil, default_page_size: nil, default_sort: nil, default_sort_order: nil, external_id: nil, funding_id: nil, has_refund: nil, has_resubmit: nil, include_metadata: nil, is_refund: nil, is_resubmit: nil, max_amount: nil, max_created_at: nil, max_effective_at: nil, max_payment_date: nil, max_updated_at: nil, min_amount: nil, min_created_at: nil, min_effective_at: nil, min_payment_date: nil, min_updated_at: nil, page_number: nil, page_size: nil, paykey: nil, paykey_id: nil, payment_id: nil, payment_status: nil, payment_type: nil, search_text: nil, sort_by: nil, sort_order: nil, status_reason: nil, status_source: nil, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {})
15
15
  #
16
16
  # @param customer_id [String] Query param: Search using the `customer_id` of a `charge` or `payout`.
17
17
  #
@@ -25,8 +25,16 @@ module Straddle
25
25
  #
26
26
  # @param funding_id [String] Query param: Search using the `funding_id` of a `charge` or `payout`.
27
27
  #
28
+ # @param has_refund [Boolean] Query param: Has the payment been refunded by an associated payout (only applica
29
+ #
30
+ # @param has_resubmit [Boolean] Query param: Has the payment been resubmitted.
31
+ #
28
32
  # @param include_metadata [Boolean] Query param: Include the metadata for payments in the returned data.
29
33
  #
34
+ # @param is_refund [Boolean] Query param: Is the payment a refund of an original charge (only applicable to p
35
+ #
36
+ # @param is_resubmit [Boolean] Query param: Is the payment a resubmit of an original payment.
37
+ #
30
38
  # @param max_amount [Integer] Query param: Search using a maximum `amount` of a `charge` or `payout`.
31
39
  #
32
40
  # @param max_created_at [Time] Query param: Search using the latest `created_at` date of a `charge` or `payout`
@@ -35,6 +43,8 @@ module Straddle
35
43
  #
36
44
  # @param max_payment_date [Date] Query param: Search using the latest `payment_date` of a `charge` or `payout`.
37
45
  #
46
+ # @param max_updated_at [Time] Query param: Filter to payments last updated on or before this timestamp.
47
+ #
38
48
  # @param min_amount [Integer] Query param: Search using the minimum `amount of a `charge`or`payout`.
39
49
  #
40
50
  # @param min_created_at [Time] Query param: Search using the earliest `created_at` date of a `charge` or `payou
@@ -43,6 +53,8 @@ module Straddle
43
53
  #
44
54
  # @param min_payment_date [Date] Query param: Search using the earliest ` `of a `charge` or `payout`.
45
55
  #
56
+ # @param min_updated_at [Time] Query param: Filter to payments last updated on or after this timestamp.
57
+ #
46
58
  # @param page_number [Integer] Query param: Results page number. Starts at page 1.
47
59
  #
48
60
  # @param page_size [Integer] Query param: Results page size. Max value: 1000
@@ -87,15 +99,21 @@ module Straddle
87
99
  :default_sort_order,
88
100
  :external_id,
89
101
  :funding_id,
102
+ :has_refund,
103
+ :has_resubmit,
90
104
  :include_metadata,
105
+ :is_refund,
106
+ :is_resubmit,
91
107
  :max_amount,
92
108
  :max_created_at,
93
109
  :max_effective_at,
94
110
  :max_payment_date,
111
+ :max_updated_at,
95
112
  :min_amount,
96
113
  :min_created_at,
97
114
  :min_effective_at,
98
115
  :min_payment_date,
116
+ :min_updated_at,
99
117
  :page_number,
100
118
  :page_size,
101
119
  :paykey,
@@ -311,6 +311,55 @@ module Straddle
311
311
  )
312
312
  end
313
313
 
314
+ # Some parameter documentations has been truncated, see
315
+ # {Straddle::Models::PayoutUploadAuthorizationDocumentParams} for more details.
316
+ #
317
+ # Uploads a document as proof of authorization for a payout. Uploading again adds
318
+ # another entry to documents rather than replacing the previous one.
319
+ #
320
+ # @overload upload_authorization_document(id, file:, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {})
321
+ #
322
+ # @param id [String] Path param
323
+ #
324
+ # @param file [Pathname, StringIO, IO, String, Straddle::FilePart] Body param: The document file to upload as proof of authorization for this payou
325
+ #
326
+ # @param correlation_id [String] Header param: Optional client generated identifier to trace and debug a series o
327
+ #
328
+ # @param idempotency_key [String] Header param: Optional client generated value to use for idempotent requests.
329
+ #
330
+ # @param request_id [String] Header param: Optional client generated identifier to trace and debug a request.
331
+ #
332
+ # @param straddle_account_id [String] Header param: For use by platforms to specify an account id and set scope of a r
333
+ #
334
+ # @param request_options [Straddle::RequestOptions, Hash{Symbol=>Object}, nil]
335
+ #
336
+ # @return [Straddle::Models::PayoutV1]
337
+ #
338
+ # @see Straddle::Models::PayoutUploadAuthorizationDocumentParams
339
+ def upload_authorization_document(id, params)
340
+ parsed, options = Straddle::PayoutUploadAuthorizationDocumentParams.dump_request(params)
341
+ header_params =
342
+ {
343
+ correlation_id: "correlation-id",
344
+ idempotency_key: "idempotency-key",
345
+ request_id: "request-id",
346
+ straddle_account_id: "straddle-account-id"
347
+ }
348
+ @client.request(
349
+ method: :post,
350
+ path: ["v1/payouts/%1$s/authorization", id],
351
+ headers: {
352
+ "content-type" => "multipart/form-data",
353
+ **parsed.slice(*header_params.keys)
354
+ }.transform_keys(
355
+ header_params
356
+ ),
357
+ body: parsed.except(*header_params.keys),
358
+ model: Straddle::PayoutV1,
359
+ options: options
360
+ )
361
+ end
362
+
314
363
  # @api private
315
364
  #
316
365
  # @param client [Straddle::Client]