1- from typing import TYPE_CHECKING , Any
1+ from typing import Any
22
33from ..objects .chargeback import Chargeback
4- from ..objects .list import ObjectList
54from .base import ResourceBase , ResourceGetMixin , ResourceListMixin
65
7- if TYPE_CHECKING :
8- from ..client import Client
9- from ..objects .payment import Payment
10- from ..objects .profile import Profile
11- from ..objects .settlement import Settlement
12-
136__all__ = [
147 "Chargebacks" ,
158 "PaymentChargebacks" ,
@@ -34,15 +27,6 @@ class Chargebacks(ChargebacksBase, ResourceListMixin):
3427class PaymentChargebacks (ChargebacksBase , ResourceGetMixin , ResourceListMixin ):
3528 """Resource handler for the `/payments/:payment_id:/chargebacks` endpoint."""
3629
37- _payment : "Payment"
38-
39- def __init__ (self , client : "Client" , payment : "Payment" ) -> None :
40- self ._payment = payment
41- super ().__init__ (client )
42-
43- def get_resource_path (self ) -> str :
44- return f"payments/{ self ._payment .id } /chargebacks"
45-
4630 def get (self , resource_id : str , ** params : Any ) -> Chargeback :
4731 self .validate_resource_id (resource_id , "chargeback ID" )
4832 return super ().get (resource_id , ** params )
@@ -51,30 +35,14 @@ def get(self, resource_id: str, **params: Any) -> Chargeback:
5135class SettlementChargebacks (ChargebacksBase , ResourceListMixin ):
5236 """Resource handler for the `/settlements/:settlement_id:/chargebacks` endpoint."""
5337
54- _settlement : "Settlement"
55-
56- def __init__ (self , client : "Client" , settlement : "Settlement" ) -> None :
57- self ._settlement = settlement
58- super ().__init__ (client )
59-
60- def get_resource_path (self ) -> str :
61- return f"settlements/{ self ._settlement .id } /chargebacks"
38+ pass
6239
6340
64- class ProfileChargebacks (ChargebacksBase ):
41+ class ProfileChargebacks (Chargebacks ):
6542 """
6643 Resource handler for the `/chargebacks?profileId=:profile_id:` endpoint.
6744
68- This is separate from the ` Chargebacks` resource handler to make it easier to inject the profileId .
45+ This is completely equal to Chargebacks, just here for completeness .
6946 """
7047
71- _profile : "Profile"
72-
73- def __init__ (self , client : "Client" , profile : "Profile" ) -> None :
74- self ._profile = profile
75- super ().__init__ (client )
76-
77- def list (self , ** params : Any ) -> ObjectList :
78- # Set the profileId in the query params
79- params .update ({"profileId" : self ._profile .id })
80- return Chargebacks (self .client ).list (** params )
48+ pass
0 commit comments