1515 AdyenInvalidRequestError ,
1616 AdyenAPIInvalidFormat ,
1717 AdyenAPIInvalidAmount )
18-
19- HMAC_TEST_url = "https://ca-test.adyen.com/ca/ca/skin/checkhmac.shtml"
20-
21- BASE_PAL_url = "https://pal-{}.adyen.com/pal/servlet"
22- BASE_HPP_url = "https://{}.adyen.com/hpp"
23- API_VERSION = "v30"
24- API_RECURRING_VERSION = "v25"
25- API_CLIENT_ATTR = ["username" , "password" , "review_payout_user" ,
26- "review_payout_password" , "confirm_payout_user" ,
27- "confirm_payout_password" , "platform" ,
28- "merchant_account" , "merchant_specific_url" ,
29- "hmac" ]
18+ from . import settings
3019
3120
3221class AdyenResult (object ):
@@ -110,11 +99,11 @@ def _determine_api_url(self, platform, service, action):
11099 service (str): API service to place request through.
111100 action (str): the API action to perform.
112101 """
113- base_uri = BASE_PAL_url .format (platform )
102+ base_uri = settings . BASE_PAL_URL .format (platform )
114103 if service == "Recurring" :
115- api_version = API_RECURRING_VERSION
104+ api_version = settings . API_RECURRING_VERSION
116105 else :
117- api_version = API_VERSION
106+ api_version = settings . API_VERSION
118107 return '/' .join ([base_uri , service , api_version , action ])
119108
120109 def _determine_hpp_url (self , platform , action ):
@@ -126,7 +115,7 @@ def _determine_hpp_url(self, platform, action):
126115 action (str): the HPP action to perform.
127116 possible actions: select, pay, skipDetails, directory
128117 """
129- base_uri = BASE_HPP_url .format (platform )
118+ base_uri = settings . BASE_HPP_URL .format (platform )
130119 service = action + '.shtml'
131120 result = '/' .join ([base_uri , service ])
132121 return result
@@ -438,8 +427,8 @@ def _handle_response(self, url, raw_response, raw_request,
438427 if response ['errorCode' ]:
439428 return raw_response
440429 except KeyError :
441- errstr = 'KeyError: errorCode'
442- pass
430+ erstr = 'KeyError: errorCode'
431+ raise AdyenAPICommunicationError ( erstr )
443432 else :
444433 try :
445434 response = json_lib .loads (raw_response )
0 commit comments