-
Notifications
You must be signed in to change notification settings - 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
Conversation
Adyen/client.py
Outdated
| service (str): API service to place request through. | ||
| action (str): the API action to perform. | ||
| """ | ||
| if action == "paymentDetails": |
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.
| if action == "paymentDetails": | |
| if action == "paymentsDetails": |
Adyen/client.py
Outdated
| action (str): the API action to perform. | ||
| """ | ||
| if action == "paymentDetails": | ||
| action = "payment/details" |
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.
| action = "payment/details" | |
| action = "payments/details" |
Adyen/client.py
Outdated
| """ | ||
| if action == "paymentDetails": | ||
| action = "payment/details" | ||
| if action == "paymentResult": |
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.
| if action == "paymentResult": | |
| if action == "paymentsResult": |
Adyen/client.py
Outdated
| if action == "paymentDetails": | ||
| action = "payment/details" | ||
| if action == "paymentResult": | ||
| action = "payment/result" |
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.
| action = "payment/result" | |
| action = "payments/result" |
Adyen/client.py
Outdated
| action = "payment/details" | ||
| if action == "paymentResult": | ||
| action = "payment/result" | ||
| if action == "originKey": |
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.
| if action == "originKey": | |
| if action == "originKeys": |
Adyen/client.py
Outdated
| action = "v1/originKeys" | ||
|
|
||
| base_uri = settings.BASE_CHECKOUT_URL.format(platform) | ||
| api_version = settings.CHECKOUT_API_VERSION |
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.
for checkoutUtility (originKeys) the versioning is different(v1 only at the moment),
I would put api_version at the beginning and replace it in case the action is originKeys
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.
It is fixed now
Adyen/httpclient.py
Outdated
| int: HTTP status code, eg 200,404,401 | ||
| dict: Key/Value pairs of the headers received. | ||
| """ | ||
| """ % self.pr |
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.
| """ % self.pr | |
| """ |
Adyen/httpclient.py
Outdated
| xapikey="", | ||
| headers=None, | ||
| timeout=30): | ||
| self.pr = """pr""" |
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.
| self.pr = """pr""" | |
Adyen/services.py
Outdated
| action, **kwargs) | ||
|
|
||
| def payment_result(self, request="", **kwargs): | ||
| action = "paymentResult" |
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.
| action = "paymentResult" | |
| action = "paymentsResult" |
Adyen/validation.py
Outdated
| "channel", "returnUrl", "countryCode", | ||
| "shopperLocale", "sessionValidity", | ||
| "merchantAccount"] | ||
| actions['paymentResult'] = ["payload"] |
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.
| actions['paymentResult'] = ["payload"] | |
| actions['paymentsResult'] = ["payload"] |
Adyen/settings.py
Outdated
| ENDPOINT_PROTOCOL = "https://" | ||
| BASE_CHECKOUT_URL = "https://checkout-{}.adyen.com" | ||
| CHECKOUT_URL_LIVE_SUFFIX = "-checkout-live.adyenpayments.com/checkout" | ||
| CHECKOUT_API_VERSION = "v40" |
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.
these 4 static variables looks very similar and a bit difficult to understand. Would it be an idea to keep it easy like:
const ENDPOINT_PROTOCOL = "https://";
ENDPOINT_CHECKOUT_TEST = "https://checkout-test.adyen.com/checkout";
ENDPOINT_CHECKOUT_LIVE_SUFFIX = "-checkout-live.adyenpayments.com/checkout";
like we do in php ?
| self.username = username | ||
| self.password = password | ||
| self.xapikey = xapikey | ||
| self.review_payout_username = review_payout_username |
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 ?
Adyen/httpclient.py
Outdated
| """This function will POST to the url endpoint using requests. | ||
| Returning an AdyenResult object on 200 HTTP response. | ||
| Either json or data has to be provided. | ||
| Either json or data has to be %sovided. |
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.
what is %sovided ?
Adyen/client.py
Outdated
| # xapikey at self object has highest priority. | ||
| # fallback to root module | ||
| # and ensure that it is set. | ||
| if self.xapikey: |
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.
the api key can become the first to check and use instead of the username password, since all our APIs are working fine with the API key only.
|
|
||
| # Adding basic auth if username and password provided. | ||
| auth = None | ||
| if username and password: |
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.
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 comment
The 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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
It is fixed by adding the xapikey in high priority
Adyen/settings.py
Outdated
| BASE_PAL_URL = "https://pal-{}.adyen.com/pal/servlet" | ||
| BASE_HPP_URL = "https://{}.adyen.com/hpp" | ||
| API_VERSION = "v30" | ||
| ENDPOINT_LIVE_SUFFIX = "-pal-live.adyenpayments.com" |
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.
is this being used ?
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.
correct, it is not used so it can be removed
|
|
||
| BASE_PAL_URL = "https://pal-{}.adyen.com/pal/servlet" | ||
| BASE_HPP_URL = "https://{}.adyen.com/hpp" | ||
| API_VERSION = "v30" |
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.
Depricate the API_VERSION instead of removing it to follow semver
Description
Tested scenarios
Fixed issue: