Skip to content

Commit

Permalink
Merge pull request #12 from oscaro/prepare-release-0.2.6
Browse files Browse the repository at this point in the history
Release 0.2.6
  • Loading branch information
wo0dyn committed Apr 29, 2015
2 parents 76b5ed5 + 4e25149 commit ab470f9
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 20 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: python

python:
- "3.3"
- "3.4"

install:
- pip install 'django-oscar>=0.7'
- pip install -r requirements.txt

env:
- PYTHONPATH=.:$PYTHONPATH

script: py.test tests
43 changes: 32 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@
Adyen package for django-oscar
==============================

This package provides integration with the `Adyen`_ payment gateway. It is designed to
work seamlessly with the e-commerce framework `django-oscar`_ but can be used without
Oscar.
This extension supports Django 1.6+, Python 3.3+ and Oscar 0.7+.
.. image:: https://pypip.in/version/django-oscar-adyen/badge.svg
:target: https://pypi.python.org/pypi/django-oscar-adyen/
:alt: Latest Version

.. image:: https://pypip.in/py_versions/django-oscar-adyen/badge.svg
:target: https://pypi.python.org/pypi/django-oscar-adyen/
:alt: Supported Python versions

.. image:: https://api.travis-ci.org/oscaro/django-oscar-adyen.svg
:target: https://travis-ci.org/oscaro/django-oscar-adyen

This package provides integration with the `Adyen`_ payment gateway. It is
designed to work seamlessly with the e-commerce framework `django-oscar`_ but
can be used without Oscar. This extension supports Django 1.6+, Python 3.3+ and
Oscar 0.7+.

.. _`Adyen`: http://www.adyen.com/
.. _`django-oscar`: https://github.com/tangentlabs/django-oscar
Expand All @@ -19,22 +30,24 @@ Installation

From PyPi::

pip install django-oscar-adyen
$ pip install django-oscar-adyen

or from Github::

pip install git+git://github.com/oscaro/django-oscar-adyen.git#egg=django-oscar-adyen
$ pip install git+git://github.com/oscaro/django-oscar-adyen.git#egg=django-oscar-adyen

Add ``'adyen'`` to ``INSTALLED_APPS`` and run::

./manage.py migrate adyen
$ django-admin migrate adyen

to create the appropriate database tables.

Configuration
-------------

Edit your ``settings.py`` to set the following settings::
Edit your ``settings.py`` to set the following settings:

.. code-block:: python
ADYEN_IDENTIFIER = 'YourAdyenAccountName'
ADYEN_SECRET_KEY = 'YourAdyenSkinSecretKey'
Expand All @@ -47,8 +60,16 @@ as opposed to your production environment.
Settings
========

* ``ADYEN_IDENTIFIER`` - The identifier of your Adyen account.
====================== =========================================================
Setting Description
---------------------- ---------------------------------------------------------
``ADYEN_IDENTIFIER`` The identifier of your Adyen account
``ADYEN_SECRET_KEY`` The secret key defined in your Adyen skin
``ADYEN_ACTION_URL`` The URL towards which the Adyen form should be POSTed
to initiate the payment process
====================== =========================================================

* ``ADYEN_SECRET_KEY`` - The secret key defined in your Adyen skin.
License
=======

* ``ADYEN_ACTION_URL`` - The URL towards which the Adyen form should be POSTed to initiate the payment process.
``django-oscar-adyen`` is released under the BSD license, like Django itself.
12 changes: 12 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[pytest]
DJANGO_SETTINGS_MODULE=tests.settings
addopts = --pyargs --reuse-db

; Imitate Django's test discovery pattern. py.test's default is test_*.py
python_files=test*.py

flakes-ignore =
migrations/* ALL

; new pep8 relaxed rules
pep8maxlinelength = 100
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
setup(

name='django-oscar-adyen',
version='0.2.5',
version='0.2.6',
url='https://github.com/oscaro/django-oscar-adyen',
author='Mathieu Richardoz',
author_email='[email protected]',
Expand Down
Empty file added tests/__init__.py
Empty file.
23 changes: 23 additions & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# """
# Django settings for tests project.
# """

import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

SECRET_KEY = '+&l^d!%soa4gxsnx7_txbo0x3uv$@4i&n!r8yte72otwqo7vmh'

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}

OSCAR_DEFAULT_CURRENCY = 'EUR'

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
)

INSTALLED_APPS = ('adyen',)
18 changes: 10 additions & 8 deletions adyen/tests.py → tests/test_adyen.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

from freezegun import freeze_time

from .gateway import MissingFieldException, InvalidTransactionException
from .models import AdyenTransaction
from .scaffold import Scaffold
from .facade import Facade
from adyen.gateway import MissingFieldException, InvalidTransactionException
from adyen.models import AdyenTransaction
from adyen.scaffold import Scaffold
from adyen.facade import Facade


TEST_IDENTIFIER = 'OscaroFR'
Expand All @@ -23,7 +23,7 @@
TEST_SKIN_CODE = 'cqQJKZpg'
TEST_IP_ADDRESS_HTTP_HEADER = 'HTTP_X_FORWARDED_FOR'

TEST_RETURN_URL = 'https://www.test.com/checkout/return/adyen/'
TEST_RETURN_URL = 'https://www.example.com/checkout/return/adyen/'

TEST_FROZEN_TIME = '2014-07-31 17:00:00'

Expand All @@ -32,15 +32,16 @@
{'type': 'hidden', 'name': 'merchantAccount', 'value': TEST_IDENTIFIER},
{'type': 'hidden', 'name': 'merchantReference', 'value': '00000000123'},
{'type': 'hidden', 'name': 'merchantReturnData', 'value': 123},
{'type': 'hidden', 'name': 'merchantSig', 'value': 'mCCvOn8nc4vdo5w2pUJ9u+mV7Gg='},
{'type': 'hidden', 'name': 'merchantSig', 'value': 'kKvzRvx7wiPLrl8t8+owcmMuJZM='},
{'type': 'hidden', 'name': 'paymentAmount', 'value': 123},
{'type': 'hidden', 'name': 'resURL', 'value': TEST_RETURN_URL},
{'type': 'hidden', 'name': 'sessionValidity', 'value': '2014-07-31T17:20:00Z'},
{'type': 'hidden', 'name': 'shipBeforeDate', 'value': '2014-08-30'},
{'type': 'hidden', 'name': 'shopperEmail', 'value': 'test@test.com'},
{'type': 'hidden', 'name': 'shopperEmail', 'value': 'test@example.com'},
{'type': 'hidden', 'name': 'shopperLocale', 'value': 'fr'},
{'type': 'hidden', 'name': 'shopperReference', 'value': 789},
{'type': 'hidden', 'name': 'skinCode', 'value': 'cqQJKZpg'},
{'type': 'hidden', 'name': 'countryCode', 'value': 'fr'},
]

AUTHORISED_PAYMENT_PARAMS_GET = {
Expand Down Expand Up @@ -116,9 +117,10 @@ def setUp(self):
self.order_data = {
'amount': 123,
'basket_id': 456,
'client_email': 'test@test.com',
'client_email': 'test@example.com',
'client_id': 789,
'currency_code': 'EUR',
'country_code': 'fr',
'description': 'Order #123',
'order_id': 'ORD-123',
'order_number': '00000000123',
Expand Down

0 comments on commit ab470f9

Please sign in to comment.