@@ -135,6 +135,9 @@ def _determine_checkout_url(self, platform, service, action):
135135 action = "payment/details"
136136 if action == "paymentResult" :
137137 action = "payment/result"
138+ if action == "originKey" :
139+ action = "v1/originKeys"
140+
138141 base_uri = settings .BASE_CHECKOUT_URL .format (platform )
139142 api_version = settings .CHECKOUT_API_VERSION
140143
@@ -239,6 +242,17 @@ def call_api(self, request_data, service, action, idempotency=False,
239242 You can do this by running 'Adyen.password = 'Your password'"""
240243 raise AdyenInvalidRequestError (errorstring )
241244
245+ # xapikey at self object has highest priority. fallback to root module
246+ # and ensure that it is set.
247+ if self .xapikey :
248+ xapikey = self .xapikey
249+ elif 'xapikey' in kwargs :
250+ xapikey = kwargs .pop ("xapikey" )
251+ if not xapikey :
252+ errorstring = """Please set your webservice xapikey.
253+ You can do this by running 'Adyen.xapikey = 'Your xapikey'"""
254+ raise AdyenInvalidRequestError (errorstring )
255+
242256 # platform at self object has highest priority. fallback to root module
243257 # and ensure that it is set to either 'live' or 'test'.
244258 if self .platform :
@@ -473,7 +487,6 @@ def _handle_response(self, url, raw_response, raw_request,
473487 Returns:
474488 AdyenResult: Result object if successful.
475489 """
476-
477490 if status_code != 200 :
478491 response = {}
479492 # If the result can't be parsed into json, most likely is raw html.
0 commit comments