-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
116 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
language: python | ||
matrix: | ||
include: | ||
- python: '3.5' | ||
env: TOXENV=py35-django207-test | ||
- python: '3.6' | ||
env: TOXENV=py36-django207-test | ||
- python: '3.5' | ||
env: TOXENV=py35-django207-checkmigrations | ||
- python: '3.5' | ||
env: TOXENV=py35-django207-flake | ||
install: | ||
- pip install tox | ||
script: | ||
- tox | ||
deploy: | ||
provider: pypi | ||
user: skioo | ||
password: | ||
secure: TLVygdPWAdjyqMpcQoNMUGfsf2OTouc2FygktGIkSH86jj4nwsHFEvELtscoNwXbDABWt6mC1k9zvTFCWrH718FQgoZmLZw59sWNNaXnYCmCgeU2lxOsg5V8D0bLVgV7bheJ9kPCa6tphaop8R+fmCQht50wWDhXS9AK51EucspffEL1OaUbShhteUkJXctadn+P3KaFWEJBGX+AJyCsCxtTYlN9EzHbil6SPpSddthiqiGSg3KBdxKeKlB+B4rP+e7PQGnEE4TPGS293DZDDo8yLzJi4YDtCpjQDuOxFMyWskzj21WlLMY5UW8rqMydMY/OTyfRdUYZXvcl9GGBFMc/ZgMsI5vcdCRbOMsBdOg1mMiuw6IWwuAAU0eNn10IE3E56AxiRDK4W8V7B5qTk60zHQbYb8K3nxXl8y+lFL0oy0EX/JwX8ECnb1Dpc+MWVawrAQAPAQuR/Y+JZhmycKwI0qxe3957HS1zeVgB3SMT62c+as1wvRu11o+DZfSn4qMq+QzjFpcQLqriSjPSzRGHO41py7leNRtyxBmnBFKzLkVCzNjRvgrrFn5i5YZnYmV826umQNh0khC7w3S5Eh46w1pfnfNlFcUUtEiapKZdXrJVaTgIYHa06acgjEFZMzXDUsFFRk4LTbIrV2zJq/td0X9F4foCnbbj6CvWSmg= | ||
distribution: sdist bdist_wheel | ||
on: | ||
tags: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
__version__ = '0.0.1' | ||
__version__ = '0.0.2' | ||
__copyright__ = 'Copyright (c) 2018, skioo SA' | ||
__license__ = 'MIT' | ||
__URL__ = 'https://github.com/skioo/django-netaxept-gateway' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
netaxept/migrations/0003_payment_authoauth_and_redirecturl.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 2.0.4 on 2018-07-04 03:05 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('netaxept', '0002_auto_20180408_1151'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='payment', | ||
name='auto_auth', | ||
field=models.BooleanField(default=False), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name='payment', | ||
name='redirect_url', | ||
field=models.CharField(default='unknown', max_length=255), | ||
preserve_default=False, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
from django.test import TestCase | ||
from pytest import raises | ||
from pytest import raises, mark | ||
|
||
from netaxept.actions import payments | ||
from netaxept.actions.payments import PaymentRegistrationNotCompleted | ||
from netaxept import actions | ||
from netaxept.actions import PaymentRegistrationNotCompleted | ||
from netaxept.models import Payment | ||
|
||
|
||
class PaymentTest(TestCase): | ||
|
||
def test_invalid_state(self): | ||
@mark.skip('because it tries to invoke the real netaxept gateway') | ||
def test_a_successful_payment_can_go_on_thru_sale(self): | ||
payment = Payment.objects.create( | ||
transaction_id='1234567890', | ||
order_number='an-order-number', | ||
amount=100, | ||
currency_code='NOK', | ||
success=False) | ||
with raises(PaymentRegistrationNotCompleted): | ||
payments.sale(payment.id) | ||
success=True, | ||
auto_auth=False) | ||
actions.sale(payment.id) | ||
|
||
def test_valid_state(self): | ||
def test_an_unsuccesful_payment_cannot_go_on_thru_sale(self): | ||
payment = Payment.objects.create( | ||
transaction_id='1234567890', | ||
order_number='an-order-number', | ||
amount=100, | ||
currency_code='NOK', | ||
success=True) | ||
payments.sale(payment.id) | ||
success=False, | ||
auto_auth=False) | ||
with raises(PaymentRegistrationNotCompleted): | ||
actions.sale(payment.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[tox] | ||
envlist = | ||
{py35,py36}-{django207}-test | ||
py35-django202-{checkmigrations,flake,mypy} | ||
|
||
[testenv] | ||
basepython = | ||
py35: python3.5 | ||
py36: python3.6 | ||
commands = | ||
test: py.test tests | ||
checkmigrations: ./manage.py makemigrations --check --dry-run | ||
flake: flake8 | ||
deps = | ||
django207: Django>=2.0.7,<2.1 | ||
structlog | ||
suds2 | ||
requests | ||
pytest-django | ||
flake: flake8 | ||
mypy |