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
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 238
openapi_spec_hash: 26d57c325f47d508b35237996f9b1074
openapi_spec_hash: f016dd0581244764f46db0611893df13
config_hash: 2ae0d8aaecf01b38cbf9f9e112822c23
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,33 @@ client.files.create(

The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.

## Webhook verification

The SDK includes a helper for verifying webhook signatures, available via an optional dependency:

```sh
# install from PyPI
pip install increase[webhooks]
```

Construct the client with your `webhook_secret` (read from the `INCREASE_WEBHOOK_SECRET` environment variable by default), then pass the raw request body and headers to `events.unwrap()`, which verifies the signature and parses the payload:

```python
import os
from increase import Increase

client = Increase(
webhook_secret=os.environ.get(
"INCREASE_WEBHOOK_SECRET"
), # This is the default and can be omitted
)

# In your webhook handler, with the raw (unparsed) request body and headers:
event = client.events.unwrap(payload, headers=headers)
```

`standardwebhooks.WebhookVerificationError` is raised if the signature is invalid, so a webhook that unwraps without raising is guaranteed authentic.

## Handling errors

When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `increase.APIConnectionError` is raised.
Expand Down
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/increase/resources/ach_transfers.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def create(
company_name: str | Omit = omit,
destination_account_holder: Literal["business", "individual", "unknown"] | Omit = omit,
external_account_id: str | Omit = omit,
funding: Literal["checking", "savings", "general_ledger"] | Omit = omit,
funding: Literal["checking", "savings", "loan", "general_ledger"] | Omit = omit,
individual_id: str | Omit = omit,
individual_name: str | Omit = omit,
preferred_effective_date: ach_transfer_create_params.PreferredEffectiveDate | Omit = omit,
Expand Down Expand Up @@ -129,6 +129,7 @@ def create(

- `checking` - A checking account.
- `savings` - A savings account.
- `loan` - A loan account used in a lender-borrower relationship. Uncommon.
- `general_ledger` - A bank's general ledger. Uncommon.

individual_id: Your identifier for the transfer recipient.
Expand Down Expand Up @@ -435,7 +436,7 @@ async def create(
company_name: str | Omit = omit,
destination_account_holder: Literal["business", "individual", "unknown"] | Omit = omit,
external_account_id: str | Omit = omit,
funding: Literal["checking", "savings", "general_ledger"] | Omit = omit,
funding: Literal["checking", "savings", "loan", "general_ledger"] | Omit = omit,
individual_id: str | Omit = omit,
individual_name: str | Omit = omit,
preferred_effective_date: ach_transfer_create_params.PreferredEffectiveDate | Omit = omit,
Expand Down Expand Up @@ -506,6 +507,7 @@ async def create(

- `checking` - A checking account.
- `savings` - A savings account.
- `loan` - A loan account used in a lender-borrower relationship. Uncommon.
- `general_ledger` - A bank's general ledger. Uncommon.

individual_id: Your identifier for the transfer recipient.
Expand Down
3 changes: 2 additions & 1 deletion src/increase/types/ach_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,11 +804,12 @@ class ACHTransfer(BaseModel):
external_account_id: Optional[str] = None
"""The identifier of the External Account the transfer was made to, if any."""

funding: Literal["checking", "savings", "general_ledger"]
funding: Literal["checking", "savings", "loan", "general_ledger"]
"""The type of the account to which the transfer will be sent.

- `checking` - A checking account.
- `savings` - A savings account.
- `loan` - A loan account used in a lender-borrower relationship. Uncommon.
- `general_ledger` - A bank's general ledger. Uncommon.
"""

Expand Down
3 changes: 2 additions & 1 deletion src/increase/types/ach_transfer_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,12 @@ class ACHTransferCreateParams(TypedDict, total=False):
must be absent.
"""

funding: Literal["checking", "savings", "general_ledger"]
funding: Literal["checking", "savings", "loan", "general_ledger"]
"""The type of the account to which the transfer will be sent.

- `checking` - A checking account.
- `savings` - A savings account.
- `loan` - A loan account used in a lender-borrower relationship. Uncommon.
- `general_ledger` - A bank's general ledger. Uncommon.
"""

Expand Down
9 changes: 9 additions & 0 deletions src/increase/types/card_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,7 @@ class ElementCardAuthorization(BaseModel):
"quasi_cash",
"refund",
"cash_disbursement",
"cash_deposit",
"balance_inquiry",
"unknown",
]
Expand All @@ -1503,6 +1504,8 @@ class ElementCardAuthorization(BaseModel):
voucher authorization, where funds are credited to the cardholder.
- `cash_disbursement` - Cash disbursement transactions are used to withdraw cash
from an ATM or a point of sale.
- `cash_deposit` - Cash deposit transactions are used to deposit cash at an ATM
or a point of sale.
- `balance_inquiry` - A balance inquiry transaction is used to check the balance
of an account associated with a card.
- `unknown` - The processing category is unknown.
Expand Down Expand Up @@ -3189,6 +3192,7 @@ class ElementCardDecline(BaseModel):
"quasi_cash",
"refund",
"cash_disbursement",
"cash_deposit",
"balance_inquiry",
"unknown",
]
Expand All @@ -3212,6 +3216,8 @@ class ElementCardDecline(BaseModel):
voucher authorization, where funds are credited to the cardholder.
- `cash_disbursement` - Cash disbursement transactions are used to withdraw cash
from an ATM or a point of sale.
- `cash_deposit` - Cash deposit transactions are used to deposit cash at an ATM
or a point of sale.
- `balance_inquiry` - A balance inquiry transaction is used to check the balance
of an account associated with a card.
- `unknown` - The processing category is unknown.
Expand Down Expand Up @@ -4127,6 +4133,7 @@ class ElementCardFinancial(BaseModel):
"quasi_cash",
"refund",
"cash_disbursement",
"cash_deposit",
"balance_inquiry",
"unknown",
]
Expand All @@ -4150,6 +4157,8 @@ class ElementCardFinancial(BaseModel):
voucher authorization, where funds are credited to the cardholder.
- `cash_disbursement` - Cash disbursement transactions are used to withdraw cash
from an ATM or a point of sale.
- `cash_deposit` - Cash deposit transactions are used to deposit cash at an ATM
or a point of sale.
- `balance_inquiry` - A balance inquiry transaction is used to check the balance
of an account associated with a card.
- `unknown` - The processing category is unknown.
Expand Down
3 changes: 3 additions & 0 deletions src/increase/types/declined_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,7 @@ class SourceCardDecline(BaseModel):
"quasi_cash",
"refund",
"cash_disbursement",
"cash_deposit",
"balance_inquiry",
"unknown",
]
Expand All @@ -972,6 +973,8 @@ class SourceCardDecline(BaseModel):
voucher authorization, where funds are credited to the cardholder.
- `cash_disbursement` - Cash disbursement transactions are used to withdraw cash
from an ATM or a point of sale.
- `cash_deposit` - Cash deposit transactions are used to deposit cash at an ATM
or a point of sale.
- `balance_inquiry` - A balance inquiry transaction is used to check the balance
of an account associated with a card.
- `unknown` - The processing category is unknown.
Expand Down
3 changes: 3 additions & 0 deletions src/increase/types/pending_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,7 @@ class SourceCardAuthorization(BaseModel):
"quasi_cash",
"refund",
"cash_disbursement",
"cash_deposit",
"balance_inquiry",
"unknown",
]
Expand All @@ -1031,6 +1032,8 @@ class SourceCardAuthorization(BaseModel):
voucher authorization, where funds are credited to the cardholder.
- `cash_disbursement` - Cash disbursement transactions are used to withdraw cash
from an ATM or a point of sale.
- `cash_deposit` - Cash deposit transactions are used to deposit cash at an ATM
or a point of sale.
- `balance_inquiry` - A balance inquiry transaction is used to check the balance
of an account associated with a card.
- `unknown` - The processing category is unknown.
Expand Down
3 changes: 3 additions & 0 deletions src/increase/types/real_time_decision.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,7 @@ class CardAuthorization(BaseModel):
"quasi_cash",
"refund",
"cash_disbursement",
"cash_deposit",
"balance_inquiry",
"unknown",
]
Expand All @@ -1229,6 +1230,8 @@ class CardAuthorization(BaseModel):
voucher authorization, where funds are credited to the cardholder.
- `cash_disbursement` - Cash disbursement transactions are used to withdraw cash
from an ATM or a point of sale.
- `cash_deposit` - Cash deposit transactions are used to deposit cash at an ATM
or a point of sale.
- `balance_inquiry` - A balance inquiry transaction is used to check the balance
of an account associated with a card.
- `unknown` - The processing category is unknown.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ class ProcessingCategory(TypedDict, total=False):
"quasi_cash",
"refund",
"cash_disbursement",
"cash_deposit",
"balance_inquiry",
]
]
Expand All @@ -237,6 +238,8 @@ class ProcessingCategory(TypedDict, total=False):
voucher authorization, where funds are credited to the cardholder.
- `cash_disbursement` - Cash disbursement transactions are used to withdraw cash
from an ATM or a point of sale.
- `cash_deposit` - Cash deposit transactions are used to deposit cash at an ATM
or a point of sale.
- `balance_inquiry` - A balance inquiry transaction is used to check the balance
of an account associated with a card.
"""
Expand Down
7 changes: 5 additions & 2 deletions src/increase/types/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,7 @@ class SourceCardFinancial(BaseModel):
"quasi_cash",
"refund",
"cash_disbursement",
"cash_deposit",
"balance_inquiry",
"unknown",
]
Expand All @@ -1507,6 +1508,8 @@ class SourceCardFinancial(BaseModel):
voucher authorization, where funds are credited to the cardholder.
- `cash_disbursement` - Cash disbursement transactions are used to withdraw cash
from an ATM or a point of sale.
- `cash_deposit` - Cash deposit transactions are used to deposit cash at an ATM
or a point of sale.
- `balance_inquiry` - A balance inquiry transaction is used to check the balance
of an account associated with a card.
- `unknown` - The processing category is unknown.
Expand Down Expand Up @@ -4663,8 +4666,8 @@ class Transaction(BaseModel):

created_at: datetime
"""
The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the
Transaction occurred.
The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which
the Transaction occurred.
"""

currency: Literal["USD"]
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading