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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,13 @@ response), a subclass of `increase.APIStatusError` will be raised, containing `s
All errors inherit from `increase.APIError`.

```python
import increase
from increase import Increase

increase = Increase()
client = Increase()

try:
increase.accounts.create(
client.accounts.create(
naem="Oops",
)
except increase.APIConnectionError as e:
Expand Down
92 changes: 24 additions & 68 deletions src/increase/resources/check_transfers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,10 @@ def create(
self,
*,
account_id: str,
address_city: str,
address_line1: str,
address_state: str,
address_zip: str,
amount: int,
message: str,
recipient_name: str,
address_line2: str | NotGiven = NOT_GIVEN,
note: str | NotGiven = NOT_GIVEN,
fulfillment_method: Literal["physical_check", "third_party"] | NotGiven = NOT_GIVEN,
physical_check: check_transfer_create_params.PhysicalCheck | NotGiven = NOT_GIVEN,
require_approval: bool | NotGiven = NOT_GIVEN,
return_address: check_transfer_create_params.ReturnAddress | NotGiven = NOT_GIVEN,
source_account_number_id: str | NotGiven = NOT_GIVEN,
unique_identifier: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -51,29 +44,21 @@ def create(
Args:
account_id: The identifier for the account that will send the transfer.

address_city: The city of the check's destination.

address_line1: The street address of the check's destination.

address_state: The state of the check's destination.

address_zip: The postal code of the check's destination.

amount: The transfer amount in cents.

message: The descriptor that will be printed on the memo field on the check.

recipient_name: The name that will be printed on the check.
fulfillment_method: Whether Increase will print and mail the check or if you will do it yourself.

address_line2: The second line of the address of the check's destination.
- `physical_check` - Increase will print and mail a physical check.
- `third_party` - Increase will not print a check; you are responsible for
printing and mailing a check with the provided account number, routing number,
check number, and amount.

note: The descriptor that will be printed on the letter included with the check.
physical_check: Details relating to the physical check that Increase will print and mail. This
is required if `fulfillment_method` is equal to `physical_check`. It must not be
included if any other `fulfillment_method` is provided.

require_approval: Whether the transfer requires explicit approval via the dashboard or API.

return_address: The return address to be printed on the check. If omitted this will default to
the address of the Entity of the Account used to make the Check Transfer.

source_account_number_id: The identifier of the Account Number from which to send the transfer and print
on the check.

Expand All @@ -96,17 +81,10 @@ def create(
body=maybe_transform(
{
"account_id": account_id,
"address_city": address_city,
"address_line1": address_line1,
"address_state": address_state,
"address_zip": address_zip,
"amount": amount,
"message": message,
"recipient_name": recipient_name,
"address_line2": address_line2,
"note": note,
"fulfillment_method": fulfillment_method,
"physical_check": physical_check,
"require_approval": require_approval,
"return_address": return_address,
"source_account_number_id": source_account_number_id,
"unique_identifier": unique_identifier,
},
Expand Down Expand Up @@ -346,17 +324,10 @@ async def create(
self,
*,
account_id: str,
address_city: str,
address_line1: str,
address_state: str,
address_zip: str,
amount: int,
message: str,
recipient_name: str,
address_line2: str | NotGiven = NOT_GIVEN,
note: str | NotGiven = NOT_GIVEN,
fulfillment_method: Literal["physical_check", "third_party"] | NotGiven = NOT_GIVEN,
physical_check: check_transfer_create_params.PhysicalCheck | NotGiven = NOT_GIVEN,
require_approval: bool | NotGiven = NOT_GIVEN,
return_address: check_transfer_create_params.ReturnAddress | NotGiven = NOT_GIVEN,
source_account_number_id: str | NotGiven = NOT_GIVEN,
unique_identifier: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -373,29 +344,21 @@ async def create(
Args:
account_id: The identifier for the account that will send the transfer.

address_city: The city of the check's destination.

address_line1: The street address of the check's destination.

address_state: The state of the check's destination.

address_zip: The postal code of the check's destination.

amount: The transfer amount in cents.

message: The descriptor that will be printed on the memo field on the check.

recipient_name: The name that will be printed on the check.
fulfillment_method: Whether Increase will print and mail the check or if you will do it yourself.

address_line2: The second line of the address of the check's destination.
- `physical_check` - Increase will print and mail a physical check.
- `third_party` - Increase will not print a check; you are responsible for
printing and mailing a check with the provided account number, routing number,
check number, and amount.

note: The descriptor that will be printed on the letter included with the check.
physical_check: Details relating to the physical check that Increase will print and mail. This
is required if `fulfillment_method` is equal to `physical_check`. It must not be
included if any other `fulfillment_method` is provided.

require_approval: Whether the transfer requires explicit approval via the dashboard or API.

return_address: The return address to be printed on the check. If omitted this will default to
the address of the Entity of the Account used to make the Check Transfer.

source_account_number_id: The identifier of the Account Number from which to send the transfer and print
on the check.

Expand All @@ -418,17 +381,10 @@ async def create(
body=maybe_transform(
{
"account_id": account_id,
"address_city": address_city,
"address_line1": address_line1,
"address_state": address_state,
"address_zip": address_zip,
"amount": amount,
"message": message,
"recipient_name": recipient_name,
"address_line2": address_line2,
"note": note,
"fulfillment_method": fulfillment_method,
"physical_check": physical_check,
"require_approval": require_approval,
"return_address": return_address,
"source_account_number_id": source_account_number_id,
"unique_identifier": unique_identifier,
},
Expand Down
8 changes: 4 additions & 4 deletions src/increase/resources/limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def create(
- `volume` - The maximum volume of debits allowed in the minor unit of the
model's currency.

model_id: The identifier of the Account or Account Number you wish to associate the limit
with.
model_id: The identifier of the Account, Account Number, or Card you wish to associate the
limit with.

value: The value to test the limit against.

Expand Down Expand Up @@ -250,8 +250,8 @@ async def create(
- `volume` - The maximum volume of debits allowed in the minor unit of the
model's currency.

model_id: The identifier of the Account or Account Number you wish to associate the limit
with.
model_id: The identifier of the Account, Account Number, or Card you wish to associate the
limit with.

value: The value to test the limit against.

Expand Down
119 changes: 82 additions & 37 deletions src/increase/types/check_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@

from .._models import BaseModel

__all__ = ["CheckTransfer", "Approval", "Cancellation", "Deposit", "ReturnAddress", "StopPaymentRequest", "Submission"]
__all__ = [
"CheckTransfer",
"Approval",
"Cancellation",
"Deposit",
"Mailing",
"PhysicalCheck",
"PhysicalCheckMailingAddress",
"PhysicalCheckReturnAddress",
"StopPaymentRequest",
"Submission",
]


class Approval(BaseModel):
Expand Down Expand Up @@ -63,24 +74,69 @@ class Deposit(BaseModel):
"""


class ReturnAddress(BaseModel):
class Mailing(BaseModel):
mailed_at: datetime
"""
The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which
the check was mailed.
"""


class PhysicalCheckMailingAddress(BaseModel):
city: Optional[str]
"""The city of the address."""
"""The city of the check's destination."""

line1: Optional[str]
"""The first line of the address."""
"""The street address of the check's destination."""

line2: Optional[str]
"""The second line of the address."""
"""The second line of the address of the check's destination."""

name: Optional[str]
"""The name of the address."""
"""The name component of the check's mailing address."""

postal_code: Optional[str]
"""The postal code of the check's destination."""

state: Optional[str]
"""The US state of the address."""
"""The state of the check's destination."""


class PhysicalCheckReturnAddress(BaseModel):
city: Optional[str]
"""The city of the check's destination."""

line1: Optional[str]
"""The street address of the check's destination."""

line2: Optional[str]
"""The second line of the address of the check's destination."""

name: Optional[str]
"""The name component of the check's return address."""

postal_code: Optional[str]
"""The postal code of the check's destination."""

state: Optional[str]
"""The state of the check's destination."""


class PhysicalCheck(BaseModel):
mailing_address: PhysicalCheckMailingAddress
"""Details for where Increase will mail the check."""

zip: Optional[str]
"""The postal code of the address."""
memo: Optional[str]
"""The descriptor that will be printed on the memo field on the check."""

note: Optional[str]
"""The descriptor that will be printed on the letter included with the check."""

recipient_name: str
"""The name that will be printed on the check."""

return_address: Optional[PhysicalCheckReturnAddress]
"""The return address to be printed on the check."""


class StopPaymentRequest(BaseModel):
Expand Down Expand Up @@ -119,21 +175,6 @@ class CheckTransfer(BaseModel):
account_number: str
"""The account number printed on the check."""

address_city: Optional[str]
"""The city of the check's destination."""

address_line1: Optional[str]
"""The street address of the check's destination."""

address_line2: Optional[str]
"""The second line of the address of the check's destination."""

address_state: Optional[str]
"""The state of the check's destination."""

address_zip: Optional[str]
"""The postal code of the check's destination."""

amount: int
"""The transfer amount in USD cents."""

Expand Down Expand Up @@ -174,26 +215,30 @@ class CheckTransfer(BaseModel):
deposit: Optional[Deposit]
"""After a check transfer is deposited, this will contain supplemental details."""

mailed_at: Optional[datetime]
"""
The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which
the check was mailed.
"""
fulfillment_method: Literal["physical_check", "third_party"]
"""Whether Increase will print and mail the check or if you will do it yourself.

message: Optional[str]
"""The descriptor that will be printed on the memo field on the check."""
- `physical_check` - Increase will print and mail a physical check.
- `third_party` - Increase will not print a check; you are responsible for
printing and mailing a check with the provided account number, routing number,
check number, and amount.
"""

note: Optional[str]
"""The descriptor that will be printed on the letter included with the check."""
mailing: Optional[Mailing]
"""
If the check has been mailed by Increase, this will contain details of the
shipment.
"""

pending_transaction_id: Optional[str]
"""The identifier of the Pending Transaction associated with the check's creation."""

recipient_name: Optional[str]
"""The name that will be printed on the check."""
physical_check: Optional[PhysicalCheck]
"""Details relating to the physical check that Increase will print and mail.

return_address: Optional[ReturnAddress]
"""The return address to be printed on the check."""
Will be present if and only if `fulfillment_method` is equal to
`physical_check`.
"""

routing_number: str
"""The routing number printed on the check."""
Expand Down
Loading