-
Notifications
You must be signed in to change notification settings - Fork 17
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
Allow altering config values based on request #14
Commits on Jul 8, 2015
-
Add config class to get settings
We will need to be able to alter settings based on e.g. the request, so as a first step, I'm introducing a layer between Django settings and the Adyen code. We introduce the concept of a config class, that can be set from the Django settings. It defaults to a supplied config class that just fetches the needed values from the Django settings as before. But now we have the possibility of switiching out the config class to fetch those values from elsewhere.
3Configuration menu - View commit details
-
Copy full SHA for 9df0ce6 - Browse repository at this point
Copy the full SHA 9df0ce6View commit details -
Add tests and docs for config classes
This commit adds a few basic tests to check things work as expected.
4Configuration menu - View commit details
-
Copy full SHA for b62b46e - Browse repository at this point
Copy the full SHA b62b46eView commit details -
Pass request into config class
The idea is that we want to change certain configuration values based on the request. To get this working, we need to change the interface for the config class to pass the request to most of it's methods. To get the request object, we need to also alter the facade's and scaffold's interface to more often include the request. For this commit, I had a look at how data gets passed from e.g. Oscaro to the scaffold. Unfortunately I discovered an anti-pattern, where a lot of required data is passed in via an undocumented order_data dictionary. That needs to be cleaned up separately.
2Configuration menu - View commit details
-
Copy full SHA for a2cc103 - Browse repository at this point
Copy the full SHA a2cc103View commit details -
Remove order_data anti-pattern
This commit improves upon the situation by making the dictionary explicitly required.
Configuration menu - View commit details
-
Copy full SHA for 307983c - Browse repository at this point
Copy the full SHA 307983cView commit details -
Remove unused get_form_fields, rename get_form_fields_list
get_form_fields concatenated the form fields together to produce some HTML. Arguably, that's out of scope for a payment gateway. Furthermore, it's not currently used. Hence, I removed it and renamed the more useful get_form_fields_list. This allows dropping a requirement.
Configuration menu - View commit details
-
Copy full SHA for 66056bb - Browse repository at this point
Copy the full SHA 66056bbView commit details -
Instanstiate the config class less often
This was feedback given in the review.
Configuration menu - View commit details
-
Copy full SHA for 685c3bb - Browse repository at this point
Copy the full SHA 685c3bbView commit details -
In the feedback round, we spotted that the tests could be improved.
Configuration menu - View commit details
-
Copy full SHA for 458d4c0 - Browse repository at this point
Copy the full SHA 458d4c0View commit details