diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4d14a67e1..0c37ae42c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.39.0" + ".": "1.40.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index ebd672bf3..564ef9424 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 214 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-e37d9eb06122e71071da98a7375420ce776ad9aa05176bed89a232bd6854f26b.yml -openapi_spec_hash: 8ffb1a0fd8523b24113105717c5d85d8 -config_hash: b0b366d8c705ea0efe62093bae953e5a +configured_endpoints: 215 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-9a5905fe541badfa11ad0641e7aea625c9fb0bc59ba33b1d43d8e88cbbdd71b2.yml +openapi_spec_hash: 4347de40c3142cd56c2185aac9a6739e +config_hash: 0b0a2503208283b283fc5bc6df6a07a5 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a6835ee4..add8563eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.40.0 (2025-08-20) + +Full Changelog: [v1.39.0...v1.40.0](https://github.com/Increase/increase-ruby/compare/v1.39.0...v1.40.0) + +### Features + +* **api:** api update ([6f2b4ab](https://github.com/Increase/increase-ruby/commit/6f2b4ab35ffbb974911ac85740af55836f9609e1)) + ## 1.39.0 (2025-08-20) Full Changelog: [v1.38.0...v1.39.0](https://github.com/Increase/increase-ruby/compare/v1.38.0...v1.39.0) diff --git a/Gemfile.lock b/Gemfile.lock index 2699a11d5..976271366 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - increase (1.39.0) + increase (1.40.0) connection_pool GEM diff --git a/README.md b/README.md index 291e02f9e..2c4d032c4 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", "~> 1.39.0" +gem "increase", "~> 1.40.0" ``` diff --git a/lib/increase.rb b/lib/increase.rb index 9622c09f8..217f6fe3d 100644 --- a/lib/increase.rb +++ b/lib/increase.rb @@ -97,6 +97,7 @@ require_relative "increase/models/bookkeeping_entry_set_list_params" require_relative "increase/models/bookkeeping_entry_set_retrieve_params" require_relative "increase/models/card" +require_relative "increase/models/card_create_details_iframe_params" require_relative "increase/models/card_create_params" require_relative "increase/models/card_details" require_relative "increase/models/card_details_params" @@ -104,6 +105,7 @@ require_relative "increase/models/card_dispute_create_params" require_relative "increase/models/card_dispute_list_params" require_relative "increase/models/card_dispute_retrieve_params" +require_relative "increase/models/card_iframe_url" require_relative "increase/models/card_list_params" require_relative "increase/models/card_payment" require_relative "increase/models/card_payment_list_params" diff --git a/lib/increase/models.rb b/lib/increase/models.rb index 2113313d4..4b095fe26 100644 --- a/lib/increase/models.rb +++ b/lib/increase/models.rb @@ -131,6 +131,8 @@ module Increase Card = Increase::Models::Card + CardCreateDetailsIframeParams = Increase::Models::CardCreateDetailsIframeParams + CardCreateParams = Increase::Models::CardCreateParams CardDetails = Increase::Models::CardDetails @@ -145,6 +147,8 @@ module Increase CardDisputeRetrieveParams = Increase::Models::CardDisputeRetrieveParams + CardIframeURL = Increase::Models::CardIframeURL + CardListParams = Increase::Models::CardListParams CardPayment = Increase::Models::CardPayment diff --git a/lib/increase/models/card_create_details_iframe_params.rb b/lib/increase/models/card_create_details_iframe_params.rb new file mode 100644 index 000000000..fe35548e0 --- /dev/null +++ b/lib/increase/models/card_create_details_iframe_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Increase + module Models + # @see Increase::Resources::Cards#create_details_iframe + class CardCreateDetailsIframeParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + # @!attribute physical_card_id + # The identifier of the Physical Card to retrieve details for. + # + # @return [String, nil] + optional :physical_card_id, String + + # @!method initialize(physical_card_id: nil, request_options: {}) + # @param physical_card_id [String] The identifier of the Physical Card to retrieve details for. + # + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/increase/models/card_iframe_url.rb b/lib/increase/models/card_iframe_url.rb new file mode 100644 index 000000000..a0a258c26 --- /dev/null +++ b/lib/increase/models/card_iframe_url.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Increase + module Models + # @see Increase::Resources::Cards#create_details_iframe + class CardIframeURL < Increase::Internal::Type::BaseModel + # @!attribute expires_at + # The time the iframe URL will expire. + # + # @return [Time] + required :expires_at, Time + + # @!attribute iframe_url + # The iframe URL for the Card. Treat this as an opaque URL. + # + # @return [String] + required :iframe_url, String + + # @!attribute type + # A constant representing the object's type. For this resource it will always be + # `card_iframe_url`. + # + # @return [Symbol, Increase::Models::CardIframeURL::Type] + required :type, enum: -> { Increase::CardIframeURL::Type } + + # @!method initialize(expires_at:, iframe_url:, type:) + # Some parameter documentations has been truncated, see + # {Increase::Models::CardIframeURL} for more details. + # + # An object containing the iframe URL for a Card. + # + # @param expires_at [Time] The time the iframe URL will expire. + # + # @param iframe_url [String] The iframe URL for the Card. Treat this as an opaque URL. + # + # @param type [Symbol, Increase::Models::CardIframeURL::Type] A constant representing the object's type. For this resource it will always be ` + + # A constant representing the object's type. For this resource it will always be + # `card_iframe_url`. + # + # @see Increase::Models::CardIframeURL#type + module Type + extend Increase::Internal::Type::Enum + + CARD_IFRAME_URL = :card_iframe_url + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/increase/resources/cards.rb b/lib/increase/resources/cards.rb index b52b68a3b..7b34034f0 100644 --- a/lib/increase/resources/cards.rb +++ b/lib/increase/resources/cards.rb @@ -121,7 +121,34 @@ def list(params = {}) ) end - # Retrieve sensitive details for a Card + # Create an iframe URL for a Card to display the card details. More details about + # styling and usage can be found in the + # [documentation](/documentation/embedded-card-component). + # + # @overload create_details_iframe(card_id, physical_card_id: nil, request_options: {}) + # + # @param card_id [String] The identifier of the Card to retrieve details for. + # + # @param physical_card_id [String] The identifier of the Physical Card to retrieve details for. + # + # @param request_options [Increase::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Increase::Models::CardIframeURL] + # + # @see Increase::Models::CardCreateDetailsIframeParams + def create_details_iframe(card_id, params = {}) + parsed, options = Increase::CardCreateDetailsIframeParams.dump_request(params) + @client.request( + method: :post, + path: ["cards/%1$s/create_details_iframe", card_id], + body: parsed, + model: Increase::CardIframeURL, + options: options + ) + end + + # Sensitive details for a Card include the primary account number, expiry, card + # verification code, and PIN. # # @overload details(card_id, request_options: {}) # diff --git a/lib/increase/version.rb b/lib/increase/version.rb index 65a6b9b1d..5fc92a7de 100644 --- a/lib/increase/version.rb +++ b/lib/increase/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Increase - VERSION = "1.39.0" + VERSION = "1.40.0" end diff --git a/rbi/increase/models.rbi b/rbi/increase/models.rbi index fc1343cfc..dab9010e8 100644 --- a/rbi/increase/models.rbi +++ b/rbi/increase/models.rbi @@ -104,6 +104,9 @@ module Increase Card = Increase::Models::Card + CardCreateDetailsIframeParams = + Increase::Models::CardCreateDetailsIframeParams + CardCreateParams = Increase::Models::CardCreateParams CardDetails = Increase::Models::CardDetails @@ -118,6 +121,8 @@ module Increase CardDisputeRetrieveParams = Increase::Models::CardDisputeRetrieveParams + CardIframeURL = Increase::Models::CardIframeURL + CardListParams = Increase::Models::CardListParams CardPayment = Increase::Models::CardPayment diff --git a/rbi/increase/models/card_create_details_iframe_params.rbi b/rbi/increase/models/card_create_details_iframe_params.rbi new file mode 100644 index 000000000..2ce37ac4b --- /dev/null +++ b/rbi/increase/models/card_create_details_iframe_params.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Increase + module Models + class CardCreateDetailsIframeParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Increase::CardCreateDetailsIframeParams, + Increase::Internal::AnyHash + ) + end + + # The identifier of the Physical Card to retrieve details for. + sig { returns(T.nilable(String)) } + attr_reader :physical_card_id + + sig { params(physical_card_id: String).void } + attr_writer :physical_card_id + + sig do + params( + physical_card_id: String, + request_options: Increase::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The identifier of the Physical Card to retrieve details for. + physical_card_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + physical_card_id: String, + request_options: Increase::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/increase/models/card_iframe_url.rbi b/rbi/increase/models/card_iframe_url.rbi new file mode 100644 index 000000000..f9abb4d5b --- /dev/null +++ b/rbi/increase/models/card_iframe_url.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Increase + module Models + class CardIframeURL < Increase::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Increase::CardIframeURL, Increase::Internal::AnyHash) + end + + # The time the iframe URL will expire. + sig { returns(Time) } + attr_accessor :expires_at + + # The iframe URL for the Card. Treat this as an opaque URL. + sig { returns(String) } + attr_accessor :iframe_url + + # A constant representing the object's type. For this resource it will always be + # `card_iframe_url`. + sig { returns(Increase::CardIframeURL::Type::TaggedSymbol) } + attr_accessor :type + + # An object containing the iframe URL for a Card. + sig do + params( + expires_at: Time, + iframe_url: String, + type: Increase::CardIframeURL::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The time the iframe URL will expire. + expires_at:, + # The iframe URL for the Card. Treat this as an opaque URL. + iframe_url:, + # A constant representing the object's type. For this resource it will always be + # `card_iframe_url`. + type: + ) + end + + sig do + override.returns( + { + expires_at: Time, + iframe_url: String, + type: Increase::CardIframeURL::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # A constant representing the object's type. For this resource it will always be + # `card_iframe_url`. + module Type + extend Increase::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Increase::CardIframeURL::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD_IFRAME_URL = + T.let(:card_iframe_url, Increase::CardIframeURL::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Increase::CardIframeURL::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/increase/resources/cards.rbi b/rbi/increase/resources/cards.rbi index 2f3b69168..b91f9b061 100644 --- a/rbi/increase/resources/cards.rbi +++ b/rbi/increase/resources/cards.rbi @@ -111,7 +111,27 @@ module Increase ) end - # Retrieve sensitive details for a Card + # Create an iframe URL for a Card to display the card details. More details about + # styling and usage can be found in the + # [documentation](/documentation/embedded-card-component). + sig do + params( + card_id: String, + physical_card_id: String, + request_options: Increase::RequestOptions::OrHash + ).returns(Increase::CardIframeURL) + end + def create_details_iframe( + # The identifier of the Card to retrieve details for. + card_id, + # The identifier of the Physical Card to retrieve details for. + physical_card_id: nil, + request_options: {} + ) + end + + # Sensitive details for a Card include the primary account number, expiry, card + # verification code, and PIN. sig do params( card_id: String, diff --git a/sig/increase/models.rbs b/sig/increase/models.rbs index 2c6c3365c..d9c1d3c34 100644 --- a/sig/increase/models.rbs +++ b/sig/increase/models.rbs @@ -91,6 +91,8 @@ module Increase class Card = Increase::Models::Card + class CardCreateDetailsIframeParams = Increase::Models::CardCreateDetailsIframeParams + class CardCreateParams = Increase::Models::CardCreateParams class CardDetails = Increase::Models::CardDetails @@ -105,6 +107,8 @@ module Increase class CardDisputeRetrieveParams = Increase::Models::CardDisputeRetrieveParams + class CardIframeURL = Increase::Models::CardIframeURL + class CardListParams = Increase::Models::CardListParams class CardPayment = Increase::Models::CardPayment diff --git a/sig/increase/models/card_create_details_iframe_params.rbs b/sig/increase/models/card_create_details_iframe_params.rbs new file mode 100644 index 000000000..f8c4ff779 --- /dev/null +++ b/sig/increase/models/card_create_details_iframe_params.rbs @@ -0,0 +1,26 @@ +module Increase + module Models + type card_create_details_iframe_params = + { physical_card_id: String } + & Increase::Internal::Type::request_parameters + + class CardCreateDetailsIframeParams < Increase::Internal::Type::BaseModel + extend Increase::Internal::Type::RequestParameters::Converter + include Increase::Internal::Type::RequestParameters + + attr_reader physical_card_id: String? + + def physical_card_id=: (String) -> String + + def initialize: ( + ?physical_card_id: String, + ?request_options: Increase::request_opts + ) -> void + + def to_hash: -> { + physical_card_id: String, + request_options: Increase::RequestOptions + } + end + end +end diff --git a/sig/increase/models/card_iframe_url.rbs b/sig/increase/models/card_iframe_url.rbs new file mode 100644 index 000000000..f9d703bb0 --- /dev/null +++ b/sig/increase/models/card_iframe_url.rbs @@ -0,0 +1,40 @@ +module Increase + module Models + type card_iframe_url = + { + expires_at: Time, + iframe_url: String, + type: Increase::Models::CardIframeURL::type_ + } + + class CardIframeURL < Increase::Internal::Type::BaseModel + attr_accessor expires_at: Time + + attr_accessor iframe_url: String + + attr_accessor type: Increase::Models::CardIframeURL::type_ + + def initialize: ( + expires_at: Time, + iframe_url: String, + type: Increase::Models::CardIframeURL::type_ + ) -> void + + def to_hash: -> { + expires_at: Time, + iframe_url: String, + type: Increase::Models::CardIframeURL::type_ + } + + type type_ = :card_iframe_url + + module Type + extend Increase::Internal::Type::Enum + + CARD_IFRAME_URL: :card_iframe_url + + def self?.values: -> ::Array[Increase::Models::CardIframeURL::type_] + end + end + end +end diff --git a/sig/increase/resources/cards.rbs b/sig/increase/resources/cards.rbs index d5292afc8..c73923f3a 100644 --- a/sig/increase/resources/cards.rbs +++ b/sig/increase/resources/cards.rbs @@ -35,6 +35,12 @@ module Increase ?request_options: Increase::request_opts ) -> Increase::Internal::Page[Increase::Card] + def create_details_iframe: ( + String card_id, + ?physical_card_id: String, + ?request_options: Increase::request_opts + ) -> Increase::CardIframeURL + def details: ( String card_id, ?request_options: Increase::request_opts diff --git a/test/increase/resources/cards_test.rb b/test/increase/resources/cards_test.rb index 3949c8d1b..efb2d45be 100644 --- a/test/increase/resources/cards_test.rb +++ b/test/increase/resources/cards_test.rb @@ -114,6 +114,22 @@ def test_list end end + def test_create_details_iframe + response = @increase.cards.create_details_iframe("card_id") + + assert_pattern do + response => Increase::CardIframeURL + end + + assert_pattern do + response => { + expires_at: Time, + iframe_url: String, + type: Increase::CardIframeURL::Type + } + end + end + def test_details response = @increase.cards.details("card_id")