@@ -26,7 +26,7 @@ class UnzerClientViURShop(unzer.UnzerClient):
2626 def _request (self , url , method , headers , payload , auth ):
2727 # Extend with ViUR Logic:
2828 # Before the request is performed, we update the accept-language with
29- # the language of the current request, except it's explicit set.
29+ # the language of the current request, unless it has been explicitly set.
3030 if self .language is None :
3131 # language for translation of customerMessage in errors
3232 headers ["accept-language" ] = current .language .get ()
@@ -35,6 +35,12 @@ def _request(self, url, method, headers, payload, auth):
3535
3636
3737class UnzerAbstract (PaymentProviderAbstract ):
38+ """
39+ Abstract base class for Unzer payment methods in the ViUR Shop.
40+
41+ Provides common functionality for Unzer-based payment providers,
42+ including API communication and payment type handling.
43+ """
3844
3945 def __init__ (
4046 self ,
@@ -155,14 +161,18 @@ def can_order(
155161 def charge (self ):
156162 raise errors .NotImplemented ()
157163
158- def get_order_by_pay_id (self , payment_id , public_key , * args , ** kwargs ):
164+ def get_order_by_pay_id (
165+ self ,
166+ payment_id : str ,
167+ public_key : str ,
168+ * args , ** kwargs
169+ ) -> SkeletonInstance_T [OrderSkel ] | None :
159170 """Helper method to get the order skel for a payment-id.
160171
161172 :param payment_id: The payment id. (ex: s-pay-1).
162173 :param public_key: Public key of the key pair.
163174
164- :return: The order-skel if the key seems to be valid. None otherwise.
165- :rtype: OrderSkel | None
175+ :return: The order-skel if the key seems valid. None otherwise.
166176 """
167177 logger .debug (f"get_order_by_pay_id({ payment_id = } | { public_key = } )" )
168178
@@ -235,7 +245,7 @@ def webhook(self, *args, **kwargs):
235245 raise errors .BadRequest ("Invalid payload" )
236246 logger .info (f"Received request via webhook. { args = } , { kwargs = } " )
237247 logger .info (f"{ payload = } " )
238- logger .info (f"headers={ current .request .get ().request .headers !r} " )
248+ logger .info (f"headers={ dict ( current .request .get ().request .headers ) !r} " )
239249
240250 ip = current .request .get ().request .remote_addr
241251 logger .info (f"{ ip = } " )
0 commit comments