increase 1.0.0 → 1.1.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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +1 -1
  4. data/lib/increase/errors.rb +22 -0
  5. data/lib/increase/internal/type/array_of.rb +6 -1
  6. data/lib/increase/internal/type/base_model.rb +77 -25
  7. data/lib/increase/internal/type/boolean.rb +7 -1
  8. data/lib/increase/internal/type/converter.rb +42 -34
  9. data/lib/increase/internal/type/enum.rb +10 -2
  10. data/lib/increase/internal/type/file_input.rb +6 -1
  11. data/lib/increase/internal/type/hash_of.rb +6 -1
  12. data/lib/increase/internal/type/union.rb +12 -7
  13. data/lib/increase/internal/type/unknown.rb +7 -1
  14. data/lib/increase/models/card_payment.rb +13 -13
  15. data/lib/increase/models/check_transfer.rb +24 -1
  16. data/lib/increase/models/check_transfer_create_params.rb +26 -2
  17. data/lib/increase/models/event.rb +22 -4
  18. data/lib/increase/models/event_list_params.rb +22 -4
  19. data/lib/increase/models/event_subscription.rb +22 -4
  20. data/lib/increase/models/event_subscription_create_params.rb +22 -4
  21. data/lib/increase/models/inbound_ach_transfer.rb +56 -26
  22. data/lib/increase/models/inbound_mail_item.rb +38 -1
  23. data/lib/increase/models/pending_transaction.rb +37 -44
  24. data/lib/increase/models/pending_transaction_list_params.rb +2 -2
  25. data/lib/increase/models/transaction.rb +41 -43
  26. data/lib/increase/models/transaction_list_params.rb +2 -2
  27. data/lib/increase/version.rb +1 -1
  28. data/rbi/increase/errors.rbi +16 -0
  29. data/rbi/increase/internal/type/boolean.rbi +2 -0
  30. data/rbi/increase/internal/type/converter.rbi +15 -15
  31. data/rbi/increase/internal/type/union.rbi +5 -0
  32. data/rbi/increase/internal/type/unknown.rbi +2 -0
  33. data/rbi/increase/models/card_payment.rbi +18 -18
  34. data/rbi/increase/models/check_transfer.rbi +36 -0
  35. data/rbi/increase/models/check_transfer_create_params.rbi +63 -2
  36. data/rbi/increase/models/event.rbi +46 -4
  37. data/rbi/increase/models/event_list_params.rbi +46 -4
  38. data/rbi/increase/models/event_subscription.rbi +46 -4
  39. data/rbi/increase/models/event_subscription_create_params.rbi +46 -4
  40. data/rbi/increase/models/inbound_ach_transfer.rbi +108 -52
  41. data/rbi/increase/models/inbound_mail_item.rbi +57 -0
  42. data/rbi/increase/models/pending_transaction.rbi +72 -77
  43. data/rbi/increase/models/pending_transaction_list_params.rbi +3 -3
  44. data/rbi/increase/models/transaction.rbi +76 -81
  45. data/rbi/increase/models/transaction_list_params.rbi +3 -3
  46. data/sig/increase/errors.rbs +9 -0
  47. data/sig/increase/internal/type/converter.rbs +7 -1
  48. data/sig/increase/models/card_payment.rbs +3 -3
  49. data/sig/increase/models/check_transfer.rbs +15 -0
  50. data/sig/increase/models/check_transfer_create_params.rbs +19 -0
  51. data/sig/increase/models/event.rbs +28 -4
  52. data/sig/increase/models/event_list_params.rbs +28 -4
  53. data/sig/increase/models/event_subscription.rbs +28 -4
  54. data/sig/increase/models/event_subscription_create_params.rbs +28 -4
  55. data/sig/increase/models/inbound_ach_transfer.rbs +41 -19
  56. data/sig/increase/models/inbound_mail_item.rbs +28 -0
  57. data/sig/increase/models/pending_transaction.rbs +21 -21
  58. data/sig/increase/models/pending_transaction_list_params.rbs +3 -3
  59. data/sig/increase/models/transaction.rbs +21 -21
  60. data/sig/increase/models/transaction_list_params.rbs +3 -3
  61. metadata +2 -2
@@ -227,6 +227,15 @@ module Increase
227
227
  },
228
228
  nil?: true
229
229
 
230
+ # @!attribute card_push_transfer_instruction
231
+ # A Card Push Transfer Instruction object. This field will be present in the JSON
232
+ # response if and only if `category` is equal to `card_push_transfer_instruction`.
233
+ #
234
+ # @return [Increase::Models::PendingTransaction::Source::CardPushTransferInstruction, nil]
235
+ required :card_push_transfer_instruction,
236
+ -> { Increase::PendingTransaction::Source::CardPushTransferInstruction },
237
+ nil?: true
238
+
230
239
  # @!attribute category
231
240
  # The type of the resource. We may add additional possible values for this enum
232
241
  # over time; your application should be able to handle such additions gracefully.
@@ -283,16 +292,6 @@ module Increase
283
292
  # @return [Object, nil]
284
293
  required :other, Increase::Internal::Type::Unknown, nil?: true
285
294
 
286
- # @!attribute outbound_card_push_transfer_instruction
287
- # An Outbound Card Push Transfer Instruction object. This field will be present in
288
- # the JSON response if and only if `category` is equal to
289
- # `outbound_card_push_transfer_instruction`.
290
- #
291
- # @return [Increase::Models::PendingTransaction::Source::OutboundCardPushTransferInstruction, nil]
292
- required :outbound_card_push_transfer_instruction,
293
- -> { Increase::PendingTransaction::Source::OutboundCardPushTransferInstruction },
294
- nil?: true
295
-
296
295
  # @!attribute real_time_payments_transfer_instruction
297
296
  # A Real-Time Payments Transfer Instruction object. This field will be present in
298
297
  # the JSON response if and only if `category` is equal to
@@ -329,7 +328,7 @@ module Increase
329
328
  -> { Increase::PendingTransaction::Source::WireTransferInstruction },
330
329
  nil?: true
331
330
 
332
- # @!method initialize(account_transfer_instruction:, ach_transfer_instruction:, card_authorization:, category:, check_deposit_instruction:, check_transfer_instruction:, inbound_funds_hold:, inbound_wire_transfer_reversal:, other:, outbound_card_push_transfer_instruction:, real_time_payments_transfer_instruction:, swift_transfer_instruction:, user_initiated_hold:, wire_transfer_instruction:)
331
+ # @!method initialize(account_transfer_instruction:, ach_transfer_instruction:, card_authorization:, card_push_transfer_instruction:, category:, check_deposit_instruction:, check_transfer_instruction:, inbound_funds_hold:, inbound_wire_transfer_reversal:, other:, real_time_payments_transfer_instruction:, swift_transfer_instruction:, user_initiated_hold:, wire_transfer_instruction:)
333
332
  # Some parameter documentations has been truncated, see
334
333
  # {Increase::Models::PendingTransaction::Source} for more details.
335
334
  #
@@ -343,6 +342,8 @@ module Increase
343
342
  #
344
343
  # @param card_authorization [Increase::Models::PendingTransaction::Source::CardAuthorization, nil] A Card Authorization object. This field will be present in the JSON response if
345
344
  #
345
+ # @param card_push_transfer_instruction [Increase::Models::PendingTransaction::Source::CardPushTransferInstruction, nil] A Card Push Transfer Instruction object. This field will be present in the JSON
346
+ #
346
347
  # @param category [Symbol, Increase::Models::PendingTransaction::Source::Category] The type of the resource. We may add additional possible values for this enum ov
347
348
  #
348
349
  # @param check_deposit_instruction [Increase::Models::PendingTransaction::Source::CheckDepositInstruction, nil] A Check Deposit Instruction object. This field will be present in the JSON respo
@@ -355,8 +356,6 @@ module Increase
355
356
  #
356
357
  # @param other [Object, nil] If the category of this Transaction source is equal to `other`, this field will
357
358
  #
358
- # @param outbound_card_push_transfer_instruction [Increase::Models::PendingTransaction::Source::OutboundCardPushTransferInstruction, nil] An Outbound Card Push Transfer Instruction object. This field will be present in
359
- #
360
359
  # @param real_time_payments_transfer_instruction [Increase::Models::PendingTransaction::Source::RealTimePaymentsTransferInstruction, nil] A Real-Time Payments Transfer Instruction object. This field will be present in
361
360
  #
362
361
  # @param swift_transfer_instruction [Increase::Models::PendingTransaction::Source::SwiftTransferInstruction, nil] A Swift Transfer Instruction object. This field will be present in the JSON resp
@@ -1210,6 +1209,29 @@ module Increase
1210
1209
  end
1211
1210
  end
1212
1211
 
1212
+ # @see Increase::Models::PendingTransaction::Source#card_push_transfer_instruction
1213
+ class CardPushTransferInstruction < Increase::Internal::Type::BaseModel
1214
+ # @!attribute amount
1215
+ # The transfer amount in USD cents.
1216
+ #
1217
+ # @return [Integer]
1218
+ required :amount, Integer
1219
+
1220
+ # @!attribute transfer_id
1221
+ # The identifier of the Card Push Transfer that led to this Pending Transaction.
1222
+ #
1223
+ # @return [String]
1224
+ required :transfer_id, String
1225
+
1226
+ # @!method initialize(amount:, transfer_id:)
1227
+ # A Card Push Transfer Instruction object. This field will be present in the JSON
1228
+ # response if and only if `category` is equal to `card_push_transfer_instruction`.
1229
+ #
1230
+ # @param amount [Integer] The transfer amount in USD cents.
1231
+ #
1232
+ # @param transfer_id [String] The identifier of the Card Push Transfer that led to this Pending Transaction.
1233
+ end
1234
+
1213
1235
  # The type of the resource. We may add additional possible values for this enum
1214
1236
  # over time; your application should be able to handle such additions gracefully.
1215
1237
  #
@@ -1250,8 +1272,8 @@ module Increase
1250
1272
  # Swift Transfer Instruction: details will be under the `swift_transfer_instruction` object.
1251
1273
  SWIFT_TRANSFER_INSTRUCTION = :swift_transfer_instruction
1252
1274
 
1253
- # Outbound Card Push Transfer Instruction: details will be under the `outbound_card_push_transfer_instruction` object.
1254
- OUTBOUND_CARD_PUSH_TRANSFER_INSTRUCTION = :outbound_card_push_transfer_instruction
1275
+ # Card Push Transfer Instruction: details will be under the `card_push_transfer_instruction` object.
1276
+ CARD_PUSH_TRANSFER_INSTRUCTION = :card_push_transfer_instruction
1255
1277
 
1256
1278
  # The Pending Transaction was made for an undocumented or deprecated reason.
1257
1279
  OTHER = :other
@@ -1587,35 +1609,6 @@ module Increase
1587
1609
  # @param inbound_wire_transfer_id [String] The ID of the Inbound Wire Transfer that is being reversed.
1588
1610
  end
1589
1611
 
1590
- # @see Increase::Models::PendingTransaction::Source#outbound_card_push_transfer_instruction
1591
- class OutboundCardPushTransferInstruction < Increase::Internal::Type::BaseModel
1592
- # @!attribute amount
1593
- # The transfer amount in USD cents.
1594
- #
1595
- # @return [Integer]
1596
- required :amount, Integer
1597
-
1598
- # @!attribute transfer_id
1599
- # The identifier of the Outbound Card Push Transfer that led to this Pending
1600
- # Transaction.
1601
- #
1602
- # @return [String]
1603
- required :transfer_id, String
1604
-
1605
- # @!method initialize(amount:, transfer_id:)
1606
- # Some parameter documentations has been truncated, see
1607
- # {Increase::Models::PendingTransaction::Source::OutboundCardPushTransferInstruction}
1608
- # for more details.
1609
- #
1610
- # An Outbound Card Push Transfer Instruction object. This field will be present in
1611
- # the JSON response if and only if `category` is equal to
1612
- # `outbound_card_push_transfer_instruction`.
1613
- #
1614
- # @param amount [Integer] The transfer amount in USD cents.
1615
- #
1616
- # @param transfer_id [String] The identifier of the Outbound Card Push Transfer that led to this Pending Trans
1617
- end
1618
-
1619
1612
  # @see Increase::Models::PendingTransaction::Source#real_time_payments_transfer_instruction
1620
1613
  class RealTimePaymentsTransferInstruction < Increase::Internal::Type::BaseModel
1621
1614
  # @!attribute amount
@@ -121,8 +121,8 @@ module Increase
121
121
  # Swift Transfer Instruction: details will be under the `swift_transfer_instruction` object.
122
122
  SWIFT_TRANSFER_INSTRUCTION = :swift_transfer_instruction
123
123
 
124
- # Outbound Card Push Transfer Instruction: details will be under the `outbound_card_push_transfer_instruction` object.
125
- OUTBOUND_CARD_PUSH_TRANSFER_INSTRUCTION = :outbound_card_push_transfer_instruction
124
+ # Card Push Transfer Instruction: details will be under the `card_push_transfer_instruction` object.
125
+ CARD_PUSH_TRANSFER_INSTRUCTION = :card_push_transfer_instruction
126
126
 
127
127
  # The Pending Transaction was made for an undocumented or deprecated reason.
128
128
  OTHER = :other
@@ -221,6 +221,17 @@ module Increase
221
221
  # @return [Increase::Models::Transaction::Source::CardDisputeLoss, nil]
222
222
  required :card_dispute_loss, -> { Increase::Transaction::Source::CardDisputeLoss }, nil?: true
223
223
 
224
+ # @!attribute card_push_transfer_acceptance
225
+ # A Card Push Transfer Acceptance object. This field will be present in the JSON
226
+ # response if and only if `category` is equal to `card_push_transfer_acceptance`.
227
+ # A Card Push Transfer Acceptance is created when an Outbound Card Push Transfer
228
+ # sent from Increase is accepted by the receiving bank.
229
+ #
230
+ # @return [Increase::Models::Transaction::Source::CardPushTransferAcceptance, nil]
231
+ required :card_push_transfer_acceptance,
232
+ -> { Increase::Transaction::Source::CardPushTransferAcceptance },
233
+ nil?: true
234
+
224
235
  # @!attribute card_refund
225
236
  # A Card Refund object. This field will be present in the JSON response if and
226
237
  # only if `category` is equal to `card_refund`. Card Refunds move money back to
@@ -430,18 +441,6 @@ module Increase
430
441
  # @return [Object, nil]
431
442
  required :other, Increase::Internal::Type::Unknown, nil?: true
432
443
 
433
- # @!attribute outbound_card_push_transfer_acceptance
434
- # An Outbound Card Push Transfer Acceptance object. This field will be present in
435
- # the JSON response if and only if `category` is equal to
436
- # `outbound_card_push_transfer_acceptance`. An Outbound Card Push Transfer
437
- # Acceptance is created when an Outbound Card Push Transfer sent from Increase is
438
- # accepted by the receiving bank.
439
- #
440
- # @return [Increase::Models::Transaction::Source::OutboundCardPushTransferAcceptance, nil]
441
- required :outbound_card_push_transfer_acceptance,
442
- -> { Increase::Transaction::Source::OutboundCardPushTransferAcceptance },
443
- nil?: true
444
-
445
444
  # @!attribute real_time_payments_transfer_acknowledgement
446
445
  # A Real-Time Payments Transfer Acknowledgement object. This field will be present
447
446
  # in the JSON response if and only if `category` is equal to
@@ -484,7 +483,7 @@ module Increase
484
483
  },
485
484
  nil?: true
486
485
 
487
- # @!method initialize(account_transfer_intention:, ach_transfer_intention:, ach_transfer_rejection:, ach_transfer_return:, card_dispute_acceptance:, card_dispute_loss:, card_refund:, card_revenue_payment:, card_settlement:, cashback_payment:, category:, check_deposit_acceptance:, check_deposit_return:, check_transfer_deposit:, fee_payment:, inbound_ach_transfer:, inbound_ach_transfer_return_intention:, inbound_check_adjustment:, inbound_check_deposit_return_intention:, inbound_real_time_payments_transfer_confirmation:, inbound_real_time_payments_transfer_decline:, inbound_wire_reversal:, inbound_wire_transfer:, inbound_wire_transfer_reversal:, interest_payment:, internal_source:, other:, outbound_card_push_transfer_acceptance:, real_time_payments_transfer_acknowledgement:, sample_funds:, swift_transfer_intention:, wire_transfer_intention:)
486
+ # @!method initialize(account_transfer_intention:, ach_transfer_intention:, ach_transfer_rejection:, ach_transfer_return:, card_dispute_acceptance:, card_dispute_loss:, card_push_transfer_acceptance:, card_refund:, card_revenue_payment:, card_settlement:, cashback_payment:, category:, check_deposit_acceptance:, check_deposit_return:, check_transfer_deposit:, fee_payment:, inbound_ach_transfer:, inbound_ach_transfer_return_intention:, inbound_check_adjustment:, inbound_check_deposit_return_intention:, inbound_real_time_payments_transfer_confirmation:, inbound_real_time_payments_transfer_decline:, inbound_wire_reversal:, inbound_wire_transfer:, inbound_wire_transfer_reversal:, interest_payment:, internal_source:, other:, real_time_payments_transfer_acknowledgement:, sample_funds:, swift_transfer_intention:, wire_transfer_intention:)
488
487
  # Some parameter documentations has been truncated, see
489
488
  # {Increase::Models::Transaction::Source} for more details.
490
489
  #
@@ -505,6 +504,8 @@ module Increase
505
504
  #
506
505
  # @param card_dispute_loss [Increase::Models::Transaction::Source::CardDisputeLoss, nil] A Card Dispute Loss object. This field will be present in the JSON response if a
507
506
  #
507
+ # @param card_push_transfer_acceptance [Increase::Models::Transaction::Source::CardPushTransferAcceptance, nil] A Card Push Transfer Acceptance object. This field will be present in the JSON r
508
+ #
508
509
  # @param card_refund [Increase::Models::Transaction::Source::CardRefund, nil] A Card Refund object. This field will be present in the JSON response if and onl
509
510
  #
510
511
  # @param card_revenue_payment [Increase::Models::Transaction::Source::CardRevenuePayment, nil] A Card Revenue Payment object. This field will be present in the JSON response i
@@ -547,8 +548,6 @@ module Increase
547
548
  #
548
549
  # @param other [Object, nil] If the category of this Transaction source is equal to `other`, this field will
549
550
  #
550
- # @param outbound_card_push_transfer_acceptance [Increase::Models::Transaction::Source::OutboundCardPushTransferAcceptance, nil] An Outbound Card Push Transfer Acceptance object. This field will be present in
551
- #
552
551
  # @param real_time_payments_transfer_acknowledgement [Increase::Models::Transaction::Source::RealTimePaymentsTransferAcknowledgement, nil] A Real-Time Payments Transfer Acknowledgement object. This field will be present
553
552
  #
554
553
  # @param sample_funds [Increase::Models::Transaction::Source::SampleFunds, nil] A Sample Funds object. This field will be present in the JSON response if and on
@@ -1094,6 +1093,31 @@ module Increase
1094
1093
  # @param transaction_id [String] The identifier of the Transaction that was created to debit the disputed funds f
1095
1094
  end
1096
1095
 
1096
+ # @see Increase::Models::Transaction::Source#card_push_transfer_acceptance
1097
+ class CardPushTransferAcceptance < Increase::Internal::Type::BaseModel
1098
+ # @!attribute amount
1099
+ # The transfer amount in USD cents.
1100
+ #
1101
+ # @return [Integer]
1102
+ required :amount, Integer
1103
+
1104
+ # @!attribute transfer_id
1105
+ # The identifier of the Card Push Transfer that led to this Transaction.
1106
+ #
1107
+ # @return [String]
1108
+ required :transfer_id, String
1109
+
1110
+ # @!method initialize(amount:, transfer_id:)
1111
+ # A Card Push Transfer Acceptance object. This field will be present in the JSON
1112
+ # response if and only if `category` is equal to `card_push_transfer_acceptance`.
1113
+ # A Card Push Transfer Acceptance is created when an Outbound Card Push Transfer
1114
+ # sent from Increase is accepted by the receiving bank.
1115
+ #
1116
+ # @param amount [Integer] The transfer amount in USD cents.
1117
+ #
1118
+ # @param transfer_id [String] The identifier of the Card Push Transfer that led to this Transaction.
1119
+ end
1120
+
1097
1121
  # @see Increase::Models::Transaction::Source#card_refund
1098
1122
  class CardRefund < Increase::Internal::Type::BaseModel
1099
1123
  # @!attribute id
@@ -4085,8 +4109,8 @@ module Increase
4085
4109
  # Swift Transfer Intention: details will be under the `swift_transfer_intention` object.
4086
4110
  SWIFT_TRANSFER_INTENTION = :swift_transfer_intention
4087
4111
 
4088
- # Outbound Card Push Transfer Acceptance: details will be under the `outbound_card_push_transfer_acceptance` object.
4089
- OUTBOUND_CARD_PUSH_TRANSFER_ACCEPTANCE = :outbound_card_push_transfer_acceptance
4112
+ # Card Push Transfer Acceptance: details will be under the `card_push_transfer_acceptance` object.
4113
+ CARD_PUSH_TRANSFER_ACCEPTANCE = :card_push_transfer_acceptance
4090
4114
 
4091
4115
  # The Transaction was made for an undocumented or deprecated reason.
4092
4116
  OTHER = :other
@@ -5649,32 +5673,6 @@ module Increase
5649
5673
  end
5650
5674
  end
5651
5675
 
5652
- # @see Increase::Models::Transaction::Source#outbound_card_push_transfer_acceptance
5653
- class OutboundCardPushTransferAcceptance < Increase::Internal::Type::BaseModel
5654
- # @!attribute amount
5655
- # The transfer amount in USD cents.
5656
- #
5657
- # @return [Integer]
5658
- required :amount, Integer
5659
-
5660
- # @!attribute transfer_id
5661
- # The identifier of the Outbound Card Push Transfer that led to this Transaction.
5662
- #
5663
- # @return [String]
5664
- required :transfer_id, String
5665
-
5666
- # @!method initialize(amount:, transfer_id:)
5667
- # An Outbound Card Push Transfer Acceptance object. This field will be present in
5668
- # the JSON response if and only if `category` is equal to
5669
- # `outbound_card_push_transfer_acceptance`. An Outbound Card Push Transfer
5670
- # Acceptance is created when an Outbound Card Push Transfer sent from Increase is
5671
- # accepted by the receiving bank.
5672
- #
5673
- # @param amount [Integer] The transfer amount in USD cents.
5674
- #
5675
- # @param transfer_id [String] The identifier of the Outbound Card Push Transfer that led to this Transaction.
5676
- end
5677
-
5678
5676
  # @see Increase::Models::Transaction::Source#real_time_payments_transfer_acknowledgement
5679
5677
  class RealTimePaymentsTransferAcknowledgement < Increase::Internal::Type::BaseModel
5680
5678
  # @!attribute amount
@@ -169,8 +169,8 @@ module Increase
169
169
  # Swift Transfer Intention: details will be under the `swift_transfer_intention` object.
170
170
  SWIFT_TRANSFER_INTENTION = :swift_transfer_intention
171
171
 
172
- # Outbound Card Push Transfer Acceptance: details will be under the `outbound_card_push_transfer_acceptance` object.
173
- OUTBOUND_CARD_PUSH_TRANSFER_ACCEPTANCE = :outbound_card_push_transfer_acceptance
172
+ # Card Push Transfer Acceptance: details will be under the `card_push_transfer_acceptance` object.
173
+ CARD_PUSH_TRANSFER_ACCEPTANCE = :card_push_transfer_acceptance
174
174
 
175
175
  # The Transaction was made for an undocumented or deprecated reason.
176
176
  OTHER = :other
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Increase
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.0"
5
5
  end
@@ -8,6 +8,22 @@ module Increase
8
8
  end
9
9
 
10
10
  class ConversionError < Increase::Errors::Error
11
+ sig { returns(T.nilable(StandardError)) }
12
+ def cause
13
+ end
14
+
15
+ # @api private
16
+ sig do
17
+ params(
18
+ on: T::Class[StandardError],
19
+ method: Symbol,
20
+ target: T.anything,
21
+ value: T.anything,
22
+ cause: T.nilable(StandardError)
23
+ ).returns(T.attached_class)
24
+ end
25
+ def self.new(on:, method:, target:, value:, cause: nil)
26
+ end
11
27
  end
12
28
 
13
29
  class APIError < Increase::Errors::Error
@@ -22,6 +22,8 @@ module Increase
22
22
 
23
23
  class << self
24
24
  # @api private
25
+ #
26
+ # Coerce value to Boolean if possible, otherwise return the original value.
25
27
  sig do
26
28
  override
27
29
  .params(
@@ -15,12 +15,14 @@ module Increase
15
15
  CoerceState =
16
16
  T.type_alias do
17
17
  {
18
- strictness: T.any(T::Boolean, Symbol),
18
+ translate_names: T::Boolean,
19
+ strictness: T::Boolean,
19
20
  exactness: {
20
21
  yes: Integer,
21
22
  no: Integer,
22
23
  maybe: Integer
23
24
  },
25
+ error: T::Class[StandardError],
24
26
  branched: Integer
25
27
  }
26
28
  end
@@ -88,6 +90,15 @@ module Increase
88
90
  def self.type_info(spec)
89
91
  end
90
92
 
93
+ # @api private
94
+ sig do
95
+ params(translate_names: T::Boolean).returns(
96
+ Increase::Internal::Type::Converter::CoerceState
97
+ )
98
+ end
99
+ def self.new_coerce_state(translate_names: true)
100
+ end
101
+
91
102
  # @api private
92
103
  #
93
104
  # Based on `target`, transform `value` into `target`, to the extent possible:
@@ -109,14 +120,11 @@ module Increase
109
120
  def self.coerce(
110
121
  target,
111
122
  value,
112
- # The `strictness` is one of `true`, `false`, or `:strong`. This informs the
113
- # coercion strategy when we have to decide between multiple possible conversion
114
- # targets:
123
+ # The `strictness` is one of `true`, `false`. This informs the coercion strategy
124
+ # when we have to decide between multiple possible conversion targets:
115
125
  #
116
126
  # - `true`: the conversion must be exact, with minimum coercion.
117
127
  # - `false`: the conversion can be approximate, with some coercion.
118
- # - `:strong`: the conversion must be exact, with no coercion, and raise an error
119
- # if not possible.
120
128
  #
121
129
  # The `exactness` is `Hash` with keys being one of `yes`, `no`, or `maybe`. For
122
130
  # any given conversion attempt, the exactness will be updated based on how closely
@@ -128,15 +136,7 @@ module Increase
128
136
  # - `no`: the value cannot be converted to the target type.
129
137
  #
130
138
  # See implementation below for more details.
131
- state: {
132
- strictness: true,
133
- exactness: {
134
- yes: 0,
135
- no: 0,
136
- maybe: 0
137
- },
138
- branched: 0
139
- }
139
+ state: Increase::Internal::Type::Converter.new_coerce_state
140
140
  )
141
141
  end
142
142
 
@@ -78,6 +78,11 @@ module Increase
78
78
  end
79
79
 
80
80
  # @api private
81
+ #
82
+ # Tries to efficiently coerce the given value to one of the known variants.
83
+ #
84
+ # If the value cannot match any of the known variants, the coercion is considered
85
+ # non-viable and returns the original value.
81
86
  sig do
82
87
  override
83
88
  .params(
@@ -22,6 +22,8 @@ module Increase
22
22
 
23
23
  class << self
24
24
  # @api private
25
+ #
26
+ # No coercion needed for Unknown type.
25
27
  sig do
26
28
  override
27
29
  .params(
@@ -270,10 +270,10 @@ module Increase
270
270
  end
271
271
  attr_writer :card_settlement
272
272
 
273
- # A Card Validation object. This field will be present in the JSON response if and
274
- # only if `category` is equal to `card_validation`. Card Validations are requests
275
- # from a merchant to verify that a card number and optionally its address and/or
276
- # Card Verification Value are valid.
273
+ # An Inbound Card Validation object. This field will be present in the JSON
274
+ # response if and only if `category` is equal to `card_validation`. Inbound Card
275
+ # Validations are requests from a merchant to verify that a card number and
276
+ # optionally its address and/or Card Verification Value are valid.
277
277
  sig do
278
278
  returns(T.nilable(Increase::CardPayment::Element::CardValidation))
279
279
  end
@@ -380,10 +380,10 @@ module Increase
380
380
  # preceded by an authorization, an acquirer can also directly clear a transaction
381
381
  # without first authorizing it.
382
382
  card_settlement:,
383
- # A Card Validation object. This field will be present in the JSON response if and
384
- # only if `category` is equal to `card_validation`. Card Validations are requests
385
- # from a merchant to verify that a card number and optionally its address and/or
386
- # Card Verification Value are valid.
383
+ # An Inbound Card Validation object. This field will be present in the JSON
384
+ # response if and only if `category` is equal to `card_validation`. Inbound Card
385
+ # Validations are requests from a merchant to verify that a card number and
386
+ # optionally its address and/or Card Verification Value are valid.
387
387
  card_validation:,
388
388
  # The type of the resource. We may add additional possible values for this enum
389
389
  # over time; your application should be able to handle such additions gracefully.
@@ -10650,7 +10650,7 @@ module Increase
10650
10650
  attr_accessor :terminal_id
10651
10651
 
10652
10652
  # A constant representing the object's type. For this resource it will always be
10653
- # `card_validation`.
10653
+ # `inbound_card_validation`.
10654
10654
  sig do
10655
10655
  returns(
10656
10656
  Increase::CardPayment::Element::CardValidation::Type::TaggedSymbol
@@ -10674,10 +10674,10 @@ module Increase
10674
10674
  end
10675
10675
  attr_writer :verification
10676
10676
 
10677
- # A Card Validation object. This field will be present in the JSON response if and
10678
- # only if `category` is equal to `card_validation`. Card Validations are requests
10679
- # from a merchant to verify that a card number and optionally its address and/or
10680
- # Card Verification Value are valid.
10677
+ # An Inbound Card Validation object. This field will be present in the JSON
10678
+ # response if and only if `category` is equal to `card_validation`. Inbound Card
10679
+ # Validations are requests from a merchant to verify that a card number and
10680
+ # optionally its address and/or Card Verification Value are valid.
10681
10681
  sig do
10682
10682
  params(
10683
10683
  id: String,
@@ -10756,7 +10756,7 @@ module Increase
10756
10756
  # is transacting with.
10757
10757
  terminal_id:,
10758
10758
  # A constant representing the object's type. For this resource it will always be
10759
- # `card_validation`.
10759
+ # `inbound_card_validation`.
10760
10760
  type:,
10761
10761
  # Fields related to verification of cardholder-provided values.
10762
10762
  verification:
@@ -11422,7 +11422,7 @@ module Increase
11422
11422
  end
11423
11423
 
11424
11424
  # A constant representing the object's type. For this resource it will always be
11425
- # `card_validation`.
11425
+ # `inbound_card_validation`.
11426
11426
  module Type
11427
11427
  extend Increase::Internal::Type::Enum
11428
11428
 
@@ -11435,9 +11435,9 @@ module Increase
11435
11435
  end
11436
11436
  OrSymbol = T.type_alias { T.any(Symbol, String) }
11437
11437
 
11438
- CARD_VALIDATION =
11438
+ INBOUND_CARD_VALIDATION =
11439
11439
  T.let(
11440
- :card_validation,
11440
+ :inbound_card_validation,
11441
11441
  Increase::CardPayment::Element::CardValidation::Type::TaggedSymbol
11442
11442
  )
11443
11443
 
@@ -11785,7 +11785,7 @@ module Increase
11785
11785
  Increase::CardPayment::Element::Category::TaggedSymbol
11786
11786
  )
11787
11787
 
11788
- # Card Validation: details will be under the `card_validation` object.
11788
+ # Inbound Card Validation: details will be under the `card_validation` object.
11789
11789
  CARD_VALIDATION =
11790
11790
  T.let(
11791
11791
  :card_validation,
@@ -772,6 +772,11 @@ module Increase
772
772
  sig { returns(T.nilable(String)) }
773
773
  attr_accessor :note
774
774
 
775
+ # The payer of the check. This will be printed on the top-left portion of the
776
+ # check and defaults to the return address if unspecified.
777
+ sig { returns(T::Array[Increase::CheckTransfer::PhysicalCheck::Payer]) }
778
+ attr_accessor :payer
779
+
775
780
  # The name that will be printed on the check.
776
781
  sig { returns(String) }
777
782
  attr_accessor :recipient_name
@@ -826,6 +831,8 @@ module Increase
826
831
  Increase::CheckTransfer::PhysicalCheck::MailingAddress::OrHash,
827
832
  memo: T.nilable(String),
828
833
  note: T.nilable(String),
834
+ payer:
835
+ T::Array[Increase::CheckTransfer::PhysicalCheck::Payer::OrHash],
829
836
  recipient_name: String,
830
837
  return_address:
831
838
  T.nilable(
@@ -851,6 +858,9 @@ module Increase
851
858
  memo:,
852
859
  # The descriptor that will be printed on the letter included with the check.
853
860
  note:,
861
+ # The payer of the check. This will be printed on the top-left portion of the
862
+ # check and defaults to the return address if unspecified.
863
+ payer:,
854
864
  # The name that will be printed on the check.
855
865
  recipient_name:,
856
866
  # The return address to be printed on the check.
@@ -873,6 +883,7 @@ module Increase
873
883
  Increase::CheckTransfer::PhysicalCheck::MailingAddress,
874
884
  memo: T.nilable(String),
875
885
  note: T.nilable(String),
886
+ payer: T::Array[Increase::CheckTransfer::PhysicalCheck::Payer],
876
887
  recipient_name: String,
877
888
  return_address:
878
889
  T.nilable(
@@ -967,6 +978,31 @@ module Increase
967
978
  end
968
979
  end
969
980
 
981
+ class Payer < Increase::Internal::Type::BaseModel
982
+ OrHash =
983
+ T.type_alias do
984
+ T.any(
985
+ Increase::CheckTransfer::PhysicalCheck::Payer,
986
+ Increase::Internal::AnyHash
987
+ )
988
+ end
989
+
990
+ # The contents of the line.
991
+ sig { returns(String) }
992
+ attr_accessor :contents
993
+
994
+ sig { params(contents: String).returns(T.attached_class) }
995
+ def self.new(
996
+ # The contents of the line.
997
+ contents:
998
+ )
999
+ end
1000
+
1001
+ sig { override.returns({ contents: String }) }
1002
+ def to_hash
1003
+ end
1004
+ end
1005
+
970
1006
  class ReturnAddress < Increase::Internal::Type::BaseModel
971
1007
  OrHash =
972
1008
  T.type_alias do