diff --git a/README.md b/README.md index 98f856b7a..366084592 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/src/increase/resources/check_transfers.py b/src/increase/resources/check_transfers.py index 827f17eef..90c8f15c9 100644 --- a/src/increase/resources/check_transfers.py +++ b/src/increase/resources/check_transfers.py @@ -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. @@ -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. @@ -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, }, @@ -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. @@ -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. @@ -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, }, diff --git a/src/increase/resources/limits.py b/src/increase/resources/limits.py index c4f7e88b7..fd291af1f 100644 --- a/src/increase/resources/limits.py +++ b/src/increase/resources/limits.py @@ -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. @@ -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. diff --git a/src/increase/types/check_transfer.py b/src/increase/types/check_transfer.py index 015af7b6c..1516cbf17 100644 --- a/src/increase/types/check_transfer.py +++ b/src/increase/types/check_transfer.py @@ -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): @@ -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): @@ -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.""" @@ -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.""" diff --git a/src/increase/types/check_transfer_create_params.py b/src/increase/types/check_transfer_create_params.py index fa37f5723..cfca34fcf 100644 --- a/src/increase/types/check_transfer_create_params.py +++ b/src/increase/types/check_transfer_create_params.py @@ -2,52 +2,37 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict -__all__ = ["CheckTransferCreateParams", "ReturnAddress"] +__all__ = ["CheckTransferCreateParams", "PhysicalCheck", "PhysicalCheckMailingAddress", "PhysicalCheckReturnAddress"] class CheckTransferCreateParams(TypedDict, total=False): account_id: Required[str] """The identifier for the account that will send the transfer.""" - address_city: Required[str] - """The city of the check's destination.""" - - address_line1: Required[str] - """The street address of the check's destination.""" - - address_state: Required[str] - """The state of the check's destination.""" - - address_zip: Required[str] - """The postal code of the check's destination.""" - amount: Required[int] """The transfer amount in cents.""" - message: Required[str] - """The descriptor that will be printed on the memo field on the check.""" + fulfillment_method: Literal["physical_check", "third_party"] + """Whether Increase will print and mail the check or if you will do it yourself. - recipient_name: Required[str] - """The name that will be printed 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. + """ - address_line2: str - """The second line of the address of the check's destination.""" + physical_check: PhysicalCheck + """Details relating to the physical check that Increase will print and mail. - note: str - """The descriptor that will be printed on the letter included with the check.""" + 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: bool """Whether the transfer requires explicit approval via the dashboard or API.""" - return_address: ReturnAddress - """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: str """ The identifier of the Account Number from which to send the transfer and print @@ -62,7 +47,30 @@ class CheckTransferCreateParams(TypedDict, total=False): """ -class ReturnAddress(TypedDict, total=False): +class PhysicalCheckMailingAddress(TypedDict, total=False): + city: Required[str] + """The city component of the check's destination address.""" + + line1: Required[str] + """The first line of the address component of the check's destination address.""" + + postal_code: Required[str] + """The postal code component of the check's destination address.""" + + state: Required[str] + """The US state component of the check's destination address.""" + + line2: str + """The second line of the address component of the check's destination address.""" + + name: str + """The name component of the check's destination address. + + Defaults to the provided `recipient_name` parameter. + """ + + +class PhysicalCheckReturnAddress(TypedDict, total=False): city: Required[str] """The city of the return address.""" @@ -72,11 +80,32 @@ class ReturnAddress(TypedDict, total=False): name: Required[str] """The name of the return address.""" + postal_code: Required[str] + """The postal code of the return address.""" + state: Required[str] """The US state of the return address.""" - zip: Required[str] - """The postal code of the return address.""" - line2: str """The second line of the return address.""" + + +class PhysicalCheck(TypedDict, total=False): + mailing_address: Required[PhysicalCheckMailingAddress] + """Details for where Increase will mail the check.""" + + memo: Required[str] + """The descriptor that will be printed on the memo field on the check.""" + + recipient_name: Required[str] + """The name that will be printed on the check in the 'To:' field.""" + + note: str + """The descriptor that will be printed on the letter included with the check.""" + + return_address: PhysicalCheckReturnAddress + """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. + """ diff --git a/src/increase/types/declined_transaction.py b/src/increase/types/declined_transaction.py index 30244b57b..068468afb 100644 --- a/src/increase/types/declined_transaction.py +++ b/src/increase/types/declined_transaction.py @@ -46,6 +46,7 @@ class SourceACHDecline(BaseModel): "group_locked", "insufficient_funds", "misrouted_return", + "return_of_erroneous_or_reversing_debit", "no_ach_route", "originator_request", "transaction_not_allowed", @@ -61,6 +62,7 @@ class SourceACHDecline(BaseModel): - `group_locked` - Your account is inactive. - `insufficient_funds` - Your account contains insufficient funds. - `misrouted_return` - Other. + - `return_of_erroneous_or_reversing_debit` - Other. - `no_ach_route` - The account number that was debited does not exist. - `originator_request` - Other. - `transaction_not_allowed` - The transaction is not allowed per Increase's @@ -131,7 +133,13 @@ class SourceCardDeclineNetworkDetailsVisa(BaseModel): class SourceCardDeclineNetworkDetails(BaseModel): - visa: SourceCardDeclineNetworkDetailsVisa + category: Literal["visa"] + """The payment network used to process this card authorization + + - `visa` - Visa + """ + + visa: Optional[SourceCardDeclineNetworkDetailsVisa] """Fields specific to the `visa` network""" @@ -185,12 +193,6 @@ class SourceCardDecline(BaseModel): merchant_state: Optional[str] """The state the merchant resides in.""" - network: Literal["visa"] - """The payment network used to process this card authorization - - - `visa` - Visa - """ - network_details: SourceCardDeclineNetworkDetails """Fields specific to the `network`""" diff --git a/src/increase/types/limit_create_params.py b/src/increase/types/limit_create_params.py index 46a2cc1e7..10b21948c 100644 --- a/src/increase/types/limit_create_params.py +++ b/src/increase/types/limit_create_params.py @@ -18,8 +18,8 @@ class LimitCreateParams(TypedDict, total=False): model_id: Required[str] """ - The identifier of the Account or Account Number you wish to associate the limit - with. + The identifier of the Account, Account Number, or Card you wish to associate the + limit with. """ value: Required[int] diff --git a/src/increase/types/pending_transaction.py b/src/increase/types/pending_transaction.py index a38d3f045..40ba311e2 100644 --- a/src/increase/types/pending_transaction.py +++ b/src/increase/types/pending_transaction.py @@ -115,7 +115,13 @@ class SourceCardAuthorizationNetworkDetailsVisa(BaseModel): class SourceCardAuthorizationNetworkDetails(BaseModel): - visa: SourceCardAuthorizationNetworkDetailsVisa + category: Literal["visa"] + """The payment network used to process this card authorization + + - `visa` - Visa + """ + + visa: Optional[SourceCardAuthorizationNetworkDetailsVisa] """Fields specific to the `visa` network""" @@ -175,12 +181,6 @@ class SourceCardAuthorization(BaseModel): merchant_descriptor: str """The merchant descriptor of the merchant the card is transacting with.""" - network: Literal["visa"] - """The payment network used to process this card authorization - - - `visa` - Visa - """ - network_details: SourceCardAuthorizationNetworkDetails """Fields specific to the `network`""" diff --git a/src/increase/types/real_time_decision.py b/src/increase/types/real_time_decision.py index a13cb4669..e1b9d9ce9 100644 --- a/src/increase/types/real_time_decision.py +++ b/src/increase/types/real_time_decision.py @@ -12,6 +12,8 @@ "CardAuthorization", "CardAuthorizationNetworkDetails", "CardAuthorizationNetworkDetailsVisa", + "CardAuthorizationRequestDetails", + "CardAuthorizationRequestDetailsIncrementalAuthorization", "DigitalWalletAuthentication", "DigitalWalletToken", ] @@ -74,10 +76,45 @@ class CardAuthorizationNetworkDetailsVisa(BaseModel): class CardAuthorizationNetworkDetails(BaseModel): - visa: CardAuthorizationNetworkDetailsVisa + category: Literal["visa"] + """The payment network used to process this card authorization + + - `visa` - Visa + """ + + visa: Optional[CardAuthorizationNetworkDetailsVisa] """Fields specific to the `visa` network""" +class CardAuthorizationRequestDetailsIncrementalAuthorization(BaseModel): + card_payment_id: str + """The card payment for this authorization and increment.""" + + original_card_authorization_id: str + """ + The identifier of the card authorization this request is attempting to + increment. + """ + + +class CardAuthorizationRequestDetails(BaseModel): + category: Literal["initial_authorization", "incremental_authorization"] + """ + The type of this request (e.g., an initial authorization or an incremental + authorization.) + + - `initial_authorization` - A regular, standalone authorization. + - `incremental_authorization` - An incremental request to increase the amount of + an existing authorization. + """ + + incremental_authorization: Optional[CardAuthorizationRequestDetailsIncrementalAuthorization] + """Fields specific to the categorty `incremental_authorization`.""" + + initial_authorization: Optional[object] + """Fields specific to the category `initial_authorization`.""" + + class CardAuthorization(BaseModel): account_id: str """The identifier of the Account the authorization will debit.""" @@ -113,12 +150,6 @@ class CardAuthorization(BaseModel): merchant_descriptor: str """The merchant descriptor of the merchant the card is transacting with.""" - network: Literal["visa"] - """The payment network used to process this card authorization - - - `visa` - Visa - """ - network_details: CardAuthorizationNetworkDetails """Fields specific to the `network`""" @@ -141,6 +172,9 @@ class CardAuthorization(BaseModel): user sees at the time of purchase. """ + request_details: CardAuthorizationRequestDetails + """Fields specific to the type of request, such as an incremental authorization.""" + settlement_amount: int """The amount of the attempted authorization in the currency it will be settled in. diff --git a/src/increase/types/shared/point_of_service_entry_mode.py b/src/increase/types/shared/point_of_service_entry_mode.py index d8673f3ce..072c55e55 100644 --- a/src/increase/types/shared/point_of_service_entry_mode.py +++ b/src/increase/types/shared/point_of_service_entry_mode.py @@ -7,6 +7,7 @@ PointOfServiceEntryMode = Optional[ Literal[ + "unknown", "manual", "magnetic_stripe_no_cvv", "optical_code", diff --git a/src/increase/types/shared_params/point_of_service_entry_mode.py b/src/increase/types/shared_params/point_of_service_entry_mode.py index 006a26757..e8155c1a1 100644 --- a/src/increase/types/shared_params/point_of_service_entry_mode.py +++ b/src/increase/types/shared_params/point_of_service_entry_mode.py @@ -9,6 +9,7 @@ PointOfServiceEntryMode = Optional[ Literal[ + "unknown", "manual", "magnetic_stripe_no_cvv", "optical_code", diff --git a/src/increase/types/simulations/ach_transfer_simulation.py b/src/increase/types/simulations/ach_transfer_simulation.py index ce33e51db..478b5293f 100644 --- a/src/increase/types/simulations/ach_transfer_simulation.py +++ b/src/increase/types/simulations/ach_transfer_simulation.py @@ -78,6 +78,7 @@ class DeclinedTransactionSourceACHDecline(BaseModel): "group_locked", "insufficient_funds", "misrouted_return", + "return_of_erroneous_or_reversing_debit", "no_ach_route", "originator_request", "transaction_not_allowed", @@ -93,6 +94,7 @@ class DeclinedTransactionSourceACHDecline(BaseModel): - `group_locked` - Your account is inactive. - `insufficient_funds` - Your account contains insufficient funds. - `misrouted_return` - Other. + - `return_of_erroneous_or_reversing_debit` - Other. - `no_ach_route` - The account number that was debited does not exist. - `originator_request` - Other. - `transaction_not_allowed` - The transaction is not allowed per Increase's @@ -163,7 +165,13 @@ class DeclinedTransactionSourceCardDeclineNetworkDetailsVisa(BaseModel): class DeclinedTransactionSourceCardDeclineNetworkDetails(BaseModel): - visa: DeclinedTransactionSourceCardDeclineNetworkDetailsVisa + category: Literal["visa"] + """The payment network used to process this card authorization + + - `visa` - Visa + """ + + visa: Optional[DeclinedTransactionSourceCardDeclineNetworkDetailsVisa] """Fields specific to the `visa` network""" @@ -217,12 +225,6 @@ class DeclinedTransactionSourceCardDecline(BaseModel): merchant_state: Optional[str] """The state the merchant resides in.""" - network: Literal["visa"] - """The payment network used to process this card authorization - - - `visa` - Visa - """ - network_details: DeclinedTransactionSourceCardDeclineNetworkDetails """Fields specific to the `network`""" @@ -1344,6 +1346,9 @@ class TransactionSourceFeePayment(BaseModel): - `USD` - US Dollar (USD) """ + fee_period_start: date + """The start of this payment's fee period, usually the first day of a month.""" + class TransactionSourceInboundACHTransfer(BaseModel): amount: int diff --git a/src/increase/types/simulations/card_authorization_simulation.py b/src/increase/types/simulations/card_authorization_simulation.py index ca1779ac2..361abc0ec 100644 --- a/src/increase/types/simulations/card_authorization_simulation.py +++ b/src/increase/types/simulations/card_authorization_simulation.py @@ -59,6 +59,7 @@ class DeclinedTransactionSourceACHDecline(BaseModel): "group_locked", "insufficient_funds", "misrouted_return", + "return_of_erroneous_or_reversing_debit", "no_ach_route", "originator_request", "transaction_not_allowed", @@ -74,6 +75,7 @@ class DeclinedTransactionSourceACHDecline(BaseModel): - `group_locked` - Your account is inactive. - `insufficient_funds` - Your account contains insufficient funds. - `misrouted_return` - Other. + - `return_of_erroneous_or_reversing_debit` - Other. - `no_ach_route` - The account number that was debited does not exist. - `originator_request` - Other. - `transaction_not_allowed` - The transaction is not allowed per Increase's @@ -144,7 +146,13 @@ class DeclinedTransactionSourceCardDeclineNetworkDetailsVisa(BaseModel): class DeclinedTransactionSourceCardDeclineNetworkDetails(BaseModel): - visa: DeclinedTransactionSourceCardDeclineNetworkDetailsVisa + category: Literal["visa"] + """The payment network used to process this card authorization + + - `visa` - Visa + """ + + visa: Optional[DeclinedTransactionSourceCardDeclineNetworkDetailsVisa] """Fields specific to the `visa` network""" @@ -198,12 +206,6 @@ class DeclinedTransactionSourceCardDecline(BaseModel): merchant_state: Optional[str] """The state the merchant resides in.""" - network: Literal["visa"] - """The payment network used to process this card authorization - - - `visa` - Visa - """ - network_details: DeclinedTransactionSourceCardDeclineNetworkDetails """Fields specific to the `network`""" @@ -733,7 +735,13 @@ class PendingTransactionSourceCardAuthorizationNetworkDetailsVisa(BaseModel): class PendingTransactionSourceCardAuthorizationNetworkDetails(BaseModel): - visa: PendingTransactionSourceCardAuthorizationNetworkDetailsVisa + category: Literal["visa"] + """The payment network used to process this card authorization + + - `visa` - Visa + """ + + visa: Optional[PendingTransactionSourceCardAuthorizationNetworkDetailsVisa] """Fields specific to the `visa` network""" @@ -793,12 +801,6 @@ class PendingTransactionSourceCardAuthorization(BaseModel): merchant_descriptor: str """The merchant descriptor of the merchant the card is transacting with.""" - network: Literal["visa"] - """The payment network used to process this card authorization - - - `visa` - Visa - """ - network_details: PendingTransactionSourceCardAuthorizationNetworkDetails """Fields specific to the `network`""" diff --git a/src/increase/types/simulations/inbound_real_time_payments_transfer_simulation_result.py b/src/increase/types/simulations/inbound_real_time_payments_transfer_simulation_result.py index 1b2d38f65..845a84c96 100644 --- a/src/increase/types/simulations/inbound_real_time_payments_transfer_simulation_result.py +++ b/src/increase/types/simulations/inbound_real_time_payments_transfer_simulation_result.py @@ -78,6 +78,7 @@ class DeclinedTransactionSourceACHDecline(BaseModel): "group_locked", "insufficient_funds", "misrouted_return", + "return_of_erroneous_or_reversing_debit", "no_ach_route", "originator_request", "transaction_not_allowed", @@ -93,6 +94,7 @@ class DeclinedTransactionSourceACHDecline(BaseModel): - `group_locked` - Your account is inactive. - `insufficient_funds` - Your account contains insufficient funds. - `misrouted_return` - Other. + - `return_of_erroneous_or_reversing_debit` - Other. - `no_ach_route` - The account number that was debited does not exist. - `originator_request` - Other. - `transaction_not_allowed` - The transaction is not allowed per Increase's @@ -163,7 +165,13 @@ class DeclinedTransactionSourceCardDeclineNetworkDetailsVisa(BaseModel): class DeclinedTransactionSourceCardDeclineNetworkDetails(BaseModel): - visa: DeclinedTransactionSourceCardDeclineNetworkDetailsVisa + category: Literal["visa"] + """The payment network used to process this card authorization + + - `visa` - Visa + """ + + visa: Optional[DeclinedTransactionSourceCardDeclineNetworkDetailsVisa] """Fields specific to the `visa` network""" @@ -217,12 +225,6 @@ class DeclinedTransactionSourceCardDecline(BaseModel): merchant_state: Optional[str] """The state the merchant resides in.""" - network: Literal["visa"] - """The payment network used to process this card authorization - - - `visa` - Visa - """ - network_details: DeclinedTransactionSourceCardDeclineNetworkDetails """Fields specific to the `network`""" @@ -1344,6 +1346,9 @@ class TransactionSourceFeePayment(BaseModel): - `USD` - US Dollar (USD) """ + fee_period_start: date + """The start of this payment's fee period, usually the first day of a month.""" + class TransactionSourceInboundACHTransfer(BaseModel): amount: int diff --git a/src/increase/types/simulations/interest_payment_simulation_result.py b/src/increase/types/simulations/interest_payment_simulation_result.py index 1941b0070..0a16082ea 100644 --- a/src/increase/types/simulations/interest_payment_simulation_result.py +++ b/src/increase/types/simulations/interest_payment_simulation_result.py @@ -726,6 +726,9 @@ class TransactionSourceFeePayment(BaseModel): - `USD` - US Dollar (USD) """ + fee_period_start: date + """The start of this payment's fee period, usually the first day of a month.""" + class TransactionSourceInboundACHTransfer(BaseModel): amount: int diff --git a/src/increase/types/simulations/wire_transfer_simulation.py b/src/increase/types/simulations/wire_transfer_simulation.py index 885954879..df1169dd7 100644 --- a/src/increase/types/simulations/wire_transfer_simulation.py +++ b/src/increase/types/simulations/wire_transfer_simulation.py @@ -726,6 +726,9 @@ class TransactionSourceFeePayment(BaseModel): - `USD` - US Dollar (USD) """ + fee_period_start: date + """The start of this payment's fee period, usually the first day of a month.""" + class TransactionSourceInboundACHTransfer(BaseModel): amount: int diff --git a/src/increase/types/transaction.py b/src/increase/types/transaction.py index 0f22055eb..222d431c7 100644 --- a/src/increase/types/transaction.py +++ b/src/increase/types/transaction.py @@ -725,6 +725,9 @@ class SourceFeePayment(BaseModel): - `USD` - US Dollar (USD) """ + fee_period_start: date + """The start of this payment's fee period, usually the first day of a month.""" + class SourceInboundACHTransfer(BaseModel): amount: int diff --git a/tests/api_resources/test_check_transfers.py b/tests/api_resources/test_check_transfers.py index 6b9273bbc..f92959197 100644 --- a/tests/api_resources/test_check_transfers.py +++ b/tests/api_resources/test_check_transfers.py @@ -25,13 +25,7 @@ class TestCheckTransfers: def test_method_create(self, client: Increase) -> None: check_transfer = client.check_transfers.create( account_id="string", - address_city="x", - address_line1="x", - address_state="x", - address_zip="x", amount=1, - message="x", - recipient_name="x", ) assert_matches_type(CheckTransfer, check_transfer, path=["response"]) @@ -39,24 +33,30 @@ def test_method_create(self, client: Increase) -> None: def test_method_create_with_all_params(self, client: Increase) -> None: check_transfer = client.check_transfers.create( account_id="string", - address_city="x", - address_line1="x", - address_state="x", - address_zip="x", amount=1, - message="x", - recipient_name="x", - address_line2="x", - note="x", - require_approval=True, - return_address={ - "name": "x", - "line1": "x", - "line2": "x", - "city": "x", - "state": "x", - "zip": "x", + fulfillment_method="physical_check", + physical_check={ + "memo": "x", + "note": "x", + "recipient_name": "x", + "mailing_address": { + "name": "x", + "line1": "x", + "line2": "x", + "city": "x", + "state": "x", + "postal_code": "x", + }, + "return_address": { + "name": "x", + "line1": "x", + "line2": "x", + "city": "x", + "state": "x", + "postal_code": "x", + }, }, + require_approval=True, source_account_number_id="string", unique_identifier="x", ) @@ -131,13 +131,7 @@ class TestAsyncCheckTransfers: async def test_method_create(self, client: AsyncIncrease) -> None: check_transfer = await client.check_transfers.create( account_id="string", - address_city="x", - address_line1="x", - address_state="x", - address_zip="x", amount=1, - message="x", - recipient_name="x", ) assert_matches_type(CheckTransfer, check_transfer, path=["response"]) @@ -145,24 +139,30 @@ async def test_method_create(self, client: AsyncIncrease) -> None: async def test_method_create_with_all_params(self, client: AsyncIncrease) -> None: check_transfer = await client.check_transfers.create( account_id="string", - address_city="x", - address_line1="x", - address_state="x", - address_zip="x", amount=1, - message="x", - recipient_name="x", - address_line2="x", - note="x", - require_approval=True, - return_address={ - "name": "x", - "line1": "x", - "line2": "x", - "city": "x", - "state": "x", - "zip": "x", + fulfillment_method="physical_check", + physical_check={ + "memo": "x", + "note": "x", + "recipient_name": "x", + "mailing_address": { + "name": "x", + "line1": "x", + "line2": "x", + "city": "x", + "state": "x", + "postal_code": "x", + }, + "return_address": { + "name": "x", + "line1": "x", + "line2": "x", + "city": "x", + "state": "x", + "postal_code": "x", + }, }, + require_approval=True, source_account_number_id="string", unique_identifier="x", )