From 8e4504073bb7e32e07247a304f8ef2e2dbca0506 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 19:20:28 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 +- src/increase/types/card_payment.py | 39 ++++---- src/increase/types/declined_transaction.py | 13 +-- src/increase/types/pending_transaction.py | 13 +-- src/increase/types/real_time_decision.py | 25 ++++-- .../types/real_time_decision_action_params.py | 90 +++++++++++++++++++ .../api_resources/test_real_time_decisions.py | 14 +++ 7 files changed, 160 insertions(+), 38 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0ece17005..cb9d34e48 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 217 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-387c9e5ff5305d470ddf290a424b9d0f087fa295b56cf82265f2dfe8355a589a.yml -openapi_spec_hash: 2c624b8535be90329028f6b10281a313 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-10d8a2e25ff71893e14a81477ef7dbbf761af689e6ff074e13da10729a75cc9d.yml +openapi_spec_hash: 77a4f7c4b166e73a84c3b7f4e177631c config_hash: e1885b38eded054b77308a024c5d80cc diff --git a/src/increase/types/card_payment.py b/src/increase/types/card_payment.py index 72e58564f..2ce2d50ad 100644 --- a/src/increase/types/card_payment.py +++ b/src/increase/types/card_payment.py @@ -582,23 +582,24 @@ class ElementCardAuthorizationVerificationCardholderAddress(BaseModel): result: Literal[ "not_checked", - "postal_code_match_address_not_checked", "postal_code_match_address_no_match", "postal_code_no_match_address_match", "match", "no_match", + "postal_code_match_address_not_checked", ] """The address verification result returned to the card network. - - `not_checked` - No address was provided in the authorization request. - - `postal_code_match_address_not_checked` - Postal code matches, but the street - address was not verified. + - `not_checked` - No address information was provided in the authorization + request. - `postal_code_match_address_no_match` - Postal code matches, but the street - address does not match. + address does not match or was not provided. - `postal_code_no_match_address_match` - Postal code does not match, but the - street address matches. + street address matches or was not provided. - `match` - Postal code and street address match. - `no_match` - Postal code and street address do not match. + - `postal_code_match_address_not_checked` - Postal code matches, but the street + address was not verified. (deprecated) """ @@ -1149,23 +1150,24 @@ class ElementCardDeclineVerificationCardholderAddress(BaseModel): result: Literal[ "not_checked", - "postal_code_match_address_not_checked", "postal_code_match_address_no_match", "postal_code_no_match_address_match", "match", "no_match", + "postal_code_match_address_not_checked", ] """The address verification result returned to the card network. - - `not_checked` - No address was provided in the authorization request. - - `postal_code_match_address_not_checked` - Postal code matches, but the street - address was not verified. + - `not_checked` - No address information was provided in the authorization + request. - `postal_code_match_address_no_match` - Postal code matches, but the street - address does not match. + address does not match or was not provided. - `postal_code_no_match_address_match` - Postal code does not match, but the - street address matches. + street address matches or was not provided. - `match` - Postal code and street address match. - `no_match` - Postal code and street address do not match. + - `postal_code_match_address_not_checked` - Postal code matches, but the street + address was not verified. (deprecated) """ @@ -3342,23 +3344,24 @@ class ElementCardValidationVerificationCardholderAddress(BaseModel): result: Literal[ "not_checked", - "postal_code_match_address_not_checked", "postal_code_match_address_no_match", "postal_code_no_match_address_match", "match", "no_match", + "postal_code_match_address_not_checked", ] """The address verification result returned to the card network. - - `not_checked` - No address was provided in the authorization request. - - `postal_code_match_address_not_checked` - Postal code matches, but the street - address was not verified. + - `not_checked` - No address information was provided in the authorization + request. - `postal_code_match_address_no_match` - Postal code matches, but the street - address does not match. + address does not match or was not provided. - `postal_code_no_match_address_match` - Postal code does not match, but the - street address matches. + street address matches or was not provided. - `match` - Postal code and street address match. - `no_match` - Postal code and street address do not match. + - `postal_code_match_address_not_checked` - Postal code matches, but the street + address was not verified. (deprecated) """ diff --git a/src/increase/types/declined_transaction.py b/src/increase/types/declined_transaction.py index d95e08302..07d2c2539 100644 --- a/src/increase/types/declined_transaction.py +++ b/src/increase/types/declined_transaction.py @@ -430,23 +430,24 @@ class SourceCardDeclineVerificationCardholderAddress(BaseModel): result: Literal[ "not_checked", - "postal_code_match_address_not_checked", "postal_code_match_address_no_match", "postal_code_no_match_address_match", "match", "no_match", + "postal_code_match_address_not_checked", ] """The address verification result returned to the card network. - - `not_checked` - No address was provided in the authorization request. - - `postal_code_match_address_not_checked` - Postal code matches, but the street - address was not verified. + - `not_checked` - No address information was provided in the authorization + request. - `postal_code_match_address_no_match` - Postal code matches, but the street - address does not match. + address does not match or was not provided. - `postal_code_no_match_address_match` - Postal code does not match, but the - street address matches. + street address matches or was not provided. - `match` - Postal code and street address match. - `no_match` - Postal code and street address do not match. + - `postal_code_match_address_not_checked` - Postal code matches, but the street + address was not verified. (deprecated) """ diff --git a/src/increase/types/pending_transaction.py b/src/increase/types/pending_transaction.py index 1204107e8..4b2bc6a96 100644 --- a/src/increase/types/pending_transaction.py +++ b/src/increase/types/pending_transaction.py @@ -380,23 +380,24 @@ class SourceCardAuthorizationVerificationCardholderAddress(BaseModel): result: Literal[ "not_checked", - "postal_code_match_address_not_checked", "postal_code_match_address_no_match", "postal_code_no_match_address_match", "match", "no_match", + "postal_code_match_address_not_checked", ] """The address verification result returned to the card network. - - `not_checked` - No address was provided in the authorization request. - - `postal_code_match_address_not_checked` - Postal code matches, but the street - address was not verified. + - `not_checked` - No address information was provided in the authorization + request. - `postal_code_match_address_no_match` - Postal code matches, but the street - address does not match. + address does not match or was not provided. - `postal_code_no_match_address_match` - Postal code does not match, but the - street address matches. + street address matches or was not provided. - `match` - Postal code and street address match. - `no_match` - Postal code and street address do not match. + - `postal_code_match_address_not_checked` - Postal code matches, but the street + address was not verified. (deprecated) """ diff --git a/src/increase/types/real_time_decision.py b/src/increase/types/real_time_decision.py index 19b4f1d34..1f73b1556 100644 --- a/src/increase/types/real_time_decision.py +++ b/src/increase/types/real_time_decision.py @@ -21,6 +21,7 @@ "CardAuthorizationAdditionalAmountsTransit", "CardAuthorizationAdditionalAmountsUnknown", "CardAuthorizationAdditionalAmountsVision", + "CardAuthorizationDecline", "CardAuthorizationNetworkDetails", "CardAuthorizationNetworkDetailsVisa", "CardAuthorizationNetworkIdentifiers", @@ -214,6 +215,11 @@ class CardAuthorizationAdditionalAmounts(BaseModel): """The part of this transaction amount that was for vision-related services.""" +class CardAuthorizationDecline(BaseModel): + reason: str + """The reason the authorization was declined.""" + + class CardAuthorizationNetworkDetailsVisa(BaseModel): electronic_commerce_indicator: Optional[ Literal[ @@ -422,23 +428,24 @@ class CardAuthorizationVerificationCardholderAddress(BaseModel): result: Literal[ "not_checked", - "postal_code_match_address_not_checked", "postal_code_match_address_no_match", "postal_code_no_match_address_match", "match", "no_match", + "postal_code_match_address_not_checked", ] """The address verification result returned to the card network. - - `not_checked` - No address was provided in the authorization request. - - `postal_code_match_address_not_checked` - Postal code matches, but the street - address was not verified. + - `not_checked` - No address information was provided in the authorization + request. - `postal_code_match_address_no_match` - Postal code matches, but the street - address does not match. + address does not match or was not provided. - `postal_code_no_match_address_match` - Postal code does not match, but the - street address matches. + street address matches or was not provided. - `match` - Postal code and street address match. - `no_match` - Postal code and street address do not match. + - `postal_code_match_address_not_checked` - Postal code matches, but the street + address was not verified. (deprecated) """ @@ -477,6 +484,12 @@ class CardAuthorization(BaseModel): - `decline` - Decline the authorization. """ + decline: Optional[CardAuthorizationDecline] = None + """Present if and only if `decision` is `decline`. + + Contains information related to the reason the authorization was declined. + """ + digital_wallet_token_id: Optional[str] = None """ If the authorization was made via a Digital Wallet Token (such as an Apple Pay diff --git a/src/increase/types/real_time_decision_action_params.py b/src/increase/types/real_time_decision_action_params.py index 832f8d253..c237c1b8f 100644 --- a/src/increase/types/real_time_decision_action_params.py +++ b/src/increase/types/real_time_decision_action_params.py @@ -9,6 +9,9 @@ "CardAuthentication", "CardAuthenticationChallenge", "CardAuthorization", + "CardAuthorizationApproval", + "CardAuthorizationApprovalCardholderAddressVerificationResult", + "CardAuthorizationDecline", "DigitalWalletAuthentication", "DigitalWalletAuthenticationSuccess", "DigitalWalletToken", @@ -73,6 +76,73 @@ class CardAuthenticationChallenge(TypedDict, total=False): """ +class CardAuthorizationApprovalCardholderAddressVerificationResult(TypedDict, total=False): + line1: Required[Literal["match", "no_match"]] + """Your decision on the address line of the provided address. + + - `match` - The cardholder address verification result matches the address + provided by the merchant. + - `no_match` - The cardholder address verification result does not match the + address provided by the merchant. + """ + + postal_code: Required[Literal["match", "no_match"]] + """Your decision on the postal code of the provided address. + + - `match` - The cardholder address verification result matches the address + provided by the merchant. + - `no_match` - The cardholder address verification result does not match the + address provided by the merchant. + """ + + +class CardAuthorizationApproval(TypedDict, total=False): + cardholder_address_verification_result: CardAuthorizationApprovalCardholderAddressVerificationResult + """Your decisions on whether or not each provided address component is a match. + + Your response here is evaluated against the customer's provided `postal_code` + and `line1`, and an appropriate network response is generated. For example, if + you would like to approve all transactions for a given card, you can submit + `match` for both `postal_code` and `line1` and Increase will generate an + approval with an Address Verification System (AVS) code that will match all of + the available address information, or will report that no check was performed if + no address information is available. If you do not provide a response, the + address verification result will be calculated by Increase using the available + address information available on the card. If none is available, Increase will + report that no check was performed. + """ + + +class CardAuthorizationDecline(TypedDict, total=False): + reason: Required[ + Literal[ + "insufficient_funds", + "transaction_never_allowed", + "exceeds_approval_limit", + "card_temporarily_disabled", + "suspected_fraud", + "other", + ] + ] + """The reason the card authorization was declined. + + This translates to a specific decline code that is sent to the card network. + + - `insufficient_funds` - The cardholder does not have sufficient funds to cover + the transaction. The merchant may attempt to process the transaction again. + - `transaction_never_allowed` - This type of transaction is not allowed for this + card. This transaction should not be retried. + - `exceeds_approval_limit` - The transaction amount exceeds the cardholder's + approval limit. The merchant may attempt to process the transaction again. + - `card_temporarily_disabled` - The card has been temporarily disabled or not + yet activated. The merchant may attempt to process the transaction again. + - `suspected_fraud` - The transaction is suspected to be fraudulent. The + merchant may attempt to process the transaction again. + - `other` - The transaction was declined for another reason. The merchant may + attempt to process the transaction again. This should be used sparingly. + """ + + class CardAuthorization(TypedDict, total=False): decision: Required[Literal["approve", "decline"]] """Whether the card authorization should be approved or declined. @@ -81,6 +151,20 @@ class CardAuthorization(TypedDict, total=False): - `decline` - Decline the authorization. """ + approval: CardAuthorizationApproval + """ + If your application approves the authorization, this contains metadata about + your decision to approve. Your response here is advisory to the acquiring bank. + The bank may choose to reverse the authorization if you approve the transaction + but indicate the address does not match. + """ + + decline: CardAuthorizationDecline + """ + If your application declines the authorization, this contains details about the + decline. + """ + decline_reason: Literal[ "insufficient_funds", "transaction_never_allowed", @@ -92,6 +176,8 @@ class CardAuthorization(TypedDict, total=False): """The reason the card authorization was declined. This translates to a specific decline code that is sent to the card network. + This field is deprecated, please transition to using the `decline` object as + this field will be removed in a future release. - `insufficient_funds` - The cardholder does not have sufficient funds to cover the transaction. The merchant may attempt to process the transaction again. @@ -130,6 +216,10 @@ class DigitalWalletAuthentication(TypedDict, total=False): """ success: DigitalWalletAuthenticationSuccess + """ + If your application was able to deliver the one-time passcode, this contains + metadata about the delivery. Exactly one of `phone` or `email` must be provided. + """ class DigitalWalletTokenApproval(TypedDict, total=False): diff --git a/tests/api_resources/test_real_time_decisions.py b/tests/api_resources/test_real_time_decisions.py index 1cbb666be..90365816b 100644 --- a/tests/api_resources/test_real_time_decisions.py +++ b/tests/api_resources/test_real_time_decisions.py @@ -70,6 +70,13 @@ def test_method_action_with_all_params(self, client: Increase) -> None: card_authentication_challenge={"result": "success"}, card_authorization={ "decision": "approve", + "approval": { + "cardholder_address_verification_result": { + "line1": "match", + "postal_code": "no_match", + } + }, + "decline": {"reason": "insufficient_funds"}, "decline_reason": "insufficient_funds", }, digital_wallet_authentication={ @@ -179,6 +186,13 @@ async def test_method_action_with_all_params(self, async_client: AsyncIncrease) card_authentication_challenge={"result": "success"}, card_authorization={ "decision": "approve", + "approval": { + "cardholder_address_verification_result": { + "line1": "match", + "postal_code": "no_match", + } + }, + "decline": {"reason": "insufficient_funds"}, "decline_reason": "insufficient_funds", }, digital_wallet_authentication={ From 63f4edc9f494fb831e20777ca5a287f3c7bef29b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 19:20:50 +0000 Subject: [PATCH 2/2] release: 0.323.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/increase/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4942d18ad..eb7cbd88c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.322.0" + ".": "0.323.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ef012bc5..2c85c9076 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.323.0 (2025-09-09) + +Full Changelog: [v0.322.0...v0.323.0](https://github.com/Increase/increase-python/compare/v0.322.0...v0.323.0) + +### Features + +* **api:** api update ([8e45040](https://github.com/Increase/increase-python/commit/8e4504073bb7e32e07247a304f8ef2e2dbca0506)) + ## 0.322.0 (2025-09-08) Full Changelog: [v0.321.0...v0.322.0](https://github.com/Increase/increase-python/compare/v0.321.0...v0.322.0) diff --git a/pyproject.toml b/pyproject.toml index d5d79156c..2e3370f09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "increase" -version = "0.322.0" +version = "0.323.0" description = "The official Python library for the increase API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/increase/_version.py b/src/increase/_version.py index 540af3028..260e926a6 100644 --- a/src/increase/_version.py +++ b/src/increase/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "increase" -__version__ = "0.322.0" # x-release-please-version +__version__ = "0.323.0" # x-release-please-version