Skip to content

Commit 33a9377

Browse files
PSP Reference header fix (#184)
* Ensure that if PSP Reference is missing from response data or is empty, take the PSP Reference from the header instead * Update client.py Co-authored-by: Antoni Stroinski <55943882+antolo-arch@users.noreply.github.com>
1 parent a71e035 commit 33a9377

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Adyen/client.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,8 @@ def _handle_http_error(self, url, response_obj, status_code, psp_ref,
632632
headers=headers, error_code=response_obj.get("errorCode"))
633633

634634
@staticmethod
635-
def _get_psp(response, header):
635+
def _get_psp(response, headers):
636636
psp_ref = response.get('pspReference')
637-
if psp_ref == "":
638-
return header.get('pspReference')
639-
else:
640-
return psp_ref
637+
if psp_ref is None:
638+
psp_ref = headers.get('pspReference')
639+
return psp_ref

0 commit comments

Comments
 (0)