mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-18 14:29:47 +08:00
Annotate braintree's Subscription and Transaction methods (#14917)
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
from _typeshed import Incomplete
|
||||
from datetime import date
|
||||
from decimal import Decimal
|
||||
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.resource_collection import ResourceCollection
|
||||
from braintree.subscription_status_event import SubscriptionStatusEvent
|
||||
from braintree.successful_result import SuccessfulResult
|
||||
from braintree.transaction import Transaction
|
||||
|
||||
class Subscription(Resource):
|
||||
@@ -27,23 +31,24 @@ 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
|
||||
def find(subscription_id): ...
|
||||
def find(subscription_id: str) -> Subscription: ...
|
||||
@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): ...
|
||||
def cancel(subscription_id: str) -> SuccessfulResult | ErrorResult | None: ...
|
||||
@staticmethod
|
||||
def search(*query): ...
|
||||
def search(*query) -> ResourceCollection: ...
|
||||
@staticmethod
|
||||
def update_signature(): ...
|
||||
price: Decimal
|
||||
balance: Decimal
|
||||
next_billing_date: date
|
||||
next_billing_period_amount: Decimal
|
||||
add_ons: list[AddOn]
|
||||
descriptor: Descriptor
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
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
|
||||
|
||||
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 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): ...
|
||||
def search(self, *query): ...
|
||||
def update(self, subscription_id, params=None): ...
|
||||
def search(self, *query) -> ResourceCollection: ...
|
||||
def update(
|
||||
self, subscription_id: str, params: dict[str, Incomplete] | None = None
|
||||
) -> SuccessfulResult | ErrorResult | None: ...
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from _typeshed import Incomplete
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
from typing import Final
|
||||
|
||||
@@ -26,6 +27,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
|
||||
@@ -102,13 +104,13 @@ 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
|
||||
def sale(params=None): ...
|
||||
@staticmethod
|
||||
def search(*query): ...
|
||||
def search(*query) -> ResourceCollection: ...
|
||||
@staticmethod
|
||||
def submit_for_settlement(transaction_id, amount=None, params=None): ...
|
||||
@staticmethod
|
||||
@@ -176,6 +178,8 @@ class Transaction(Resource):
|
||||
network_transaction_id: Incomplete
|
||||
payment_facilitator: PaymentFacilitator
|
||||
transfer: Transfer
|
||||
subscription_id: str
|
||||
created_at: datetime
|
||||
def __init__(self, gateway, attributes) -> None: ...
|
||||
@property
|
||||
def vault_billing_address(self): ...
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
from braintree.resource_collection import ResourceCollection
|
||||
from braintree.transaction import Transaction
|
||||
|
||||
class TransactionGateway:
|
||||
gateway: Incomplete
|
||||
config: Incomplete
|
||||
@@ -9,10 +12,10 @@ 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): ...
|
||||
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): ...
|
||||
|
||||
Reference in New Issue
Block a user