Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
lint:
name: lint
runs-on: ubuntu-latest


steps:
- uses: actions/checkout@v4
- name: Set up Ruby
Expand All @@ -29,7 +27,6 @@ jobs:
test:
name: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.8"
".": "0.1.0-alpha.9"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 199
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-b21d5da00193c0adcbbc6bb89b6eba07c1b8720b9c383e2496d9c68a9426925e.yml
openapi_spec_hash: fb8ac77c8609e18634121b86b378f332
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-55c174581a08cabdf3fcf2fc66d480d497c5f77ab8f0f5e776cc7113b4960037.yml
openapi_spec_hash: 8f70d88f00c9c15ebd8e9049e9f65063
config_hash: 20a463ecd33bd32b7b9bc6f4990907ac
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## 0.1.0-alpha.9 (2025-04-12)

Full Changelog: [v0.1.0-alpha.8...v0.1.0-alpha.9](https://github.com/Increase/increase-ruby/compare/v0.1.0-alpha.8...v0.1.0-alpha.9)

### Features

* **api:** api update ([5a4e9ba](https://github.com/Increase/increase-ruby/commit/5a4e9bacb00277a52798301a3c9c5e38ceb6e5d9))
* **api:** api update ([f79ff29](https://github.com/Increase/increase-ruby/commit/f79ff298e7be0c13803b9b2f4575f75f1550a286))
* **api:** api update ([327f605](https://github.com/Increase/increase-ruby/commit/327f605b8456aa8b0761989c863839c83dc1482d))
* **api:** api update ([55e7b4c](https://github.com/Increase/increase-ruby/commit/55e7b4c83502d2adf46d473b8d0bc7367ad5d0dc))
* **api:** api update ([e53e9d7](https://github.com/Increase/increase-ruby/commit/e53e9d7a656b9c5de1a8b977282e09f7630b8faa))


### Bug Fixes

* inaccuracies in the README.md ([1c01f71](https://github.com/Increase/increase-ruby/commit/1c01f711875bb2ea64fede9350d916c2a942dbc7))
* **internal:** update release-please to use ruby strategy for README.md ([#50](https://github.com/Increase/increase-ruby/issues/50)) ([3bd9441](https://github.com/Increase/increase-ruby/commit/3bd9441cafc861e86bed22b903f5a1d4ffa66d43))


### Chores

* ensure readme.md is bumped when release please updates versions ([#49](https://github.com/Increase/increase-ruby/issues/49)) ([b524b98](https://github.com/Increase/increase-ruby/commit/b524b987ed001e01ee3ca2a6cce4afa6521573f9))
* fix readme typo ([#52](https://github.com/Increase/increase-ruby/issues/52)) ([b2d7d10](https://github.com/Increase/increase-ruby/commit/b2d7d1006be912f2009aab5da9f0121696b83485))
* **internal:** expand CI branch coverage ([#51](https://github.com/Increase/increase-ruby/issues/51)) ([46c1641](https://github.com/Increase/increase-ruby/commit/46c1641d60271c5dd068704973db35446c6b1ae3))
* **internal:** reduce CI branch coverage ([ebda740](https://github.com/Increase/increase-ruby/commit/ebda740837d8c68da8a5526178bf62b1ba059d7e))
* **internal:** version bump ([ad35cfd](https://github.com/Increase/increase-ruby/commit/ad35cfd373e451b0c1d0b063229e731c139c4b3b))
* loosen const and integer coercion rules ([#48](https://github.com/Increase/increase-ruby/issues/48)) ([ef3dc18](https://github.com/Increase/increase-ruby/commit/ef3dc18eac859aa3e37dd829c93ae2d337e2524c))

## 0.1.0-alpha.8 (2025-04-08)

Full Changelog: [v0.1.0-alpha.7...v0.1.0-alpha.8](https://github.com/Increase/increase-ruby/compare/v0.1.0-alpha.7...v0.1.0-alpha.8)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
increase (0.1.0.pre.alpha.8)
increase (0.1.0.pre.alpha.9)
connection_pool

GEM
Expand Down
37 changes: 14 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,11 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "increase", "~> 0.1.0.pre.alpha.7"
gem "increase", "~> 0.1.0.pre.alpha.9"
```

<!-- x-release-please-end -->

To fetch an initial copy of the gem:

```sh
bundle install
```

## Usage

```ruby
Expand All @@ -37,12 +31,11 @@ increase = Increase::Client.new(
environment: "sandbox" # defaults to "production"
)

account =
increase.accounts.create(
name: "New Account!",
entity_id: "entity_n8y8tnk2p9339ti393yi",
program_id: "program_i2v2os4mwza1oetokh9i"
)
account = increase.accounts.create(
name: "New Account!",
entity_id: "entity_n8y8tnk2p9339ti393yi",
program_id: "program_i2v2os4mwza1oetokh9i"
)

puts(account.id)
```
Expand All @@ -66,7 +59,7 @@ page.auto_paging_each do |account|
end
```

## File uploads
### File uploads

Request parameters that correspond to file uploads can be passed as `StringIO`, or a [`Pathname`](https://rubyapi.org/3.1/o/pathname) instance.

Expand All @@ -85,7 +78,7 @@ puts(file.id)

### Errors

When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Increase::Error` will be thrown:
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Increase::Errors::APIError` will be thrown:

```ruby
begin
Expand Down Expand Up @@ -192,12 +185,11 @@ Due to limitations with the Sorbet type system, where a method otherwise can tak
Please follow Sorbet's [setup guides](https://sorbet.org/docs/adopting) for best experience.

```ruby
params =
Increase::Models::AccountCreateParams.new(
name: "New Account!",
entity_id: "entity_n8y8tnk2p9339ti393yi",
program_id: "program_i2v2os4mwza1oetokh9i"
)
params = Increase::Models::AccountCreateParams.new(
name: "New Account!",
entity_id: "entity_n8y8tnk2p9339ti393yi",
program_id: "program_i2v2os4mwza1oetokh9i"
)

increase.accounts.create(**params)
```
Expand Down Expand Up @@ -225,8 +217,7 @@ If you want to explicitly send an extra param, you can do so with the `extra_que
To make requests to undocumented endpoints, you can make requests using `client.request`. Options on the client will be respected (such as retries) when making this request.

```ruby
response =
client.request(
response = client.request(
method: :post,
path: '/undocumented/endpoint',
query: {"dog": "woof"},
Expand Down
2 changes: 1 addition & 1 deletion increase.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Gem::Specification.new do |s|
s.summary = "Ruby library to access the Increase API"
s.authors = ["Increase"]
s.email = "dev-feedback@increase.com"
s.files = Dir["lib/**/*.rb", "rbi/**/*.rbi", "sig/**/*.rbs", "manifest.yaml"]
s.files = Dir["lib/**/*.rb", "rbi/**/*.rbi", "sig/**/*.rbs", "manifest.yaml", "CHANGELOG.md", "SECURITY.md"]
s.extra_rdoc_files = ["README.md"]
s.required_ruby_version = ">= 3.0.0"
s.add_dependency "connection_pool"
Expand Down
24 changes: 16 additions & 8 deletions lib/increase/internal/type/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ def coerce(
if value.is_a?(Integer)
exactness[:yes] += 1
return value
elsif strictness == :strong
elsif strictness == :strong && Integer(value, exception: false) != value
message = "no implicit conversion of #{value.class} into #{target.inspect}"
raise TypeError.new(message)
raise value.is_a?(Numeric) ? ArgumentError.new(message) : TypeError.new(message)
else
Kernel.then do
return Integer(value).tap { exactness[:maybe] += 1 }
Expand Down Expand Up @@ -197,12 +197,20 @@ def coerce(
else
end
in Symbol
if (value.is_a?(Symbol) || value.is_a?(String)) && value.to_sym == target
exactness[:yes] += 1
return target
elsif strictness == :strong
message = "cannot convert non-matching #{value.class} into #{target.inspect}"
raise ArgumentError.new(message)
case value
in Symbol | String
if value.to_sym == target
exactness[:yes] += 1
return target
else
exactness[:maybe] += 1
return value
end
else
if strictness == :strong
message = "cannot convert non-matching #{value.class} into #{target.inspect}"
raise ArgumentError.new(message)
end
end
else
end
Expand Down
14 changes: 8 additions & 6 deletions lib/increase/models/card_payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3100,9 +3100,10 @@ module Currency
# @see Increase::Models::CardPayment::Element::CardRefund#interchange
class Interchange < Increase::Internal::Type::BaseModel
# @!attribute amount
# The interchange amount given as a string containing a decimal number. The amount
# is a positive number if it is credited to Increase (e.g., settlements) and a
# negative number if it is debited (e.g., refunds).
# The interchange amount given as a string containing a decimal number in major
# units (so e.g., "3.14" for $3.14). The amount is a positive number if it is
# credited to Increase (e.g., settlements) and a negative number if it is debited
# (e.g., refunds).
#
# @return [String]
required :amount, String
Expand Down Expand Up @@ -4829,9 +4830,10 @@ module Currency
# @see Increase::Models::CardPayment::Element::CardSettlement#interchange
class Interchange < Increase::Internal::Type::BaseModel
# @!attribute amount
# The interchange amount given as a string containing a decimal number. The amount
# is a positive number if it is credited to Increase (e.g., settlements) and a
# negative number if it is debited (e.g., refunds).
# The interchange amount given as a string containing a decimal number in major
# units (so e.g., "3.14" for $3.14). The amount is a positive number if it is
# credited to Increase (e.g., settlements) and a negative number if it is debited
# (e.g., refunds).
#
# @return [String]
required :amount, String
Expand Down
17 changes: 9 additions & 8 deletions lib/increase/models/check_transfer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,12 @@ class Mailing < Increase::Internal::Type::BaseModel

# @see Increase::Models::CheckTransfer#physical_check
class PhysicalCheck < Increase::Internal::Type::BaseModel
# @!attribute attachment_file_id
# The ID of the file for the check attachment.
#
# @return [String, nil]
required :attachment_file_id, String, nil?: true

# @!attribute mailing_address
# Details for where Increase will mail the check.
#
Expand Down Expand Up @@ -534,6 +540,7 @@ class PhysicalCheck < Increase::Internal::Type::BaseModel
# # Details relating to the physical check that Increase will print and mail. Will
# # be present if and only if `fulfillment_method` is equal to `physical_check`.
# #
# # @param attachment_file_id [String, nil]
# # @param mailing_address [Increase::Models::CheckTransfer::PhysicalCheck::MailingAddress]
# # @param memo [String, nil]
# # @param note [String, nil]
Expand All @@ -544,6 +551,7 @@ class PhysicalCheck < Increase::Internal::Type::BaseModel
# # @param tracking_updates [Array<Increase::Models::CheckTransfer::PhysicalCheck::TrackingUpdate>]
# #
# def initialize(
# attachment_file_id:,
# mailing_address:,
# memo:,
# note:,
Expand Down Expand Up @@ -986,12 +994,6 @@ class SubmittedAddress < Increase::Internal::Type::BaseModel

# @see Increase::Models::CheckTransfer#third_party
class ThirdParty < Increase::Internal::Type::BaseModel
# @!attribute check_number
# The check number that you will print on the check.
#
# @return [String, nil]
required :check_number, String, nil?: true

# @!attribute recipient_name
# The name that you will print on the check.
#
Expand All @@ -1002,10 +1004,9 @@ class ThirdParty < Increase::Internal::Type::BaseModel
# # Details relating to the custom fulfillment you will perform. Will be present if
# # and only if `fulfillment_method` is equal to `third_party`.
# #
# # @param check_number [String, nil]
# # @param recipient_name [String, nil]
# #
# def initialize(check_number:, recipient_name:, **) = super
# def initialize(recipient_name:, **) = super

# def initialize: (Hash | Increase::Internal::Type::BaseModel) -> void
end
Expand Down
61 changes: 48 additions & 13 deletions lib/increase/models/check_transfer_create_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,18 @@ class PhysicalCheck < Increase::Internal::Type::BaseModel
# @return [String]
required :recipient_name, String

# @!attribute [r] attachment_file_id
# The ID of a File to be attached to the check. This must have
# `purpose: check_attachment`. For details on pricing and restrictions, see
# https://increase.com/documentation/originating-checks#printing-checks .
#
# @return [String, nil]
optional :attachment_file_id, String

# @!parse
# # @return [String]
# attr_writer :attachment_file_id

# @!attribute [r] check_number
# The check number Increase should print on the check. This should not contain
# leading zeroes and must be unique across the `source_account_number`. If this is
Expand Down Expand Up @@ -164,6 +176,18 @@ class PhysicalCheck < Increase::Internal::Type::BaseModel
# # @return [Increase::Models::CheckTransferCreateParams::PhysicalCheck::ReturnAddress]
# attr_writer :return_address

# @!attribute [r] shipping_method
# How to ship the check. For details on pricing, timing, and restrictions, see
# https://increase.com/documentation/originating-checks#printing-checks .
#
# @return [Symbol, Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod, nil]
optional :shipping_method,
enum: -> { Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod }

# @!parse
# # @return [Symbol, Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod]
# attr_writer :shipping_method

# @!attribute [r] signature_text
# The text that will appear as the signature on the check in cursive font. If not
# provided, the check will be printed with 'No signature required'.
Expand All @@ -183,18 +207,22 @@ class PhysicalCheck < Increase::Internal::Type::BaseModel
# # @param mailing_address [Increase::Models::CheckTransferCreateParams::PhysicalCheck::MailingAddress]
# # @param memo [String]
# # @param recipient_name [String]
# # @param attachment_file_id [String]
# # @param check_number [String]
# # @param note [String]
# # @param return_address [Increase::Models::CheckTransferCreateParams::PhysicalCheck::ReturnAddress]
# # @param shipping_method [Symbol, Increase::Models::CheckTransferCreateParams::PhysicalCheck::ShippingMethod]
# # @param signature_text [String]
# #
# def initialize(
# mailing_address:,
# memo:,
# recipient_name:,
# attachment_file_id: nil,
# check_number: nil,
# note: nil,
# return_address: nil,
# shipping_method: nil,
# signature_text: nil,
# **
# )
Expand Down Expand Up @@ -311,21 +339,29 @@ class ReturnAddress < Increase::Internal::Type::BaseModel

# def initialize: (Hash | Increase::Internal::Type::BaseModel) -> void
end
end

class ThirdParty < Increase::Internal::Type::BaseModel
# @!attribute [r] check_number
# The check number you will print on the check. This should not contain leading
# zeroes. If this is omitted, Increase will generate a check number for you; you
# should inspect the response and use that check number.
# How to ship the check. For details on pricing, timing, and restrictions, see
# https://increase.com/documentation/originating-checks#printing-checks .
#
# @return [String, nil]
optional :check_number, String
# @see Increase::Models::CheckTransferCreateParams::PhysicalCheck#shipping_method
module ShippingMethod
extend Increase::Internal::Type::Enum

# @!parse
# # @return [String]
# attr_writer :check_number
# USPS First Class
USPS_FIRST_CLASS = :usps_first_class

# FedEx Overnight
FEDEX_OVERNIGHT = :fedex_overnight

finalize!

# @!parse
# # @return [Array<Symbol>]
# def self.values; end
end
end

class ThirdParty < Increase::Internal::Type::BaseModel
# @!attribute [r] recipient_name
# The pay-to name you will print on the check. If provided, this is used for
# [Positive Pay](/documentation/positive-pay). If this is omitted, Increase will
Expand All @@ -343,10 +379,9 @@ class ThirdParty < Increase::Internal::Type::BaseModel
# # `fulfillment_method` is equal to `third_party`. It must not be included if any
# # other `fulfillment_method` is provided.
# #
# # @param check_number [String]
# # @param recipient_name [String]
# #
# def initialize(check_number: nil, recipient_name: nil, **) = super
# def initialize(recipient_name: nil, **) = super

# def initialize: (Hash | Increase::Internal::Type::BaseModel) -> void
end
Expand Down
Loading