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

Cleanup tests, add support for error and pending payment statuses #20

Merged
merged 13 commits into from
Oct 7, 2015

Commits on Oct 1, 2015

  1. Remove AdyenTestCase

    As I like to keep things simple, I removed one layer of inheritance. The
    test case was pretty useless, as it mostly served to set settings that we
    could set like any other Django setting already.
    maiksprenger committed Oct 1, 2015
    Configuration menu
    Copy the full SHA
    f690d4e View commit details
    Browse the repository at this point in the history
  2. Cleanup request tests

    maiksprenger committed Oct 1, 2015
    Configuration menu
    Copy the full SHA
    fc9bfd3 View commit details
    Browse the repository at this point in the history
  3. Move request tests to dedicated module

    Conceptually, that's a totally different phase of the Adyen flow. As
    they're a bit noisy, I've moved them to their own module.
    maiksprenger committed Oct 1, 2015
    Configuration menu
    Copy the full SHA
    979893c View commit details
    Browse the repository at this point in the history
  4. Move remaining tests into submodules

    The response tests deserved their own module. And with that, the
    remaining tests were only testing payment notifications, so the
    previously catch-all 'test_adyen' module was renamed.
    maiksprenger committed Oct 1, 2015
    Configuration menu
    Copy the full SHA
    cc46c8e View commit details
    Browse the repository at this point in the history
  5. Reduce verbosity in responses tests

    It was easy to make those tests a bit easier to read, so I did. Also
    removed a switch based on the Python version, because we only support
    Python 3 anyway.
    maiksprenger committed Oct 1, 2015
    3 Configuration menu
    Copy the full SHA
    ec6192a View commit details
    Browse the repository at this point in the history
  6. Use correct name for new tests

    Woops, I called responses what are really redirects; the class is called
    PaymentRedirection after all.
    maiksprenger committed Oct 1, 2015
    Configuration menu
    Copy the full SHA
    6bc937a View commit details
    Browse the repository at this point in the history
  7. Remove BaseRequest class

    It only added an unneeded level of redirection and was only used when
    being inherited from again by FormRequest. It might make sense to factor
    it out later when adding another request class, but as it stands, it
    just makes things harder to understand.
    maiksprenger committed Oct 1, 2015
    Configuration menu
    Copy the full SHA
    237f2aa View commit details
    Browse the repository at this point in the history
  8. Simplify gateway module

    This commit moves some duplicate attributes to the common BaseInteraction
    and removes one level of inheritance between PaymentFormRequest and
    BaseInteraction.
    maiksprenger committed Oct 1, 2015
    Configuration menu
    Copy the full SHA
    a46df55 View commit details
    Browse the repository at this point in the history
  9. TLC for the redirect tests

    This commit
    
    * switches to using a MockRequest class instead of passing around
      weird state on self
    * moves one-time-only data into the individual tests
    * creates a dedicated module for unit tests
    * uses py.test syntax and Django foo to make tests more readable
    maiksprenger committed Oct 1, 2015
    Configuration menu
    Copy the full SHA
    f89cfa3 View commit details
    Browse the repository at this point in the history
  10. Safeguard against _compute_hash returning None

    I was bothered by params.get(self.HASH_FIELD) because I'd expect the
    hash field to always be present. But I realized it's better to allow it
    not being present, but loudly raising an InvalidTransactionException,
    irrespective whehter self.hash() returns anything or not (which it might
    not do accidentally).
    
    This is probably minor nitpicking, but better be safe than sorry!
    maiksprenger committed Oct 1, 2015
    Configuration menu
    Copy the full SHA
    419aaf4 View commit details
    Browse the repository at this point in the history
  11. Handle ERROR notifications from Adyen

    The point of this PR really is to address a bug with ERROR notifications
    from Adyen. Oscaro employees can check Sentry:
    http://sentry-prod.oscaro.com/oshop/oshop-prod/group/1310/events/3457809/
    
    The bug is two-fold. Error messages were forgotten in the status map.
    Note that PAYMENT_RESULT_ERROR is already present in the codebase.
    
    The other issue was that the lookup in ADYEN_TO_COMMON_STATUSES
    was implemented to be forgiving (using get()). Hence the
    traceback above is somewhat subtle; it lead to status being returned
    as None.
    maiksprenger committed Oct 1, 2015
    Configuration menu
    Copy the full SHA
    4df53e2 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2015

  1. Handle PENDING notifications from Adyen

    As documented, Adyen may return a payment status of pending. This commit
    adds support of it. As the job of django-oscar-adyen is merely to bubble
    that data up to the Scaffold, the change is pretty simple.
    maiksprenger committed Oct 7, 2015
    Configuration menu
    Copy the full SHA
    e65f05e View commit details
    Browse the repository at this point in the history
  2. Add some ramblings

    This PR improved upon the tests, but there's always work left to do.
    This commits adds a few of my ramblings about how we could improve
    further.
    maiksprenger committed Oct 7, 2015
    Configuration menu
    Copy the full SHA
    76a1b31 View commit details
    Browse the repository at this point in the history