From ba6598ecc9266832661b19a56c49b2b040316916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Fri, 24 Oct 2025 19:49:29 +0300 Subject: [PATCH 01/11] Annotate braintree's Subscription.find() and Transaction.find() --- stubs/braintree/braintree/subscription.pyi | 2 +- stubs/braintree/braintree/transaction.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/braintree/braintree/subscription.pyi b/stubs/braintree/braintree/subscription.pyi index 98acf134f39d..9ecef70e4c2c 100644 --- a/stubs/braintree/braintree/subscription.pyi +++ b/stubs/braintree/braintree/subscription.pyi @@ -31,7 +31,7 @@ class Subscription(Resource): @staticmethod def create_signature(): ... @staticmethod - def find(subscription_id): ... + def find(subscription_id: str) -> Subscription: ... @staticmethod def retry_charge(subscription_id, amount=None, submit_for_settlement: bool = False): ... @staticmethod diff --git a/stubs/braintree/braintree/transaction.pyi b/stubs/braintree/braintree/transaction.pyi index 6aebd7369799..0743d463bddc 100644 --- a/stubs/braintree/braintree/transaction.pyi +++ b/stubs/braintree/braintree/transaction.pyi @@ -102,7 +102,7 @@ class Transaction(Resource): @staticmethod def credit(params=None): ... @staticmethod - def find(transaction_id): ... + def find(transaction_id: str) -> Transaction: ... @staticmethod def refund(transaction_id, amount_or_options=None): ... @staticmethod From 1b25a5030e5502d28e56ae7b664beb6af0d280b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Sat, 25 Oct 2025 17:18:51 +0300 Subject: [PATCH 02/11] Annotate SubscriptionGateway.find() and TransactionGateway.find() --- stubs/braintree/braintree/subscription_gateway.pyi | 4 +++- stubs/braintree/braintree/transaction_gateway.pyi | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/stubs/braintree/braintree/subscription_gateway.pyi b/stubs/braintree/braintree/subscription_gateway.pyi index 37dfbae24b93..d1b2ea75bbbe 100644 --- a/stubs/braintree/braintree/subscription_gateway.pyi +++ b/stubs/braintree/braintree/subscription_gateway.pyi @@ -1,12 +1,14 @@ from _typeshed import Incomplete +from braintree.subscription import Subscription + class SubscriptionGateway: gateway: Incomplete config: Incomplete def __init__(self, gateway) -> None: ... def cancel(self, subscription_id): ... def create(self, params=None): ... - def find(self, subscription_id): ... + def find(self, subscription_id: str) -> Subscription: ... def retry_charge(self, subscription_id, amount=None, submit_for_settlement: bool = False): ... def search(self, *query): ... def update(self, subscription_id, params=None): ... diff --git a/stubs/braintree/braintree/transaction_gateway.pyi b/stubs/braintree/braintree/transaction_gateway.pyi index a6ad5f3f6c97..ca476a4bb63c 100644 --- a/stubs/braintree/braintree/transaction_gateway.pyi +++ b/stubs/braintree/braintree/transaction_gateway.pyi @@ -1,5 +1,7 @@ from _typeshed import Incomplete +from braintree.transaction import Transaction + class TransactionGateway: gateway: Incomplete config: Incomplete @@ -9,7 +11,7 @@ class TransactionGateway: def cancel_release(self, transaction_id): ... def create(self, params): ... def credit(self, params): ... - def find(self, transaction_id): ... + def find(self, transaction_id: str) -> Transaction: ... def refund(self, transaction_id, amount_or_options=None): ... def sale(self, params): ... def search(self, *query): ... From 56bdb326a41aef0e56fed8a32e2f0bdd7e91bfc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 27 Oct 2025 15:42:13 +0200 Subject: [PATCH 03/11] Annotate Subscription.create() and SubscriptionGateway.create() --- stubs/braintree/braintree/subscription.pyi | 4 +++- stubs/braintree/braintree/subscription_gateway.pyi | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/stubs/braintree/braintree/subscription.pyi b/stubs/braintree/braintree/subscription.pyi index 9ecef70e4c2c..02781de7c45a 100644 --- a/stubs/braintree/braintree/subscription.pyi +++ b/stubs/braintree/braintree/subscription.pyi @@ -5,8 +5,10 @@ from typing import Final from braintree.add_on import AddOn from braintree.descriptor import Descriptor from braintree.discount import Discount +from braintree.error_result import ErrorResult from braintree.resource import Resource from braintree.subscription_status_event import SubscriptionStatusEvent +from braintree.successful_result import SuccessfulResult from braintree.transaction import Transaction class Subscription(Resource): @@ -27,7 +29,7 @@ class Subscription(Resource): Pending: Final = "Pending" @staticmethod - def create(params=None): ... + def create(params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ... @staticmethod def create_signature(): ... @staticmethod diff --git a/stubs/braintree/braintree/subscription_gateway.pyi b/stubs/braintree/braintree/subscription_gateway.pyi index d1b2ea75bbbe..d74fb463264e 100644 --- a/stubs/braintree/braintree/subscription_gateway.pyi +++ b/stubs/braintree/braintree/subscription_gateway.pyi @@ -1,13 +1,15 @@ from _typeshed import Incomplete +from braintree.error_result import ErrorResult from braintree.subscription import Subscription +from braintree.successful_result import SuccessfulResult class SubscriptionGateway: gateway: Incomplete config: Incomplete def __init__(self, gateway) -> None: ... def cancel(self, subscription_id): ... - def create(self, params=None): ... + def create(self, params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ... def find(self, subscription_id: str) -> Subscription: ... def retry_charge(self, subscription_id, amount=None, submit_for_settlement: bool = False): ... def search(self, *query): ... From adb70d7248d70237e9d67ca64ce3196d29992e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 27 Oct 2025 15:46:00 +0200 Subject: [PATCH 04/11] Annotate Subscription.update() and SubscriptionGateway.update() --- stubs/braintree/braintree/subscription.pyi | 2 +- stubs/braintree/braintree/subscription_gateway.pyi | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/stubs/braintree/braintree/subscription.pyi b/stubs/braintree/braintree/subscription.pyi index 02781de7c45a..2df462a1e244 100644 --- a/stubs/braintree/braintree/subscription.pyi +++ b/stubs/braintree/braintree/subscription.pyi @@ -37,7 +37,7 @@ class Subscription(Resource): @staticmethod def retry_charge(subscription_id, amount=None, submit_for_settlement: bool = False): ... @staticmethod - def update(subscription_id, params=None): ... + def update(subscription_id: str, params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ... @staticmethod def cancel(subscription_id): ... @staticmethod diff --git a/stubs/braintree/braintree/subscription_gateway.pyi b/stubs/braintree/braintree/subscription_gateway.pyi index d74fb463264e..e426fa0e96dd 100644 --- a/stubs/braintree/braintree/subscription_gateway.pyi +++ b/stubs/braintree/braintree/subscription_gateway.pyi @@ -13,4 +13,6 @@ class SubscriptionGateway: def find(self, subscription_id: str) -> Subscription: ... def retry_charge(self, subscription_id, amount=None, submit_for_settlement: bool = False): ... def search(self, *query): ... - def update(self, subscription_id, params=None): ... + def update( + self, subscription_id: str, params: dict[str, Incomplete] | None = None + ) -> SuccessfulResult | ErrorResult | None: ... From 08e53487abf4be5e6464671efcccc639e2e43932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 27 Oct 2025 15:47:35 +0200 Subject: [PATCH 05/11] Annotate Subscription.cancel() and SubscriptionGateway.cancel() --- stubs/braintree/braintree/subscription.pyi | 2 +- stubs/braintree/braintree/subscription_gateway.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/braintree/braintree/subscription.pyi b/stubs/braintree/braintree/subscription.pyi index 2df462a1e244..f918ba2fe060 100644 --- a/stubs/braintree/braintree/subscription.pyi +++ b/stubs/braintree/braintree/subscription.pyi @@ -39,7 +39,7 @@ class Subscription(Resource): @staticmethod def update(subscription_id: str, params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ... @staticmethod - def cancel(subscription_id): ... + def cancel(subscription_id: str) -> SuccessfulResult | ErrorResult | None: ... @staticmethod def search(*query): ... @staticmethod diff --git a/stubs/braintree/braintree/subscription_gateway.pyi b/stubs/braintree/braintree/subscription_gateway.pyi index e426fa0e96dd..f14b5c7e4d16 100644 --- a/stubs/braintree/braintree/subscription_gateway.pyi +++ b/stubs/braintree/braintree/subscription_gateway.pyi @@ -8,7 +8,7 @@ class SubscriptionGateway: gateway: Incomplete config: Incomplete def __init__(self, gateway) -> None: ... - def cancel(self, subscription_id): ... + def cancel(self, subscription_id: str) -> SuccessfulResult | ErrorResult | None: ... def create(self, params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ... def find(self, subscription_id: str) -> Subscription: ... def retry_charge(self, subscription_id, amount=None, submit_for_settlement: bool = False): ... From 10a2188cd6830449981116dcc42c2ca8ba06d84a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 27 Oct 2025 16:09:56 +0200 Subject: [PATCH 06/11] Add Subscription.next_billing_date --- stubs/braintree/braintree/subscription.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stubs/braintree/braintree/subscription.pyi b/stubs/braintree/braintree/subscription.pyi index f918ba2fe060..f6a48b74197c 100644 --- a/stubs/braintree/braintree/subscription.pyi +++ b/stubs/braintree/braintree/subscription.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete +from datetime import date from decimal import Decimal from typing import Final @@ -46,6 +47,7 @@ class Subscription(Resource): def update_signature(): ... price: Decimal balance: Decimal + next_billing_date: date next_billing_period_amount: Decimal add_ons: list[AddOn] descriptor: Descriptor From 661647a937e151b57e37b3e6a40099d85dd6a8a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 27 Oct 2025 16:13:04 +0200 Subject: [PATCH 07/11] Annotate Transaction.search() --- stubs/braintree/braintree/transaction.pyi | 3 ++- stubs/braintree/braintree/transaction_gateway.pyi | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/stubs/braintree/braintree/transaction.pyi b/stubs/braintree/braintree/transaction.pyi index 0743d463bddc..875cace914db 100644 --- a/stubs/braintree/braintree/transaction.pyi +++ b/stubs/braintree/braintree/transaction.pyi @@ -26,6 +26,7 @@ from braintree.payment_facilitator import PaymentFacilitator from braintree.paypal_account import PayPalAccount from braintree.paypal_here import PayPalHere from braintree.resource import Resource +from braintree.resource_collection import ResourceCollection from braintree.risk_data import RiskData from braintree.samsung_pay_card import SamsungPayCard from braintree.sepa_direct_debit_account import SepaDirectDebitAccount @@ -108,7 +109,7 @@ class Transaction(Resource): @staticmethod def sale(params=None): ... @staticmethod - def search(*query): ... + def search(*query) -> ResourceCollection: ... @staticmethod def submit_for_settlement(transaction_id, amount=None, params=None): ... @staticmethod diff --git a/stubs/braintree/braintree/transaction_gateway.pyi b/stubs/braintree/braintree/transaction_gateway.pyi index ca476a4bb63c..c3bfc8880708 100644 --- a/stubs/braintree/braintree/transaction_gateway.pyi +++ b/stubs/braintree/braintree/transaction_gateway.pyi @@ -1,5 +1,6 @@ from _typeshed import Incomplete +from braintree.resource_collection import ResourceCollection from braintree.transaction import Transaction class TransactionGateway: @@ -14,7 +15,7 @@ class TransactionGateway: def find(self, transaction_id: str) -> Transaction: ... def refund(self, transaction_id, amount_or_options=None): ... def sale(self, params): ... - def search(self, *query): ... + def search(self, *query) -> ResourceCollection: ... def submit_for_settlement(self, transaction_id, amount=None, params=None): ... def update_details(self, transaction_id, params=None): ... def submit_for_partial_settlement(self, transaction_id, amount, params=None): ... From 20c9f4f409b3bec5bdf67a83479cbc6c15e0cfda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 27 Oct 2025 17:15:51 +0200 Subject: [PATCH 08/11] Annotate braintree's Subscription.search() --- stubs/braintree/braintree/subscription.pyi | 3 ++- stubs/braintree/braintree/subscription_gateway.pyi | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/stubs/braintree/braintree/subscription.pyi b/stubs/braintree/braintree/subscription.pyi index f6a48b74197c..24bb2a09a05c 100644 --- a/stubs/braintree/braintree/subscription.pyi +++ b/stubs/braintree/braintree/subscription.pyi @@ -8,6 +8,7 @@ from braintree.descriptor import Descriptor from braintree.discount import Discount from braintree.error_result import ErrorResult from braintree.resource import Resource +from braintree.resource_collection import ResourceCollection from braintree.subscription_status_event import SubscriptionStatusEvent from braintree.successful_result import SuccessfulResult from braintree.transaction import Transaction @@ -42,7 +43,7 @@ class Subscription(Resource): @staticmethod def cancel(subscription_id: str) -> SuccessfulResult | ErrorResult | None: ... @staticmethod - def search(*query): ... + def search(*query) -> ResourceCollection: ... @staticmethod def update_signature(): ... price: Decimal diff --git a/stubs/braintree/braintree/subscription_gateway.pyi b/stubs/braintree/braintree/subscription_gateway.pyi index f14b5c7e4d16..44907bce1d97 100644 --- a/stubs/braintree/braintree/subscription_gateway.pyi +++ b/stubs/braintree/braintree/subscription_gateway.pyi @@ -1,6 +1,7 @@ from _typeshed import Incomplete from braintree.error_result import ErrorResult +from braintree.resource_collection import ResourceCollection from braintree.subscription import Subscription from braintree.successful_result import SuccessfulResult @@ -12,7 +13,7 @@ class SubscriptionGateway: def create(self, params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ... def find(self, subscription_id: str) -> Subscription: ... def retry_charge(self, subscription_id, amount=None, submit_for_settlement: bool = False): ... - def search(self, *query): ... + def search(self, *query) -> ResourceCollection: ... def update( self, subscription_id: str, params: dict[str, Incomplete] | None = None ) -> SuccessfulResult | ErrorResult | None: ... From 3a85e08644e64b59082c79f06804b8ee202501c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 27 Oct 2025 17:20:44 +0200 Subject: [PATCH 09/11] Add Transaction.subscription_id field --- stubs/braintree/braintree/transaction.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stubs/braintree/braintree/transaction.pyi b/stubs/braintree/braintree/transaction.pyi index 875cace914db..2c444332023d 100644 --- a/stubs/braintree/braintree/transaction.pyi +++ b/stubs/braintree/braintree/transaction.pyi @@ -177,6 +177,7 @@ class Transaction(Resource): network_transaction_id: Incomplete payment_facilitator: PaymentFacilitator transfer: Transfer + subscription_id: str def __init__(self, gateway, attributes) -> None: ... @property def vault_billing_address(self): ... From b235ffb53d91bddfc478de324dd366862622ac3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 27 Oct 2025 17:28:36 +0200 Subject: [PATCH 10/11] Add fields in braintree's SubscriptionDetails --- stubs/braintree/braintree/subscription_details.pyi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stubs/braintree/braintree/subscription_details.pyi b/stubs/braintree/braintree/subscription_details.pyi index 30014161f03b..df2da1daa1a6 100644 --- a/stubs/braintree/braintree/subscription_details.pyi +++ b/stubs/braintree/braintree/subscription_details.pyi @@ -1,3 +1,7 @@ +from datetime import date + from braintree.attribute_getter import AttributeGetter -class SubscriptionDetails(AttributeGetter): ... +class SubscriptionDetails(AttributeGetter): + billing_period_start_date: date + billing_period_end_date: date From 7890523c1ea64c87e6c1fac4d5d4379333236362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 27 Oct 2025 17:34:15 +0200 Subject: [PATCH 11/11] Add Transaction.created_at field --- stubs/braintree/braintree/transaction.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stubs/braintree/braintree/transaction.pyi b/stubs/braintree/braintree/transaction.pyi index 2c444332023d..9554df46319c 100644 --- a/stubs/braintree/braintree/transaction.pyi +++ b/stubs/braintree/braintree/transaction.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete +from datetime import datetime from decimal import Decimal from typing import Final @@ -178,6 +179,7 @@ class Transaction(Resource): payment_facilitator: PaymentFacilitator transfer: Transfer subscription_id: str + created_at: datetime def __init__(self, gateway, attributes) -> None: ... @property def vault_billing_address(self): ...