From 50e70954b15bd52f627163148865d0fc53e78f87 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 09:31:52 +0000 Subject: [PATCH 1/3] chore(ci): link to correct github repo --- .github/workflows/publish-gem.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index 265b6922d..d8931b274 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -1,6 +1,6 @@ # This workflow is triggered when a GitHub release is created. # It can also be run manually to re-publish to rubygems.org in case it failed for some reason. -# You can run this workflow by navigating to https://www.github.com/Increase/increase-python/actions/workflows/publish-gem.yml +# You can run this workflow by navigating to https://www.github.com/Increase/increase-ruby/actions/workflows/publish-gem.yml name: Publish Gem on: workflow_dispatch: From 9c520aec8a6ef3507d816a8bc27c0c17766220a4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 22:27:05 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 8 +- lib/increase.rb | 2 + lib/increase/models.rb | 4 + lib/increase/models/pending_transaction.rb | 44 ++++------- .../pending_transaction_create_params.rb | 43 +++++++++++ .../models/pending_transaction_list_params.rb | 4 +- .../pending_transaction_release_params.rb | 14 ++++ .../resources/pending_transactions.rb | 55 ++++++++++++++ rbi/increase/models.rbi | 6 ++ rbi/increase/models/pending_transaction.rbi | 75 ++++--------------- .../pending_transaction_create_params.rbi | 69 +++++++++++++++++ .../pending_transaction_list_params.rbi | 6 +- .../pending_transaction_release_params.rbi | 30 ++++++++ .../resources/pending_transactions.rbi | 42 +++++++++++ sig/increase/models.rbs | 4 + sig/increase/models/pending_transaction.rbs | 26 ++----- .../pending_transaction_create_params.rbs | 34 +++++++++ .../pending_transaction_list_params.rbs | 6 +- .../pending_transaction_release_params.rbs | 15 ++++ .../resources/pending_transactions.rbs | 12 +++ .../resources/pending_transactions_test.rb | 51 +++++++++++++ 21 files changed, 430 insertions(+), 120 deletions(-) create mode 100644 lib/increase/models/pending_transaction_create_params.rb create mode 100644 lib/increase/models/pending_transaction_release_params.rb create mode 100644 rbi/increase/models/pending_transaction_create_params.rbi create mode 100644 rbi/increase/models/pending_transaction_release_params.rbi create mode 100644 sig/increase/models/pending_transaction_create_params.rbs create mode 100644 sig/increase/models/pending_transaction_release_params.rbs diff --git a/.stats.yml b/.stats.yml index bccf31fb0..a78c7eb65 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 199 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-0ecd4933d3a1f2e6363dc40b619d296a033732ec245018effd3e5f687f60bb04.yml -openapi_spec_hash: 41f0a23615d13ed80758208130da6abd -config_hash: 0c284b69f3dccb22b24877f61d0d8a9a +configured_endpoints: 201 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-101cab80ae65141fb306c316367abab195616ae8f2ce61d87e0d66e3caa4ef2f.yml +openapi_spec_hash: 9338ab9453d1a0f426e9998e574bff67 +config_hash: 97774f946585cecb19181a1817870d0b diff --git a/lib/increase.rb b/lib/increase.rb index 958154abb..d1b1254a5 100644 --- a/lib/increase.rb +++ b/lib/increase.rb @@ -227,7 +227,9 @@ require_relative "increase/models/oauth_token" require_relative "increase/models/oauth_token_create_params" require_relative "increase/models/pending_transaction" +require_relative "increase/models/pending_transaction_create_params" require_relative "increase/models/pending_transaction_list_params" +require_relative "increase/models/pending_transaction_release_params" require_relative "increase/models/pending_transaction_retrieve_params" require_relative "increase/models/physical_card" require_relative "increase/models/physical_card_create_params" diff --git a/lib/increase/models.rb b/lib/increase/models.rb index 1da90356a..e815d8299 100644 --- a/lib/increase/models.rb +++ b/lib/increase/models.rb @@ -393,8 +393,12 @@ module Increase PendingTransaction = Increase::Models::PendingTransaction + PendingTransactionCreateParams = Increase::Models::PendingTransactionCreateParams + PendingTransactionListParams = Increase::Models::PendingTransactionListParams + PendingTransactionReleaseParams = Increase::Models::PendingTransactionReleaseParams + PendingTransactionRetrieveParams = Increase::Models::PendingTransactionRetrieveParams PhysicalCard = Increase::Models::PhysicalCard diff --git a/lib/increase/models/pending_transaction.rb b/lib/increase/models/pending_transaction.rb index 50c5e8786..a4f60dd3f 100644 --- a/lib/increase/models/pending_transaction.rb +++ b/lib/increase/models/pending_transaction.rb @@ -2,7 +2,7 @@ module Increase module Models - # @see Increase::Resources::PendingTransactions#retrieve + # @see Increase::Resources::PendingTransactions#create class PendingTransaction < Increase::Internal::Type::BaseModel # @!attribute id # The Pending Transaction identifier. @@ -226,15 +226,6 @@ class Source < Increase::Internal::Type::BaseModel -> { Increase::PendingTransaction::Source::CheckTransferInstruction }, nil?: true - # @!attribute group_initiated_hold - # A Group Initiated Hold Source object. This field will be present in the JSON - # response if and only if `category` is equal to `group_initiated_hold`. - # - # @return [Increase::Models::PendingTransaction::Source::GroupInitiatedHold, nil] - required :group_initiated_hold, - -> { Increase::PendingTransaction::Source::GroupInitiatedHold }, - nil?: true - # @!attribute inbound_funds_hold # An Inbound Funds Hold object. This field will be present in the JSON response if # and only if `category` is equal to `inbound_funds_hold`. We hold funds for @@ -295,6 +286,14 @@ class Source < Increase::Internal::Type::BaseModel -> { Increase::PendingTransaction::Source::SwiftTransferInstruction }, nil?: true + # @!attribute user_initiated_hold + # An User Initiated Hold object. This field will be present in the JSON response + # if and only if `category` is equal to `user_initiated_hold`. Created when a user + # initiates a hold on funds in their account. + # + # @return [Object, nil] + required :user_initiated_hold, Increase::Internal::Type::Unknown, nil?: true + # @!attribute wire_transfer_instruction # A Wire Transfer Instruction object. This field will be present in the JSON # response if and only if `category` is equal to `wire_transfer_instruction`. @@ -304,7 +303,7 @@ class Source < Increase::Internal::Type::BaseModel -> { Increase::PendingTransaction::Source::WireTransferInstruction }, nil?: true - # @!method initialize(account_transfer_instruction:, ach_transfer_instruction:, card_authorization:, category:, check_deposit_instruction:, check_transfer_instruction:, group_initiated_hold:, inbound_funds_hold:, inbound_wire_transfer_reversal:, other:, outbound_card_push_transfer_instruction:, real_time_payments_transfer_instruction:, swift_transfer_instruction:, wire_transfer_instruction:) + # @!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:) # Some parameter documentations has been truncated, see # {Increase::Models::PendingTransaction::Source} for more details. # @@ -324,8 +323,6 @@ class Source < Increase::Internal::Type::BaseModel # # @param check_transfer_instruction [Increase::Models::PendingTransaction::Source::CheckTransferInstruction, nil] A Check Transfer Instruction object. This field will be present in the JSON resp # - # @param group_initiated_hold [Increase::Models::PendingTransaction::Source::GroupInitiatedHold, nil] A Group Initiated Hold Source object. This field will be present in the JSON res - # # @param inbound_funds_hold [Increase::Models::PendingTransaction::Source::InboundFundsHold, nil] An Inbound Funds Hold object. This field will be present in the JSON response if # # @param inbound_wire_transfer_reversal [Increase::Models::PendingTransaction::Source::InboundWireTransferReversal, nil] An Inbound Wire Transfer Reversal object. This field will be present in the JSON @@ -338,6 +335,8 @@ class Source < Increase::Internal::Type::BaseModel # # @param swift_transfer_instruction [Increase::Models::PendingTransaction::Source::SwiftTransferInstruction, nil] A Swift Transfer Instruction object. This field will be present in the JSON resp # + # @param user_initiated_hold [Object, nil] An User Initiated Hold object. This field will be present in the JSON response i + # # @param wire_transfer_instruction [Increase::Models::PendingTransaction::Source::WireTransferInstruction, nil] A Wire Transfer Instruction object. This field will be present in the JSON respo # @see Increase::Models::PendingTransaction::Source#account_transfer_instruction @@ -1210,8 +1209,8 @@ module Category # Inbound Funds Hold: details will be under the `inbound_funds_hold` object. INBOUND_FUNDS_HOLD = :inbound_funds_hold - # Group Initiated Hold Source: details will be under the `group_initiated_hold` object. - GROUP_INITIATED_HOLD = :group_initiated_hold + # User Initiated Hold: details will be under the `user_initiated_hold` object. + USER_INITIATED_HOLD = :user_initiated_hold # Real-Time Payments Transfer Instruction: details will be under the `real_time_payments_transfer_instruction` object. REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION = :real_time_payments_transfer_instruction @@ -1389,21 +1388,6 @@ module Currency end end - # @see Increase::Models::PendingTransaction::Source#group_initiated_hold - class GroupInitiatedHold < Increase::Internal::Type::BaseModel - # @!attribute id - # The Group Initiated Hold identifier. - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # A Group Initiated Hold Source object. This field will be present in the JSON - # response if and only if `category` is equal to `group_initiated_hold`. - # - # @param id [String] The Group Initiated Hold identifier. - end - # @see Increase::Models::PendingTransaction::Source#inbound_funds_hold class InboundFundsHold < Increase::Internal::Type::BaseModel # @!attribute id diff --git a/lib/increase/models/pending_transaction_create_params.rb b/lib/increase/models/pending_transaction_create_params.rb new file mode 100644 index 000000000..d09716418 --- /dev/null +++ b/lib/increase/models/pending_transaction_create_params.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Increase + module Models + # @see Increase::Resources::PendingTransactions#create + class PendingTransactionCreateParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + # @!attribute account_id + # The Account to place the hold on. + # + # @return [String] + required :account_id, String + + # @!attribute amount + # The amount to hold in the minor unit of the account's currency. For dollars, for + # example, this is cents. This should be a negative amount - to hold $1.00 from + # the account, you would pass -100. + # + # @return [Integer] + required :amount, Integer + + # @!attribute description + # The description you choose to give the hold. + # + # @return [String, nil] + optional :description, String + + # @!method initialize(account_id:, amount:, description: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Increase::Models::PendingTransactionCreateParams} for more details. + # + # @param account_id [String] The Account to place the hold on. + # + # @param amount [Integer] The amount to hold in the minor unit of the account's currency. For dollars, for + # + # @param description [String] The description you choose to give the hold. + # + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/increase/models/pending_transaction_list_params.rb b/lib/increase/models/pending_transaction_list_params.rb index 3eea6ac1d..938ea3d08 100644 --- a/lib/increase/models/pending_transaction_list_params.rb +++ b/lib/increase/models/pending_transaction_list_params.rb @@ -106,8 +106,8 @@ module In # Inbound Funds Hold: details will be under the `inbound_funds_hold` object. INBOUND_FUNDS_HOLD = :inbound_funds_hold - # Group Initiated Hold Source: details will be under the `group_initiated_hold` object. - GROUP_INITIATED_HOLD = :group_initiated_hold + # User Initiated Hold: details will be under the `user_initiated_hold` object. + USER_INITIATED_HOLD = :user_initiated_hold # Real-Time Payments Transfer Instruction: details will be under the `real_time_payments_transfer_instruction` object. REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION = :real_time_payments_transfer_instruction diff --git a/lib/increase/models/pending_transaction_release_params.rb b/lib/increase/models/pending_transaction_release_params.rb new file mode 100644 index 000000000..3453cd3af --- /dev/null +++ b/lib/increase/models/pending_transaction_release_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Increase + module Models + # @see Increase::Resources::PendingTransactions#release + class PendingTransactionReleaseParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/increase/resources/pending_transactions.rb b/lib/increase/resources/pending_transactions.rb index cd6032510..a790cfc41 100644 --- a/lib/increase/resources/pending_transactions.rb +++ b/lib/increase/resources/pending_transactions.rb @@ -3,6 +3,38 @@ module Increase module Resources class PendingTransactions + # Some parameter documentations has been truncated, see + # {Increase::Models::PendingTransactionCreateParams} for more details. + # + # Creates a pending transaction on an account. This can be useful to hold funds + # for an external payment or known future transaction outside of Increase. The + # resulting Pending Transaction will have a `category` of `user_initiated_hold` + # and can be released via the API to unlock the held funds. + # + # @overload create(account_id:, amount:, description: nil, request_options: {}) + # + # @param account_id [String] The Account to place the hold on. + # + # @param amount [Integer] The amount to hold in the minor unit of the account's currency. For dollars, for + # + # @param description [String] The description you choose to give the hold. + # + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Increase::Models::PendingTransaction] + # + # @see Increase::Models::PendingTransactionCreateParams + def create(params) + parsed, options = Increase::PendingTransactionCreateParams.dump_request(params) + @client.request( + method: :post, + path: "pending_transactions", + body: parsed, + model: Increase::PendingTransaction, + options: options + ) + end + # Retrieve a Pending Transaction # # @overload retrieve(pending_transaction_id, request_options: {}) @@ -61,6 +93,29 @@ def list(params = {}) ) end + # Release a Pending Transaction you had previously created. The Pending + # Transaction must have a `category` of `user_initiated_hold` and a `status` of + # `pending`. This will unlock the held funds and mark the Pending Transaction as + # complete. + # + # @overload release(pending_transaction_id, request_options: {}) + # + # @param pending_transaction_id [String] The identifier of the Pending Transaction to release. + # + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Increase::Models::PendingTransaction] + # + # @see Increase::Models::PendingTransactionReleaseParams + def release(pending_transaction_id, params = {}) + @client.request( + method: :post, + path: ["pending_transactions/%1$s/release", pending_transaction_id], + model: Increase::PendingTransaction, + options: params[:request_options] + ) + end + # @api private # # @param client [Increase::Client] diff --git a/rbi/increase/models.rbi b/rbi/increase/models.rbi index d02c6cf81..2a63b115e 100644 --- a/rbi/increase/models.rbi +++ b/rbi/increase/models.rbi @@ -408,8 +408,14 @@ module Increase PendingTransaction = Increase::Models::PendingTransaction + PendingTransactionCreateParams = + Increase::Models::PendingTransactionCreateParams + PendingTransactionListParams = Increase::Models::PendingTransactionListParams + PendingTransactionReleaseParams = + Increase::Models::PendingTransactionReleaseParams + PendingTransactionRetrieveParams = Increase::Models::PendingTransactionRetrieveParams diff --git a/rbi/increase/models/pending_transaction.rbi b/rbi/increase/models/pending_transaction.rbi index bf2e6d518..7e0fc3a5c 100644 --- a/rbi/increase/models/pending_transaction.rbi +++ b/rbi/increase/models/pending_transaction.rbi @@ -348,25 +348,6 @@ module Increase end attr_writer :check_transfer_instruction - # A Group Initiated Hold Source object. This field will be present in the JSON - # response if and only if `category` is equal to `group_initiated_hold`. - sig do - returns( - T.nilable(Increase::PendingTransaction::Source::GroupInitiatedHold) - ) - end - attr_reader :group_initiated_hold - - sig do - params( - group_initiated_hold: - T.nilable( - Increase::PendingTransaction::Source::GroupInitiatedHold::OrHash - ) - ).void - end - attr_writer :group_initiated_hold - # An Inbound Funds Hold object. This field will be present in the JSON response if # and only if `category` is equal to `inbound_funds_hold`. We hold funds for # certain transaction types to account for return windows where funds might still @@ -481,6 +462,12 @@ module Increase end attr_writer :swift_transfer_instruction + # An User Initiated Hold object. This field will be present in the JSON response + # if and only if `category` is equal to `user_initiated_hold`. Created when a user + # initiates a hold on funds in their account. + sig { returns(T.nilable(T.anything)) } + attr_accessor :user_initiated_hold + # A Wire Transfer Instruction object. This field will be present in the JSON # response if and only if `category` is equal to `wire_transfer_instruction`. sig do @@ -528,10 +515,6 @@ module Increase T.nilable( Increase::PendingTransaction::Source::CheckTransferInstruction::OrHash ), - group_initiated_hold: - T.nilable( - Increase::PendingTransaction::Source::GroupInitiatedHold::OrHash - ), inbound_funds_hold: T.nilable( Increase::PendingTransaction::Source::InboundFundsHold::OrHash @@ -553,6 +536,7 @@ module Increase T.nilable( Increase::PendingTransaction::Source::SwiftTransferInstruction::OrHash ), + user_initiated_hold: T.nilable(T.anything), wire_transfer_instruction: T.nilable( Increase::PendingTransaction::Source::WireTransferInstruction::OrHash @@ -580,9 +564,6 @@ module Increase # A Check Transfer Instruction object. This field will be present in the JSON # response if and only if `category` is equal to `check_transfer_instruction`. check_transfer_instruction:, - # A Group Initiated Hold Source object. This field will be present in the JSON - # response if and only if `category` is equal to `group_initiated_hold`. - group_initiated_hold:, # An Inbound Funds Hold object. This field will be present in the JSON response if # and only if `category` is equal to `inbound_funds_hold`. We hold funds for # certain transaction types to account for return windows where funds might still @@ -607,6 +588,10 @@ module Increase # A Swift Transfer Instruction object. This field will be present in the JSON # response if and only if `category` is equal to `swift_transfer_instruction`. swift_transfer_instruction:, + # An User Initiated Hold object. This field will be present in the JSON response + # if and only if `category` is equal to `user_initiated_hold`. Created when a user + # initiates a hold on funds in their account. + user_initiated_hold:, # A Wire Transfer Instruction object. This field will be present in the JSON # response if and only if `category` is equal to `wire_transfer_instruction`. wire_transfer_instruction: @@ -638,10 +623,6 @@ module Increase T.nilable( Increase::PendingTransaction::Source::CheckTransferInstruction ), - group_initiated_hold: - T.nilable( - Increase::PendingTransaction::Source::GroupInitiatedHold - ), inbound_funds_hold: T.nilable( Increase::PendingTransaction::Source::InboundFundsHold @@ -663,6 +644,7 @@ module Increase T.nilable( Increase::PendingTransaction::Source::SwiftTransferInstruction ), + user_initiated_hold: T.nilable(T.anything), wire_transfer_instruction: T.nilable( Increase::PendingTransaction::Source::WireTransferInstruction @@ -2318,10 +2300,10 @@ module Increase Increase::PendingTransaction::Source::Category::TaggedSymbol ) - # Group Initiated Hold Source: details will be under the `group_initiated_hold` object. - GROUP_INITIATED_HOLD = + # User Initiated Hold: details will be under the `user_initiated_hold` object. + USER_INITIATED_HOLD = T.let( - :group_initiated_hold, + :user_initiated_hold, Increase::PendingTransaction::Source::Category::TaggedSymbol ) @@ -2654,33 +2636,6 @@ module Increase end end - class GroupInitiatedHold < Increase::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - Increase::PendingTransaction::Source::GroupInitiatedHold, - Increase::Internal::AnyHash - ) - end - - # The Group Initiated Hold identifier. - sig { returns(String) } - attr_accessor :id - - # A Group Initiated Hold Source object. This field will be present in the JSON - # response if and only if `category` is equal to `group_initiated_hold`. - sig { params(id: String).returns(T.attached_class) } - def self.new( - # The Group Initiated Hold identifier. - id: - ) - end - - sig { override.returns({ id: String }) } - def to_hash - end - end - class InboundFundsHold < Increase::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/increase/models/pending_transaction_create_params.rbi b/rbi/increase/models/pending_transaction_create_params.rbi new file mode 100644 index 000000000..2d54a9642 --- /dev/null +++ b/rbi/increase/models/pending_transaction_create_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Increase + module Models + class PendingTransactionCreateParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Increase::PendingTransactionCreateParams, + Increase::Internal::AnyHash + ) + end + + # The Account to place the hold on. + sig { returns(String) } + attr_accessor :account_id + + # The amount to hold in the minor unit of the account's currency. For dollars, for + # example, this is cents. This should be a negative amount - to hold $1.00 from + # the account, you would pass -100. + sig { returns(Integer) } + attr_accessor :amount + + # The description you choose to give the hold. + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + sig do + params( + account_id: String, + amount: Integer, + description: String, + request_options: Increase::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The Account to place the hold on. + account_id:, + # The amount to hold in the minor unit of the account's currency. For dollars, for + # example, this is cents. This should be a negative amount - to hold $1.00 from + # the account, you would pass -100. + amount:, + # The description you choose to give the hold. + description: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_id: String, + amount: Integer, + description: String, + request_options: Increase::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/increase/models/pending_transaction_list_params.rbi b/rbi/increase/models/pending_transaction_list_params.rbi index 439f72adf..acd2f44d2 100644 --- a/rbi/increase/models/pending_transaction_list_params.rbi +++ b/rbi/increase/models/pending_transaction_list_params.rbi @@ -237,10 +237,10 @@ module Increase Increase::PendingTransactionListParams::Category::In::TaggedSymbol ) - # Group Initiated Hold Source: details will be under the `group_initiated_hold` object. - GROUP_INITIATED_HOLD = + # User Initiated Hold: details will be under the `user_initiated_hold` object. + USER_INITIATED_HOLD = T.let( - :group_initiated_hold, + :user_initiated_hold, Increase::PendingTransactionListParams::Category::In::TaggedSymbol ) diff --git a/rbi/increase/models/pending_transaction_release_params.rbi b/rbi/increase/models/pending_transaction_release_params.rbi new file mode 100644 index 000000000..d841e1330 --- /dev/null +++ b/rbi/increase/models/pending_transaction_release_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Increase + module Models + class PendingTransactionReleaseParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Increase::PendingTransactionReleaseParams, + Increase::Internal::AnyHash + ) + end + + sig do + params(request_options: Increase::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Increase::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/increase/resources/pending_transactions.rbi b/rbi/increase/resources/pending_transactions.rbi index 7fa034fda..8a4ab1272 100644 --- a/rbi/increase/resources/pending_transactions.rbi +++ b/rbi/increase/resources/pending_transactions.rbi @@ -3,6 +3,31 @@ module Increase module Resources class PendingTransactions + # Creates a pending transaction on an account. This can be useful to hold funds + # for an external payment or known future transaction outside of Increase. The + # resulting Pending Transaction will have a `category` of `user_initiated_hold` + # and can be released via the API to unlock the held funds. + sig do + params( + account_id: String, + amount: Integer, + description: String, + request_options: Increase::RequestOptions::OrHash + ).returns(Increase::PendingTransaction) + end + def create( + # The Account to place the hold on. + account_id:, + # The amount to hold in the minor unit of the account's currency. For dollars, for + # example, this is cents. This should be a negative amount - to hold $1.00 from + # the account, you would pass -100. + amount:, + # The description you choose to give the hold. + description: nil, + request_options: {} + ) + end + # Retrieve a Pending Transaction sig do params( @@ -47,6 +72,23 @@ module Increase ) end + # Release a Pending Transaction you had previously created. The Pending + # Transaction must have a `category` of `user_initiated_hold` and a `status` of + # `pending`. This will unlock the held funds and mark the Pending Transaction as + # complete. + sig do + params( + pending_transaction_id: String, + request_options: Increase::RequestOptions::OrHash + ).returns(Increase::PendingTransaction) + end + def release( + # The identifier of the Pending Transaction to release. + pending_transaction_id, + request_options: {} + ) + end + # @api private sig { params(client: Increase::Client).returns(T.attached_class) } def self.new(client:) diff --git a/sig/increase/models.rbs b/sig/increase/models.rbs index 6fb202175..e1e47c9c2 100644 --- a/sig/increase/models.rbs +++ b/sig/increase/models.rbs @@ -351,8 +351,12 @@ module Increase class PendingTransaction = Increase::Models::PendingTransaction + class PendingTransactionCreateParams = Increase::Models::PendingTransactionCreateParams + class PendingTransactionListParams = Increase::Models::PendingTransactionListParams + class PendingTransactionReleaseParams = Increase::Models::PendingTransactionReleaseParams + class PendingTransactionRetrieveParams = Increase::Models::PendingTransactionRetrieveParams class PhysicalCard = Increase::Models::PhysicalCard diff --git a/sig/increase/models/pending_transaction.rbs b/sig/increase/models/pending_transaction.rbs index 7fcb4ee41..d6121cec3 100644 --- a/sig/increase/models/pending_transaction.rbs +++ b/sig/increase/models/pending_transaction.rbs @@ -122,13 +122,13 @@ module Increase category: Increase::Models::PendingTransaction::Source::category, check_deposit_instruction: Increase::PendingTransaction::Source::CheckDepositInstruction?, check_transfer_instruction: Increase::PendingTransaction::Source::CheckTransferInstruction?, - group_initiated_hold: Increase::PendingTransaction::Source::GroupInitiatedHold?, inbound_funds_hold: Increase::PendingTransaction::Source::InboundFundsHold?, inbound_wire_transfer_reversal: Increase::PendingTransaction::Source::InboundWireTransferReversal?, other: top?, outbound_card_push_transfer_instruction: Increase::PendingTransaction::Source::OutboundCardPushTransferInstruction?, real_time_payments_transfer_instruction: Increase::PendingTransaction::Source::RealTimePaymentsTransferInstruction?, swift_transfer_instruction: Increase::PendingTransaction::Source::SwiftTransferInstruction?, + user_initiated_hold: top?, wire_transfer_instruction: Increase::PendingTransaction::Source::WireTransferInstruction? } @@ -145,8 +145,6 @@ module Increase attr_accessor check_transfer_instruction: Increase::PendingTransaction::Source::CheckTransferInstruction? - attr_accessor group_initiated_hold: Increase::PendingTransaction::Source::GroupInitiatedHold? - attr_accessor inbound_funds_hold: Increase::PendingTransaction::Source::InboundFundsHold? attr_accessor inbound_wire_transfer_reversal: Increase::PendingTransaction::Source::InboundWireTransferReversal? @@ -159,6 +157,8 @@ module Increase attr_accessor swift_transfer_instruction: Increase::PendingTransaction::Source::SwiftTransferInstruction? + attr_accessor user_initiated_hold: top? + attr_accessor wire_transfer_instruction: Increase::PendingTransaction::Source::WireTransferInstruction? def initialize: ( @@ -168,13 +168,13 @@ module Increase category: Increase::Models::PendingTransaction::Source::category, check_deposit_instruction: Increase::PendingTransaction::Source::CheckDepositInstruction?, check_transfer_instruction: Increase::PendingTransaction::Source::CheckTransferInstruction?, - group_initiated_hold: Increase::PendingTransaction::Source::GroupInitiatedHold?, inbound_funds_hold: Increase::PendingTransaction::Source::InboundFundsHold?, inbound_wire_transfer_reversal: Increase::PendingTransaction::Source::InboundWireTransferReversal?, other: top?, outbound_card_push_transfer_instruction: Increase::PendingTransaction::Source::OutboundCardPushTransferInstruction?, real_time_payments_transfer_instruction: Increase::PendingTransaction::Source::RealTimePaymentsTransferInstruction?, swift_transfer_instruction: Increase::PendingTransaction::Source::SwiftTransferInstruction?, + user_initiated_hold: top?, wire_transfer_instruction: Increase::PendingTransaction::Source::WireTransferInstruction? ) -> void @@ -185,13 +185,13 @@ module Increase category: Increase::Models::PendingTransaction::Source::category, check_deposit_instruction: Increase::PendingTransaction::Source::CheckDepositInstruction?, check_transfer_instruction: Increase::PendingTransaction::Source::CheckTransferInstruction?, - group_initiated_hold: Increase::PendingTransaction::Source::GroupInitiatedHold?, inbound_funds_hold: Increase::PendingTransaction::Source::InboundFundsHold?, inbound_wire_transfer_reversal: Increase::PendingTransaction::Source::InboundWireTransferReversal?, other: top?, outbound_card_push_transfer_instruction: Increase::PendingTransaction::Source::OutboundCardPushTransferInstruction?, real_time_payments_transfer_instruction: Increase::PendingTransaction::Source::RealTimePaymentsTransferInstruction?, swift_transfer_instruction: Increase::PendingTransaction::Source::SwiftTransferInstruction?, + user_initiated_hold: top?, wire_transfer_instruction: Increase::PendingTransaction::Source::WireTransferInstruction? } @@ -853,7 +853,7 @@ module Increase | :check_deposit_instruction | :check_transfer_instruction | :inbound_funds_hold - | :group_initiated_hold + | :user_initiated_hold | :real_time_payments_transfer_instruction | :wire_transfer_instruction | :inbound_wire_transfer_reversal @@ -882,8 +882,8 @@ module Increase # Inbound Funds Hold: details will be under the `inbound_funds_hold` object. INBOUND_FUNDS_HOLD: :inbound_funds_hold - # Group Initiated Hold Source: details will be under the `group_initiated_hold` object. - GROUP_INITIATED_HOLD: :group_initiated_hold + # User Initiated Hold: details will be under the `user_initiated_hold` object. + USER_INITIATED_HOLD: :user_initiated_hold # Real-Time Payments Transfer Instruction: details will be under the `real_time_payments_transfer_instruction` object. REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION: :real_time_payments_transfer_instruction @@ -1022,16 +1022,6 @@ module Increase end end - type group_initiated_hold = { id: String } - - class GroupInitiatedHold < Increase::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - type inbound_funds_hold = { id: String, diff --git a/sig/increase/models/pending_transaction_create_params.rbs b/sig/increase/models/pending_transaction_create_params.rbs new file mode 100644 index 000000000..915864a57 --- /dev/null +++ b/sig/increase/models/pending_transaction_create_params.rbs @@ -0,0 +1,34 @@ +module Increase + module Models + type pending_transaction_create_params = + { account_id: String, amount: Integer, description: String } + & Increase::Internal::Type::request_parameters + + class PendingTransactionCreateParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + attr_accessor account_id: String + + attr_accessor amount: Integer + + attr_reader description: String? + + def description=: (String) -> String + + def initialize: ( + account_id: String, + amount: Integer, + ?description: String, + ?request_options: Increase::request_opts + ) -> void + + def to_hash: -> { + account_id: String, + amount: Integer, + description: String, + request_options: Increase::RequestOptions + } + end + end +end diff --git a/sig/increase/models/pending_transaction_list_params.rbs b/sig/increase/models/pending_transaction_list_params.rbs index 863294366..c13d6187f 100644 --- a/sig/increase/models/pending_transaction_list_params.rbs +++ b/sig/increase/models/pending_transaction_list_params.rbs @@ -99,7 +99,7 @@ module Increase | :check_deposit_instruction | :check_transfer_instruction | :inbound_funds_hold - | :group_initiated_hold + | :user_initiated_hold | :real_time_payments_transfer_instruction | :wire_transfer_instruction | :inbound_wire_transfer_reversal @@ -128,8 +128,8 @@ module Increase # Inbound Funds Hold: details will be under the `inbound_funds_hold` object. INBOUND_FUNDS_HOLD: :inbound_funds_hold - # Group Initiated Hold Source: details will be under the `group_initiated_hold` object. - GROUP_INITIATED_HOLD: :group_initiated_hold + # User Initiated Hold: details will be under the `user_initiated_hold` object. + USER_INITIATED_HOLD: :user_initiated_hold # Real-Time Payments Transfer Instruction: details will be under the `real_time_payments_transfer_instruction` object. REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION: :real_time_payments_transfer_instruction diff --git a/sig/increase/models/pending_transaction_release_params.rbs b/sig/increase/models/pending_transaction_release_params.rbs new file mode 100644 index 000000000..8353cc26e --- /dev/null +++ b/sig/increase/models/pending_transaction_release_params.rbs @@ -0,0 +1,15 @@ +module Increase + module Models + type pending_transaction_release_params = + { } & Increase::Internal::Type::request_parameters + + class PendingTransactionReleaseParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + def initialize: (?request_options: Increase::request_opts) -> void + + def to_hash: -> { request_options: Increase::RequestOptions } + end + end +end diff --git a/sig/increase/resources/pending_transactions.rbs b/sig/increase/resources/pending_transactions.rbs index 5f3179bd1..2d637464f 100644 --- a/sig/increase/resources/pending_transactions.rbs +++ b/sig/increase/resources/pending_transactions.rbs @@ -1,6 +1,13 @@ module Increase module Resources class PendingTransactions + def create: ( + account_id: String, + amount: Integer, + ?description: String, + ?request_options: Increase::request_opts + ) -> Increase::PendingTransaction + def retrieve: ( String pending_transaction_id, ?request_options: Increase::request_opts @@ -17,6 +24,11 @@ module Increase ?request_options: Increase::request_opts ) -> Increase::Internal::Page[Increase::PendingTransaction] + def release: ( + String pending_transaction_id, + ?request_options: Increase::request_opts + ) -> Increase::PendingTransaction + def initialize: (client: Increase::Client) -> void end end diff --git a/test/increase/resources/pending_transactions_test.rb b/test/increase/resources/pending_transactions_test.rb index deeea4f07..be00cd4e9 100644 --- a/test/increase/resources/pending_transactions_test.rb +++ b/test/increase/resources/pending_transactions_test.rb @@ -3,6 +3,32 @@ require_relative "../test_helper" class Increase::Test::Resources::PendingTransactionsTest < Increase::Test::ResourceTest + def test_create_required_params + response = + @increase.pending_transactions.create(account_id: "account_in71c4amph0vgo2qllky", amount: -1000) + + assert_pattern do + response => Increase::PendingTransaction + end + + assert_pattern do + response => { + id: String, + account_id: String, + amount: Integer, + completed_at: Time | nil, + created_at: Time, + currency: Increase::PendingTransaction::Currency, + description: String, + route_id: String | nil, + route_type: Increase::PendingTransaction::RouteType | nil, + source: Increase::PendingTransaction::Source, + status: Increase::PendingTransaction::Status, + type: Increase::PendingTransaction::Type + } + end + end + def test_retrieve response = @increase.pending_transactions.retrieve("pending_transaction_id") @@ -59,4 +85,29 @@ def test_list } end end + + def test_release + response = @increase.pending_transactions.release("pending_transaction_id") + + assert_pattern do + response => Increase::PendingTransaction + end + + assert_pattern do + response => { + id: String, + account_id: String, + amount: Integer, + completed_at: Time | nil, + created_at: Time, + currency: Increase::PendingTransaction::Currency, + description: String, + route_id: String | nil, + route_type: Increase::PendingTransaction::RouteType | nil, + source: Increase::PendingTransaction::Source, + status: Increase::PendingTransaction::Status, + type: Increase::PendingTransaction::Type + } + end + end end From 312be1bfdf0e2341fdcaa0610cc631d69264fad8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 22:27:29 +0000 Subject: [PATCH 3/3] release: 0.1.0-alpha.32 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/increase/version.rb | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a899ac74f..2ce25feca 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.31" + ".": "0.1.0-alpha.32" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index fdb1e85b7..6dc88d304 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.1.0-alpha.32 (2025-06-11) + +Full Changelog: [v0.1.0-alpha.31...v0.1.0-alpha.32](https://github.com/Increase/increase-ruby/compare/v0.1.0-alpha.31...v0.1.0-alpha.32) + +### Features + +* **api:** api update ([9c520ae](https://github.com/Increase/increase-ruby/commit/9c520aec8a6ef3507d816a8bc27c0c17766220a4)) + + +### Chores + +* **ci:** link to correct github repo ([50e7095](https://github.com/Increase/increase-ruby/commit/50e70954b15bd52f627163148865d0fc53e78f87)) + ## 0.1.0-alpha.31 (2025-06-08) Full Changelog: [v0.1.0-alpha.30...v0.1.0-alpha.31](https://github.com/Increase/increase-ruby/compare/v0.1.0-alpha.30...v0.1.0-alpha.31) diff --git a/Gemfile.lock b/Gemfile.lock index 4dcd41d2a..af5e012bb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - increase (0.1.0.pre.alpha.31) + increase (0.1.0.pre.alpha.32) connection_pool GEM diff --git a/README.md b/README.md index 5bcac58df..b969e8c1d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "increase", "~> 0.1.0.pre.alpha.31" +gem "increase", "~> 0.1.0.pre.alpha.32" ``` diff --git a/lib/increase/version.rb b/lib/increase/version.rb index 4717ab147..086c3fa93 100644 --- a/lib/increase/version.rb +++ b/lib/increase/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Increase - VERSION = "0.1.0.pre.alpha.31" + VERSION = "0.1.0.pre.alpha.32" end