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
@@ -103,6 +103,24 @@ module Straddle
103
103
  # @return [Array<String>]
104
104
  required :funding_ids, Straddle::Internal::Type::ArrayOf[String]
105
105
 
106
+ # @!attribute has_refund
107
+ # Has the charge been refunded by an associated payout.
108
+ #
109
+ # @return [Boolean]
110
+ required :has_refund, Straddle::Internal::Type::Boolean
111
+
112
+ # @!attribute has_resubmit
113
+ # Has the charge been resubmitted.
114
+ #
115
+ # @return [Boolean]
116
+ required :has_resubmit, Straddle::Internal::Type::Boolean
117
+
118
+ # @!attribute is_resubmit
119
+ # Is the charge a resubmit of an original charge.
120
+ #
121
+ # @return [Boolean]
122
+ required :is_resubmit, Straddle::Internal::Type::Boolean
123
+
106
124
  # @!attribute paykey
107
125
  # Value of the `paykey` used for the charge.
108
126
  #
@@ -153,6 +171,15 @@ module Straddle
153
171
  # @return [Straddle::Models::CustomerDetailsV1, nil]
154
172
  optional :customer_details, -> { Straddle::CustomerDetailsV1 }
155
173
 
174
+ # @!attribute documents
175
+ # Documents uploaded for this charge (e.g. proof of authorization), in the order
176
+ # they were uploaded.
177
+ #
178
+ # @return [Array<Straddle::Models::ChargeV1::Data::Document>, nil]
179
+ optional :documents,
180
+ -> { Straddle::Internal::Type::ArrayOf[Straddle::ChargeV1::Data::Document] },
181
+ nil?: true
182
+
156
183
  # @!attribute effective_at
157
184
  # Timestamp of when the charge was effective in the customer's bank account,
158
185
  # otherwise known as the date on which the customer is debited.
@@ -189,12 +216,12 @@ module Straddle
189
216
  # @!attribute related_payments
190
217
  # Related payments.
191
218
  #
192
- # @return [Hash{Symbol=>Symbol, Straddle::Models::ChargeV1::Data::RelatedPayment}, nil]
219
+ # @return [Array<Straddle::Models::ChargeV1::Data::RelatedPayment>, nil]
193
220
  optional :related_payments,
194
- -> { Straddle::Internal::Type::HashOf[enum: Straddle::ChargeV1::Data::RelatedPayment] },
221
+ -> { Straddle::Internal::Type::ArrayOf[Straddle::ChargeV1::Data::RelatedPayment] },
195
222
  nil?: true
196
223
 
197
- # @!method initialize(id:, amount:, config:, consent_type:, created_at:, currency:, description:, device:, external_id:, funding_ids:, paykey:, payment_date:, status:, status_details:, status_history:, trace_ids:, updated_at:, customer_details: nil, effective_at: nil, metadata: nil, paykey_details: nil, payment_rail: nil, processed_at: nil, related_payments: nil)
224
+ # @!method initialize(id:, amount:, config:, consent_type:, created_at:, currency:, description:, device:, external_id:, funding_ids:, has_refund:, has_resubmit:, is_resubmit:, paykey:, payment_date:, status:, status_details:, status_history:, trace_ids:, updated_at:, customer_details: nil, documents: nil, effective_at: nil, metadata: nil, paykey_details: nil, payment_rail: nil, processed_at: nil, related_payments: nil)
198
225
  # Some parameter documentations has been truncated, see
199
226
  # {Straddle::Models::ChargeV1::Data} for more details.
200
227
  #
@@ -218,6 +245,12 @@ module Straddle
218
245
  #
219
246
  # @param funding_ids [Array<String>] Funding Ids
220
247
  #
248
+ # @param has_refund [Boolean] Has the charge been refunded by an associated payout.
249
+ #
250
+ # @param has_resubmit [Boolean] Has the charge been resubmitted.
251
+ #
252
+ # @param is_resubmit [Boolean] Is the charge a resubmit of an original charge.
253
+ #
221
254
  # @param paykey [String] Value of the `paykey` used for the charge.
222
255
  #
223
256
  # @param payment_date [Date] The desired date on which the payment should be occur. For charges, this means t
@@ -234,6 +267,8 @@ module Straddle
234
267
  #
235
268
  # @param customer_details [Straddle::Models::CustomerDetailsV1] Information about the customer associated with the charge.
236
269
  #
270
+ # @param documents [Array<Straddle::Models::ChargeV1::Data::Document>, nil] Documents uploaded for this charge (e.g. proof of authorization), in the order t
271
+ #
237
272
  # @param effective_at [Time, nil] Timestamp of when the charge was effective in the customer's bank account, other
238
273
  #
239
274
  # @param metadata [Hash{Symbol=>String}, nil] Up to 20 additional user-defined key-value pairs. Useful for storing additional
@@ -244,7 +279,7 @@ module Straddle
244
279
  #
245
280
  # @param processed_at [Time, nil] Timestamp of when the charge was processed by Straddle and originated to the pay
246
281
  #
247
- # @param related_payments [Hash{Symbol=>Symbol, Straddle::Models::ChargeV1::Data::RelatedPayment}, nil] Related payments.
282
+ # @param related_payments [Array<Straddle::Models::ChargeV1::Data::RelatedPayment>, nil] Related payments.
248
283
 
249
284
  # @see Straddle::Models::ChargeV1::Data#config
250
285
  class Config < Straddle::Internal::Type::BaseModel
@@ -314,6 +349,8 @@ module Straddle
314
349
  REVERSED_CUSTOMER_DISPUTE = :reversed_customer_dispute
315
350
  FAILED_CLOSED_BANK_ACCOUNT = :failed_closed_bank_account
316
351
  REVERSED_CLOSED_BANK_ACCOUNT = :reversed_closed_bank_account
352
+ FAILED_NOT_AUTHORIZED = :failed_not_authorized
353
+ REVERSED_NOT_AUTHORIZED = :reversed_not_authorized
317
354
 
318
355
  # @!method self.values
319
356
  # @return [Array<Symbol>]
@@ -490,6 +527,58 @@ module Straddle
490
527
  end
491
528
  end
492
529
 
530
+ class Document < Straddle::Internal::Type::BaseModel
531
+ # @!attribute document_id
532
+ # Unique identifier for this document.
533
+ #
534
+ # @return [String]
535
+ required :document_id, String
536
+
537
+ # @!attribute document_name
538
+ # The file name of this document as uploaded.
539
+ #
540
+ # @return [String]
541
+ required :document_name, String
542
+
543
+ # @!attribute document_size
544
+ # The size of this document in bytes.
545
+ #
546
+ # @return [Integer]
547
+ required :document_size, Integer
548
+
549
+ # @!attribute document_type
550
+ #
551
+ # @return [Symbol, Straddle::Models::ChargeV1::Data::Document::DocumentType]
552
+ required :document_type, enum: -> { Straddle::ChargeV1::Data::Document::DocumentType }
553
+
554
+ # @!attribute uploaded_at
555
+ # The UTC timestamp when this document was uploaded.
556
+ #
557
+ # @return [Time]
558
+ required :uploaded_at, Time
559
+
560
+ # @!method initialize(document_id:, document_name:, document_size:, document_type:, uploaded_at:)
561
+ # @param document_id [String] Unique identifier for this document.
562
+ #
563
+ # @param document_name [String] The file name of this document as uploaded.
564
+ #
565
+ # @param document_size [Integer] The size of this document in bytes.
566
+ #
567
+ # @param document_type [Symbol, Straddle::Models::ChargeV1::Data::Document::DocumentType]
568
+ #
569
+ # @param uploaded_at [Time] The UTC timestamp when this document was uploaded.
570
+
571
+ # @see Straddle::Models::ChargeV1::Data::Document#document_type
572
+ module DocumentType
573
+ extend Straddle::Internal::Type::Enum
574
+
575
+ PAYMENT_AUTHORIZATION = :payment_authorization
576
+
577
+ # @!method self.values
578
+ # @return [Array<Symbol>]
579
+ end
580
+ end
581
+
493
582
  # The payment rail that the charge will be processed through.
494
583
  #
495
584
  # @see Straddle::Models::ChargeV1::Data#payment_rail
@@ -502,15 +591,55 @@ module Straddle
502
591
  # @return [Array<Symbol>]
503
592
  end
504
593
 
505
- module RelatedPayment
506
- extend Straddle::Internal::Type::Enum
594
+ class RelatedPayment < Straddle::Internal::Type::BaseModel
595
+ # @!attribute id
596
+ # The ID of the related payment.
597
+ #
598
+ # @return [String]
599
+ required :id, String
507
600
 
508
- ORIGINAL = :original
509
- RESUBMIT = :resubmit
510
- REFUND = :refund
601
+ # @!attribute payment_type
602
+ # The type of payment.
603
+ #
604
+ # @return [Symbol, Straddle::Models::ChargeV1::Data::RelatedPayment::PaymentType]
605
+ required :payment_type, enum: -> { Straddle::ChargeV1::Data::RelatedPayment::PaymentType }
511
606
 
512
- # @!method self.values
513
- # @return [Array<Symbol>]
607
+ # @!attribute relationship
608
+ #
609
+ # @return [Symbol, Straddle::Models::ChargeV1::Data::RelatedPayment::Relationship]
610
+ required :relationship, enum: -> { Straddle::ChargeV1::Data::RelatedPayment::Relationship }
611
+
612
+ # @!method initialize(id:, payment_type:, relationship:)
613
+ # @param id [String] The ID of the related payment.
614
+ #
615
+ # @param payment_type [Symbol, Straddle::Models::ChargeV1::Data::RelatedPayment::PaymentType] The type of payment.
616
+ #
617
+ # @param relationship [Symbol, Straddle::Models::ChargeV1::Data::RelatedPayment::Relationship]
618
+
619
+ # The type of payment.
620
+ #
621
+ # @see Straddle::Models::ChargeV1::Data::RelatedPayment#payment_type
622
+ module PaymentType
623
+ extend Straddle::Internal::Type::Enum
624
+
625
+ CHARGE = :charge
626
+ PAYOUT = :payout
627
+
628
+ # @!method self.values
629
+ # @return [Array<Symbol>]
630
+ end
631
+
632
+ # @see Straddle::Models::ChargeV1::Data::RelatedPayment#relationship
633
+ module Relationship
634
+ extend Straddle::Internal::Type::Enum
635
+
636
+ ORIGINAL = :original
637
+ RESUBMIT = :resubmit
638
+ REFUND = :refund
639
+
640
+ # @!method self.values
641
+ # @return [Array<Symbol>]
642
+ end
514
643
  end
515
644
  end
516
645
 
@@ -8,6 +8,11 @@ module Straddle
8
8
  extend Straddle::Internal::Type::RequestParameters::Converter
9
9
  include Straddle::Internal::Type::RequestParameters
10
10
 
11
+ # @!attribute external_id
12
+ #
13
+ # @return [String, nil]
14
+ optional :external_id, String
15
+
11
16
  # @!attribute page_number
12
17
  # Results page number. Starts at page 1. Default value: 1
13
18
  #
@@ -57,7 +62,9 @@ module Straddle
57
62
  # @return [String, nil]
58
63
  optional :request_id, String
59
64
 
60
- # @!method initialize(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: {})
65
+ # @!method initialize(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: {})
66
+ # @param external_id [String]
67
+ #
61
68
  # @param page_number [Integer] Results page number. Starts at page 1. Default value: 1
62
69
  #
63
70
  # @param page_size [Integer] Page size. Default value: 100. Max value: 1000
@@ -198,7 +198,7 @@ module Straddle
198
198
  required :control, Straddle::Internal::Type::Boolean
199
199
 
200
200
  # @!attribute owner
201
- # Whether the representative owns any percentage of of the equity interests of the
201
+ # Whether the representative owns any percentage of the equity interests of the
202
202
  # legal entity.
203
203
  #
204
204
  # @return [Boolean]
@@ -233,7 +233,7 @@ module Straddle
233
233
  #
234
234
  # @param control [Boolean] Whether the representative has significant responsibility to control, manage, or
235
235
  #
236
- # @param owner [Boolean] Whether the representative owns any percentage of of the equity interests of the
236
+ # @param owner [Boolean] Whether the representative owns any percentage of the equity interests of the le
237
237
  #
238
238
  # @param primary [Boolean] Whether the person is authorized as the primary representative of the account. T
239
239
  #
@@ -126,7 +126,7 @@ module Straddle
126
126
  required :control, Straddle::Internal::Type::Boolean
127
127
 
128
128
  # @!attribute owner
129
- # Whether the representative owns any percentage of of the equity interests of the
129
+ # Whether the representative owns any percentage of the equity interests of the
130
130
  # legal entity.
131
131
  #
132
132
  # @return [Boolean]
@@ -162,7 +162,7 @@ module Straddle
162
162
  #
163
163
  # @param control [Boolean] Whether the representative has significant responsibility to control, manage, or
164
164
  #
165
- # @param owner [Boolean] Whether the representative owns any percentage of of the equity interests of the
165
+ # @param owner [Boolean] Whether the representative owns any percentage of the equity interests of the le
166
166
  #
167
167
  # @param primary [Boolean] Whether the person is authorized as the primary representative of the account. T
168
168
  #
@@ -197,7 +197,7 @@ module Straddle
197
197
  required :control, Straddle::Internal::Type::Boolean
198
198
 
199
199
  # @!attribute owner
200
- # Whether the representative owns any percentage of of the equity interests of the
200
+ # Whether the representative owns any percentage of the equity interests of the
201
201
  # legal entity.
202
202
  #
203
203
  # @return [Boolean]
@@ -233,7 +233,7 @@ module Straddle
233
233
  #
234
234
  # @param control [Boolean] Whether the representative has significant responsibility to control, manage, or
235
235
  #
236
- # @param owner [Boolean] Whether the representative owns any percentage of of the equity interests of the
236
+ # @param owner [Boolean] Whether the representative owns any percentage of the equity interests of the le
237
237
  #
238
238
  # @param primary [Boolean] Whether the person is authorized as the primary representative of the account. T
239
239
  #
@@ -125,7 +125,7 @@ module Straddle
125
125
  required :control, Straddle::Internal::Type::Boolean
126
126
 
127
127
  # @!attribute owner
128
- # Whether the representative owns any percentage of of the equity interests of the
128
+ # Whether the representative owns any percentage of the equity interests of the
129
129
  # legal entity.
130
130
  #
131
131
  # @return [Boolean]
@@ -161,7 +161,7 @@ module Straddle
161
161
  #
162
162
  # @param control [Boolean] Whether the representative has significant responsibility to control, manage, or
163
163
  #
164
- # @param owner [Boolean] Whether the representative owns any percentage of of the equity interests of the
164
+ # @param owner [Boolean] Whether the representative owns any percentage of the equity interests of the le
165
165
  #
166
166
  # @param primary [Boolean] Whether the person is authorized as the primary representative of the account. T
167
167
  #
@@ -7,6 +7,18 @@ module Straddle
7
7
  extend Straddle::Internal::Type::RequestParameters::Converter
8
8
  include Straddle::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute created_from
11
+ # Start date for filtering by creation date.
12
+ #
13
+ # @return [Time, nil]
14
+ optional :created_from, Time
15
+
16
+ # @!attribute created_to
17
+ # End date for filtering by creation date.
18
+ #
19
+ # @return [Time, nil]
20
+ optional :created_to, Time
21
+
10
22
  # @!attribute customer_id
11
23
  # Filter paykeys by related customer ID.
12
24
  #
@@ -77,10 +89,14 @@ module Straddle
77
89
  # @return [String, nil]
78
90
  optional :straddle_account_id, String
79
91
 
80
- # @!method initialize(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: {})
92
+ # @!method initialize(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: {})
81
93
  # Some parameter documentations has been truncated, see
82
94
  # {Straddle::Models::PaykeyListParams} for more details.
83
95
  #
96
+ # @param created_from [Time] Start date for filtering by creation date.
97
+ #
98
+ # @param created_to [Time] End date for filtering by creation date.
99
+ #
84
100
  # @param customer_id [String] Filter paykeys by related customer ID.
85
101
  #
86
102
  # @param page_number [Integer] Page number for paginated results. Starts at 1.
@@ -41,12 +41,37 @@ module Straddle
41
41
  # @return [String, nil]
42
42
  optional :funding_id, String
43
43
 
44
+ # @!attribute has_refund
45
+ # Has the payment been refunded by an associated payout (only applicable to
46
+ # charges).
47
+ #
48
+ # @return [Boolean, nil]
49
+ optional :has_refund, Straddle::Internal::Type::Boolean
50
+
51
+ # @!attribute has_resubmit
52
+ # Has the payment been resubmitted.
53
+ #
54
+ # @return [Boolean, nil]
55
+ optional :has_resubmit, Straddle::Internal::Type::Boolean
56
+
44
57
  # @!attribute include_metadata
45
58
  # Include the metadata for payments in the returned data.
46
59
  #
47
60
  # @return [Boolean, nil]
48
61
  optional :include_metadata, Straddle::Internal::Type::Boolean
49
62
 
63
+ # @!attribute is_refund
64
+ # Is the payment a refund of an original charge (only applicable to payouts).
65
+ #
66
+ # @return [Boolean, nil]
67
+ optional :is_refund, Straddle::Internal::Type::Boolean
68
+
69
+ # @!attribute is_resubmit
70
+ # Is the payment a resubmit of an original payment.
71
+ #
72
+ # @return [Boolean, nil]
73
+ optional :is_resubmit, Straddle::Internal::Type::Boolean
74
+
50
75
  # @!attribute max_amount
51
76
  # Search using a maximum `amount` of a `charge` or `payout`.
52
77
  #
@@ -71,6 +96,12 @@ module Straddle
71
96
  # @return [Date, nil]
72
97
  optional :max_payment_date, Date
73
98
 
99
+ # @!attribute max_updated_at
100
+ # Filter to payments last updated on or before this timestamp.
101
+ #
102
+ # @return [Time, nil]
103
+ optional :max_updated_at, Time
104
+
74
105
  # @!attribute min_amount
75
106
  # Search using the minimum `amount of a `charge`or`payout`.
76
107
  #
@@ -95,6 +126,12 @@ module Straddle
95
126
  # @return [Date, nil]
96
127
  optional :min_payment_date, Date
97
128
 
129
+ # @!attribute min_updated_at
130
+ # Filter to payments last updated on or after this timestamp.
131
+ #
132
+ # @return [Time, nil]
133
+ optional :min_updated_at, Time
134
+
98
135
  # @!attribute page_number
99
136
  # Results page number. Starts at page 1.
100
137
  #
@@ -185,7 +222,10 @@ module Straddle
185
222
  # @return [String, nil]
186
223
  optional :straddle_account_id, String
187
224
 
188
- # @!method initialize(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: {})
225
+ # @!method initialize(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: {})
226
+ # Some parameter documentations has been truncated, see
227
+ # {Straddle::Models::PaymentListParams} for more details.
228
+ #
189
229
  # @param customer_id [String] Search using the `customer_id` of a `charge` or `payout`.
190
230
  #
191
231
  # @param default_page_size [Integer]
@@ -198,8 +238,16 @@ module Straddle
198
238
  #
199
239
  # @param funding_id [String] Search using the `funding_id` of a `charge` or `payout`.
200
240
  #
241
+ # @param has_refund [Boolean] Has the payment been refunded by an associated payout (only applicable to charge
242
+ #
243
+ # @param has_resubmit [Boolean] Has the payment been resubmitted.
244
+ #
201
245
  # @param include_metadata [Boolean] Include the metadata for payments in the returned data.
202
246
  #
247
+ # @param is_refund [Boolean] Is the payment a refund of an original charge (only applicable to payouts).
248
+ #
249
+ # @param is_resubmit [Boolean] Is the payment a resubmit of an original payment.
250
+ #
203
251
  # @param max_amount [Integer] Search using a maximum `amount` of a `charge` or `payout`.
204
252
  #
205
253
  # @param max_created_at [Time] Search using the latest `created_at` date of a `charge` or `payout`.
@@ -208,6 +256,8 @@ module Straddle
208
256
  #
209
257
  # @param max_payment_date [Date] Search using the latest `payment_date` of a `charge` or `payout`.
210
258
  #
259
+ # @param max_updated_at [Time] Filter to payments last updated on or before this timestamp.
260
+ #
211
261
  # @param min_amount [Integer] Search using the minimum `amount of a `charge`or`payout`.
212
262
  #
213
263
  # @param min_created_at [Time] Search using the earliest `created_at` date of a `charge` or `payout`.
@@ -216,6 +266,8 @@ module Straddle
216
266
  #
217
267
  # @param min_payment_date [Date] Search using the earliest ` `of a `charge` or `payout`.
218
268
  #
269
+ # @param min_updated_at [Time] Filter to payments last updated on or after this timestamp.
270
+ #
219
271
  # @param page_number [Integer] Results page number. Starts at page 1.
220
272
  #
221
273
  # @param page_size [Integer] Results page size. Max value: 1000
@@ -257,6 +309,7 @@ module Straddle
257
309
  EFFECTIVE_AT = :effective_at
258
310
  ID = :id
259
311
  AMOUNT = :amount
312
+ UPDATED_AT = :updated_at
260
313
 
261
314
  # @!method self.values
262
315
  # @return [Array<Symbol>]
@@ -310,6 +363,7 @@ module Straddle
310
363
  EFFECTIVE_AT = :effective_at
311
364
  ID = :id
312
365
  AMOUNT = :amount
366
+ UPDATED_AT = :updated_at
313
367
 
314
368
  # @!method self.values
315
369
  # @return [Array<Symbol>]
@@ -79,6 +79,31 @@ module Straddle
79
79
  # @return [Array<String>]
80
80
  required :funding_ids, Straddle::Internal::Type::ArrayOf[String]
81
81
 
82
+ # @!attribute has_refund
83
+ # Has the payment been refunded by an associated payout (only applicable to
84
+ # charges).
85
+ #
86
+ # @return [Boolean]
87
+ required :has_refund, Straddle::Internal::Type::Boolean
88
+
89
+ # @!attribute has_resubmit
90
+ # Has the payment been resubmitted.
91
+ #
92
+ # @return [Boolean]
93
+ required :has_resubmit, Straddle::Internal::Type::Boolean
94
+
95
+ # @!attribute is_refund
96
+ # Is the payment a refund of an original charge (only applicable to payouts).
97
+ #
98
+ # @return [Boolean]
99
+ required :is_refund, Straddle::Internal::Type::Boolean
100
+
101
+ # @!attribute is_resubmit
102
+ # Is the payment a resubmit of an original payment.
103
+ #
104
+ # @return [Boolean]
105
+ required :is_resubmit, Straddle::Internal::Type::Boolean
106
+
82
107
  # @!attribute paykey
83
108
  # Value of the `paykey` used for the `charge` or `payout`.
84
109
  #
@@ -156,7 +181,18 @@ module Straddle
156
181
  # @return [Straddle::Models::PaykeyDetailsV1, nil]
157
182
  optional :paykey_details, -> { Straddle::PaykeyDetailsV1 }
158
183
 
159
- # @!method initialize(id:, amount:, created_at:, currency:, description:, external_id:, funding_ids:, paykey:, payment_date:, payment_type:, status:, status_details:, trace_ids:, updated_at:, customer_details: nil, effective_at: nil, funding_id: nil, metadata: nil, paykey_details: nil)
184
+ # @!attribute related_payments
185
+ # Payments related to this one (e.g. refunds, resubmissions), mapped by payment ID
186
+ # to relationship type.
187
+ #
188
+ # @return [Array<Straddle::Models::PaymentSummaryPagedV1::Data::RelatedPayment>, nil]
189
+ optional :related_payments,
190
+ -> {
191
+ Straddle::Internal::Type::ArrayOf[Straddle::PaymentSummaryPagedV1::Data::RelatedPayment]
192
+ },
193
+ nil?: true
194
+
195
+ # @!method initialize(id:, amount:, created_at:, currency:, description:, external_id:, funding_ids:, has_refund:, has_resubmit:, is_refund:, is_resubmit:, paykey:, payment_date:, payment_type:, status:, status_details:, trace_ids:, updated_at:, customer_details: nil, effective_at: nil, funding_id: nil, metadata: nil, paykey_details: nil, related_payments: nil)
160
196
  # Some parameter documentations has been truncated, see
161
197
  # {Straddle::Models::PaymentSummaryPagedV1::Data} for more details.
162
198
  #
@@ -174,6 +210,14 @@ module Straddle
174
210
  #
175
211
  # @param funding_ids [Array<String>] Funding ids.
176
212
  #
213
+ # @param has_refund [Boolean] Has the payment been refunded by an associated payout (only applicable to charge
214
+ #
215
+ # @param has_resubmit [Boolean] Has the payment been resubmitted.
216
+ #
217
+ # @param is_refund [Boolean] Is the payment a refund of an original charge (only applicable to payouts).
218
+ #
219
+ # @param is_resubmit [Boolean] Is the payment a resubmit of an original payment.
220
+ #
177
221
  # @param paykey [String] Value of the `paykey` used for the `charge` or `payout`.
178
222
  #
179
223
  # @param payment_date [Date] The desired date on which the payment should be occur. For charges, this means t
@@ -197,6 +241,8 @@ module Straddle
197
241
  # @param metadata [Hash{Symbol=>String}, nil] Metadata for payment - only included if requested.
198
242
  #
199
243
  # @param paykey_details [Straddle::Models::PaykeyDetailsV1] Information about the paykey used for the `charge` or `payout`.
244
+ #
245
+ # @param related_payments [Array<Straddle::Models::PaymentSummaryPagedV1::Data::RelatedPayment>, nil] Payments related to this one (e.g. refunds, resubmissions), mapped by payment ID
200
246
 
201
247
  # The type of payment. Valid values are `charge` or `payout`.
202
248
  #
@@ -230,6 +276,57 @@ module Straddle
230
276
  # @!method self.values
231
277
  # @return [Array<Symbol>]
232
278
  end
279
+
280
+ class RelatedPayment < Straddle::Internal::Type::BaseModel
281
+ # @!attribute id
282
+ # The ID of the related payment.
283
+ #
284
+ # @return [String]
285
+ required :id, String
286
+
287
+ # @!attribute payment_type
288
+ # The type of payment.
289
+ #
290
+ # @return [Symbol, Straddle::Models::PaymentSummaryPagedV1::Data::RelatedPayment::PaymentType]
291
+ required :payment_type, enum: -> { Straddle::PaymentSummaryPagedV1::Data::RelatedPayment::PaymentType }
292
+
293
+ # @!attribute relationship
294
+ #
295
+ # @return [Symbol, Straddle::Models::PaymentSummaryPagedV1::Data::RelatedPayment::Relationship]
296
+ required :relationship, enum: -> { Straddle::PaymentSummaryPagedV1::Data::RelatedPayment::Relationship }
297
+
298
+ # @!method initialize(id:, payment_type:, relationship:)
299
+ # @param id [String] The ID of the related payment.
300
+ #
301
+ # @param payment_type [Symbol, Straddle::Models::PaymentSummaryPagedV1::Data::RelatedPayment::PaymentType] The type of payment.
302
+ #
303
+ # @param relationship [Symbol, Straddle::Models::PaymentSummaryPagedV1::Data::RelatedPayment::Relationship]
304
+
305
+ # The type of payment.
306
+ #
307
+ # @see Straddle::Models::PaymentSummaryPagedV1::Data::RelatedPayment#payment_type
308
+ module PaymentType
309
+ extend Straddle::Internal::Type::Enum
310
+
311
+ CHARGE = :charge
312
+ PAYOUT = :payout
313
+
314
+ # @!method self.values
315
+ # @return [Array<Symbol>]
316
+ end
317
+
318
+ # @see Straddle::Models::PaymentSummaryPagedV1::Data::RelatedPayment#relationship
319
+ module Relationship
320
+ extend Straddle::Internal::Type::Enum
321
+
322
+ ORIGINAL = :original
323
+ RESUBMIT = :resubmit
324
+ REFUND = :refund
325
+
326
+ # @!method self.values
327
+ # @return [Array<Symbol>]
328
+ end
329
+ end
233
330
  end
234
331
 
235
332
  # @see Straddle::Models::PaymentSummaryPagedV1#meta
@@ -158,6 +158,8 @@ module Straddle
158
158
  REVERSED_CUSTOMER_DISPUTE = :reversed_customer_dispute
159
159
  FAILED_CLOSED_BANK_ACCOUNT = :failed_closed_bank_account
160
160
  REVERSED_CLOSED_BANK_ACCOUNT = :reversed_closed_bank_account
161
+ FAILED_NOT_AUTHORIZED = :failed_not_authorized
162
+ REVERSED_NOT_AUTHORIZED = :reversed_not_authorized
161
163
 
162
164
  # @!method self.values
163
165
  # @return [Array<Symbol>]