@@ -26,7 +26,10 @@ class CheckoutData(RequestModel):
2626
2727 items : Optional [List [CartItem ]]
2828
29- def add_items (self : "CheckoutData" , items : List [CartItem ] = ()):
29+ def add_items (
30+ self : "CheckoutData" ,
31+ items : List [CartItem ] = (),
32+ ) -> "CheckoutData" :
3033 """
3134 Adds multiple items to the checkout data.
3235
@@ -45,7 +48,7 @@ def add_items(self: "CheckoutData", items: List[CartItem] = ()):
4548 self .add_item (item )
4649 return self
4750
48- def add_item (self : "CheckoutData" , item : CartItem ):
51+ def add_item (self : "CheckoutData" , item : CartItem ) -> "CheckoutData" :
4952 """
5053 Adds a single item to the checkout data.
5154
@@ -63,7 +66,7 @@ def add_item(self: "CheckoutData", item: CartItem):
6366 self .items .append (item )
6467 return self
6568
66- def get_items (self : "CheckoutData" ):
69+ def get_items (self : "CheckoutData" ) -> List [ CartItem ] :
6770 """
6871 Retrieves all items from the checkout data.
6972
@@ -74,7 +77,7 @@ def get_items(self: "CheckoutData"):
7477 """
7578 return self .items
7679
77- def get_item (self : "CheckoutData" , index : int ):
80+ def get_item (self : "CheckoutData" , index : int ) -> CartItem :
7881 """
7982 Retrieves an item by its index from the checkout data.
8083
@@ -93,7 +96,7 @@ def generate_from_shopping_cart(
9396 self : "CheckoutData" ,
9497 shopping_cart : ShoppingCart ,
9598 tax_table_selector : str = "" ,
96- ):
99+ ) -> None :
97100 """
98101 Generates checkout data from a shopping cart.
99102
@@ -114,7 +117,7 @@ def refund_by_merchant_item_id(
114117 self : "CheckoutData" ,
115118 merchant_item_id : str ,
116119 quantity : int = 0 ,
117- ):
120+ ) -> None :
118121 """
119122 Processes a refund by merchant item ID.
120123
@@ -146,7 +149,7 @@ def refund_by_merchant_item_id(
146149 def get_item_by_merchant_item_id (
147150 self : "CheckoutData" ,
148151 merchant_item_id : str ,
149- ):
152+ ) -> CartItem :
150153 """
151154 Retrieves an item by its merchant item ID.
152155
0 commit comments