@@ -40,12 +40,13 @@ class Configuration(object):
4040.. [1] `URL Fetch Python API Overview <https://developers.google.com/appengine/docs/python/urlfetch/overview>`_
4141 """
4242 @staticmethod
43- def configure (environment , merchant_id , public_key , private_key ):
43+ def configure (environment , merchant_id , public_key , private_key , http_strategy = None ):
4444 Configuration .environment = environment
4545 Configuration .merchant_id = merchant_id
4646 Configuration .public_key = public_key
4747 Configuration .private_key = private_key
4848 Configuration .use_unsafe_ssl = False
49+ Configuration .default_http_strategy = http_strategy
4950
5051 @staticmethod
5152 def gateway ():
@@ -54,22 +55,27 @@ def gateway():
5455 @staticmethod
5556 def instantiate ():
5657 return Configuration (
57- Configuration .environment ,
58- Configuration .merchant_id ,
59- Configuration .public_key ,
60- Configuration .private_key
58+ environment = Configuration .environment ,
59+ merchant_id = Configuration .merchant_id ,
60+ public_key = Configuration .public_key ,
61+ private_key = Configuration .private_key ,
62+ http_strategy = Configuration .default_http_strategy
6163 )
6264
6365 @staticmethod
6466 def api_version ():
6567 return "3"
6668
67- def __init__ (self , environment , merchant_id , public_key , private_key ):
69+ def __init__ (self , environment , merchant_id , public_key , private_key , http_strategy = None ):
6870 self .environment = environment
6971 self .merchant_id = merchant_id
7072 self .public_key = public_key
7173 self .private_key = private_key
72- self ._http_strategy = self .__determine_http_strategy ()
74+
75+ if http_strategy :
76+ self ._http_strategy = http_strategy (self , self .environment )
77+ else :
78+ self ._http_strategy = self .__determine_http_strategy ()
7379
7480 def base_merchant_path (self ):
7581 return "/merchants/" + self .merchant_id
0 commit comments