-
Couldn't load subscription status.
- Fork 47
Feature/checkoutv40 #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
26cccd9
e6986a7
40b60b0
2e834fb
25ca3f2
bee6945
1b50cad
b515f7c
a2bfc2c
22fb285
247cbaa
1ca76fb
8c257eb
236cd10
4782cb6
0a134fa
2421b54
5e7d9c3
f3627f7
c397486
4467940
0aa55af
a13dc7e
25afd0c
768c84b
42cb7e4
ec4f563
a66d3cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,6 +142,7 @@ def _requests_post(self, url, | |
| data=None, | ||
| username="", | ||
| password="", | ||
| xapikey="", | ||
| headers=None, | ||
| timeout=30): | ||
| """This function will POST to the url endpoint using requests. | ||
|
|
@@ -175,6 +176,8 @@ def _requests_post(self, url, | |
| auth = None | ||
| if username and password: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also here the api key can be the default and not the fallback plan There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure what you mean default. Do you suggest to remove basic authentication? If the xapi become first then it is default, correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with Attilla ApiKey has preference over username and password. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is fixed by adding the xapikey in high priority |
||
| auth = requests.auth.HTTPBasicAuth(username, password) | ||
| elif xapikey: | ||
| headers['x-api-key'] = xapikey | ||
|
|
||
| # Add User-Agent header to request so that the request | ||
| # can be identified as coming from the Adyen Python library. | ||
|
|
@@ -246,12 +249,12 @@ def _urllib_post(self, url, | |
| if username and password: | ||
| if sys.version_info[0] >= 3: | ||
| basic_authstring = base64.encodebytes(('%s:%s' % | ||
| (username, password)) | ||
| .encode()).decode().\ | ||
| (username, password)) | ||
| .encode()).decode(). \ | ||
| replace('\n', '') | ||
| else: | ||
| basic_authstring = base64.encodestring('%s:%s' % (username, | ||
| password)).\ | ||
| password)). \ | ||
| replace('\n', '') | ||
| url_request.add_header("Authorization", | ||
| "Basic %s" % basic_authstring) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we not add live_endpoint_prefix as property ?