Skip to content
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

Merged
merged 7 commits into from
Jul 8, 2015

Commits on Jul 8, 2015

  1. 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.
    maiksprenger committed Jul 8, 2015
    3 Configuration menu
    Copy the full SHA
    9df0ce6 View commit details
    Browse the repository at this point in the history
  2. Add tests and docs for config classes

    This commit adds a few basic tests to check things work as expected.
    maiksprenger committed Jul 8, 2015
    4 Configuration menu
    Copy the full SHA
    b62b46e View commit details
    Browse the repository at this point in the history
  3. 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.
    maiksprenger committed Jul 8, 2015
    2 Configuration menu
    Copy the full SHA
    a2cc103 View commit details
    Browse the repository at this point in the history
  4. Remove order_data anti-pattern

    This commit improves upon the situation by making the dictionary
    explicitly required.
    maiksprenger committed Jul 8, 2015
    Configuration menu
    Copy the full SHA
    307983c View commit details
    Browse the repository at this point in the history
  5. 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.
    maiksprenger committed Jul 8, 2015
    Configuration menu
    Copy the full SHA
    66056bb View commit details
    Browse the repository at this point in the history
  6. Instanstiate the config class less often

    This was feedback given in the review.
    maiksprenger committed Jul 8, 2015
    Configuration menu
    Copy the full SHA
    685c3bb View commit details
    Browse the repository at this point in the history
  7. Update tests

    In the feedback round, we spotted that the tests could be improved.
    maiksprenger committed Jul 8, 2015
    Configuration menu
    Copy the full SHA
    458d4c0 View commit details
    Browse the repository at this point in the history