{ "info": { "author": "Maykin Media, Jorik Kraaikamp", "author_email": "jorik.kraaikamp@maykinmedia.nl", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Framework :: Django :: 2.0", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "# DjAdyen\n\n[![PyPI version](https://badge.fury.io/py/djadyen.svg)](https://badge.fury.io/py/djadyen)\n[![PyPI python versions](https://img.shields.io/pypi/pyversions/Django.svg)]([![PyPI](https://img.shields.io/pypi/v/nine.svg)[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmaykinmedia%2Fdjadyen.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmaykinmedia%2Fdjadyen?ref=badge_shield)\n]([![PyPI](https://img.shields.io/pypi/dm/Django.svg)](https://pypi.python.org/pypi/djadyen/)))\n[![PyPI Licence](https://img.shields.io/pypi/l/Django.svg)]([![PyPI](https://img.shields.io/pypi/pyversions/Django.svg)]([![PyPI](https://img.shields.io/pypi/v/nine.svg)]([![PyPI](https://img.shields.io/pypi/dm/Django.svg)](https://pypi.python.org/pypi/djadyen/))))\n\n[![Build Status](https://travis-ci.org/maykinmedia/djadyen.svg?branch=master)](https://travis-ci.org/maykinmedia/djadyen)\n[![codecov](https://codecov.io/gh/maykinmedia/djadyen/branch/master/graph/badge.svg)](https://codecov.io/gh/maykinmedia/djadyen)\n[![Lintly](https://lintly.com/gh/maykinmedia/djadyen/badge.svg)](https://lintly.com/gh/maykinmedia/djadyen/)\n[![Code Climate](https://codeclimate.com/github/codeclimate/codeclimate/badges/gpa.svg)](https://codeclimate.com/github/maykinmedia/djadyen)\n\nThis module is used to connect your django application to the payment provider Adyen using the classic \"Adyen Hosted Payment Pages (HPP)\" API, using the \"Multi-page payment flow\". Adyen also\nhas a newer API, for more information see [Online payments API](https://docs.adyen.com/developers/checkout).\nBefore working with this module please also read the [documentation on Adyen](https://docs.adyen.com/developers/hpp-manual).\n\nThis is only tested on a postgres database.\n\n## Installation\n\nInstall with pip\n```shell\npip install djadyen\n```\n\nAdd *'adyen'* to the installed apps\n```python\n# settings.py\n\nINSTALLED_APPS = [\n ...\n 'djadyen',\n ...\n]\n```\n\nAdd the Adyen notifications urls (This is not required). These url will save all the notifications to the database. You need to make an implementation to handle the notifications\n```python\n# urls.py\n\nurlpatterns = [\n ...\n url(r'^adyen/notifications/', include('djadyen.notifications.urls', namespace='adyen-notifications')),\n ...\n]\n```\n\n## Usage\n\n### Management command\nThere is a management command that will sync the payment methods for you. This can be used if you want the users to select a payment method/issuer on your own site.\n\n`manage.py sync_payment_methods`\n\n\nYou'll need to create a crontab entry to call the following management command on hourly basis.\n\n`manage.py adyen_processing`\n\n### Required settings\n- `ADYEN_HOST_URL` *This is used for creating the return url from adyen*\n- `ADYEN_MERCHANT_ACCOUNT` *This is the merchant accont that is used in Adyen.*\n- `ADYEN_MERCHANT_SECRET` *This is the secret that is used to calculate the signature.*\n- `ADYEN_SKIN_CODE` *This is the code that is generated by the skin in the Adyen application.*\n- `ADYEN_NOTIFICATION_SECRET` *The secret HMAC key which should be enabled for notifications.*\n- `ADYEN_ORDER_MODELS` *A list of models that are used to store Orders (Inherit from AdyenOrder). The models should be strings in the . form*\n\n### Optional settings\n- `ADYEN_CURRENCYCODE` *(default='EUR') This can be set to any other currency Adyen supports*\n- `ADYEN_ENABLED` *(default=True) This can be set to false for integration tests*\n- `ADYEN_NEXT_STATUS` *(default='AUTHORISED') This is used for the tests. This means that the payment is accepted.*\n- `ADYEN_REFETCH_OLD_STATUS` *(default=False) This is so you will always have the latest saved status. This will cause an extra db query!*\n- `ADYEN_SESSION_MINUTES` *(default=10) This is how long an Adyen session is valid.*\n- `ADYEN_URL` *(default='https://test.adyen.com/') This needs to be changed for the live env. This is a more secure default then entering the live env. The live env is 'https://live.adyen.com/'*\n- `ADYEN_HANDLE_NOTIFICATION_MINUTES_AGO` *(default=15) This defaults to 15 minutes. You can change the value to make this shorter or longer depending on the need.*\n\n### Order object\nThere is an abstract order in this package. This will save you some time on creating an order for adyen.\nThere are some features on the order that will make it easier to integrate your order with this package.\n\n\nThe added fields are:\n\n- `status` *This is the status of the object. This will be changed by adyen.*\n- `created_at` *This field is used for when the order is created.*\n- `reference` *This field is a communication field. It is not used outside the communication. This will be set by uuid4, but can be overwritten.*\n- `psp_reference` *This field is the reference from Adyen. With this field you are able to search in the Adyen inderface.*\n- `payment_option` *This is the Adyen payment option from this package.*\n- `issuer` *This is the Adyen issuer from this package.*\n\n\nYou should implement the following methods\n\n- `get_price_in_cents` *Return the price to be paid for this order*\n- `process_authorized_notification` *Process a 'authorized' notification which adyen has sent*\n\n### AdyenRedirectView\nThis is used to redirect to Adyen. This will also contain a redirect view. You can overwrite it if you want a styled view.\nYou need to provide the data that the redirect view requires. You can provide the data in different ways.\n\nThis is the integrated version. You don't have to do a lot of custom work.\n```python\nfrom djadyen.views import AdyenRedirectView\n\n\nclass MyAdyenRequestView(AdyenRedirectView):\n model = MyModel\n\n def get_form_kwargs(self):\n order = self.get_object()\n params = self.get_signed_order_params(order)\n\n kwargs = super(MyAdyenRequestView, self).get_form_kwargs()\n kwargs.update({'initial': params})\n return kwargs\n\n def get_next_url(self): # This is to populate the resURL\n order = self.get_object()\n return reverse('my_project:confirmation', kwargs={'pk': order.id})\n```\n\nNeed to change some values or want to pass extra arguments? You are better off using the view this way.\nNow you have full control over the arguments.\n```python\nfrom djadyen.views import AdyenRedirectView\n\n\nclass MyAdyenRequestView(AdyenRedirectView):\n model = MyModel\n\n def get_form_kwargs(self):\n order = self.get_object()\n params = self.get_default_params(\n merchantReference=order.reference,\n paymentAmount=order.get_price_in_cents(),\n shopperEmail=order.email,\n brandCode=order.payment_option.adyen_name\n resURL='https://www.djangoproject.com/'\n )\n if order.issuer:\n params['issuerId'] = order.issuer.adyen_id\n\n params = self.sign_params(params)\n\n kwargs = super(MyAdyenRequestView, self).get_form_kwargs()\n kwargs.update({'initial': params})\n return kwargs\n```\n\n### AdyenResponseMixin\nAdyen also creates a response. This will help you with catching the response. This view will check if\nthe response from Adyen is valid. It will also provide some usefull functions so you don't have to overwrite\nanything.\n\nIn this example the order is automaticly fetched from the reference that is passed in the merchantReference.\nIt will also set the order in the self object for easy access. In the done function the order is saved\nand the template will be rendered.\n```python\nfrom djadyen.views import AdyenResponseMixin\nfrom djadyen.choices import Status\n\n\nclass ConfirmationView(AdyenResponseMixin, TemplateView):\n template_name = 'my_project/confirmation.html'\n model = Order\n\n def handle_authorised(self):\n self.order.status = Status.Authorised\n return self.done()\n\n def handle_pending(self):\n self.order.status = Status.Pending\n return self.done()\n\n def handle_refused(self):\n self.order.status = Status.Refused\n return self.done()\n\n def handle_error(self):\n self.order.status = Status.Error\n return self.done()\n\n def handle_canceled(self):\n self.order.status = Status.Cancel\n return self.done()\n\n def handle_default(self):\n if self.psp_reference:\n self.order.psp_reference = self.psp_reference\n```\n\nIf you did not pass the reference of the order in the merchantReference. You might want to set the auto_fetch to False.\nNow there is also no order set to self and you need to fetch the order yourself.\n```python\nfrom djadyen.views import AdyenResponseMixin\nfrom djadyen.choices import Status\n\n\nclass ConfirmationView(AdyenResponseMixin, TemplateView):\n template_name = 'my_project/confirmation.html'\n auto_fetch = False\n\n def handle_authorised(self):\n # Do stuff\n\n def handle_pending(self):\n # Do stuff\n\n def handle_refused(self):\n # Do stuff\n\n def handle_error(self):\n # Do stuff\n\n def handle_canceled(self):\n # Do stuff\n\n def handle_default(self):\n # Do stuff that is required for all functions above. Like settings the psp_reference\n```\n\n# Adyen notifications\n\nSetup the standard notifications in Adyen. These will comunicate about the payments if they were succesful or not.\nThis is **very important** because the notifications will be needed when a payment is redirected with a pending payment.\n\nThe notifications will be stored in the database. You need to write the handling of the notifications yourself.\n\n\n### Changes\n- AdyenResponseMixin.auto_fetch has been deprecated.\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmaykinmedia%2Fdjadyen.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmaykinmedia%2Fdjadyen?ref=badge_large)\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/maykinmedia/djadyen", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "djadyen", "package_url": "https://pypi.org/project/djadyen/", "platform": "", "project_url": "https://pypi.org/project/djadyen/", "project_urls": { "Homepage": "https://github.com/maykinmedia/djadyen" }, "release_url": "https://pypi.org/project/djadyen/1.1.2/", "requires_dist": [ "Django (>=1.8)", "django-choices", "requests" ], "requires_python": "", "summary": "A Django package to intergrade Adyen in your project.", "version": "1.1.2" }, "last_serial": 5231867, "releases": { "0.1.0": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a89238a0ee869e6db2b8d157c8bb33a2", "sha256": "d17883ce3c26c1e8cd061c91035bb86eaa32d682c83b634f3adf02c58f944f68" }, "downloads": -1, "filename": "djadyen-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a89238a0ee869e6db2b8d157c8bb33a2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15827, "upload_time": "2017-02-10T12:46:28", "url": "https://files.pythonhosted.org/packages/49/6b/e69bd69fc9316503bac2bf7c858a579a4c1badd4addf4cba604064127cd3/djadyen-0.1.1-py2.py3-none-any.whl" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "2aeedf9fbf899a34c97cf4b92bc1a734", "sha256": "514fb7cc9fdbbe450eb2bdbb2ec57adaeca7343500c9752e303863fff432d82c" }, "downloads": -1, "filename": "djadyen-0.1.2.tar.gz", "has_sig": false, "md5_digest": "2aeedf9fbf899a34c97cf4b92bc1a734", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9268, "upload_time": "2017-02-10T13:30:09", "url": "https://files.pythonhosted.org/packages/e5/5c/0b1e014c08a2b8a053b58082abb66bfde910c584da977fa607f0519e97fb/djadyen-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "6ee065323105a539eba5d997dde57fc9", "sha256": "c4b8d2cb04ce57e8a2681343398af25cff173f726f4e4c69327c95e00cec726d" }, "downloads": -1, "filename": "djadyen-0.1.3.tar.gz", "has_sig": false, "md5_digest": "6ee065323105a539eba5d997dde57fc9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11815, "upload_time": "2017-02-10T13:36:32", "url": "https://files.pythonhosted.org/packages/31/5a/f0fe4de1af58af285000a2b9079569fa1d1727b4d3ebe999663604344f10/djadyen-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "8c8c324d776c634d19388326a1d3fb92", "sha256": "8a5c2d9006c8deba4f5c3698c3700b9e7d5736ae7b19c080bcf0dcbdc5199765" }, "downloads": -1, "filename": "djadyen-0.1.4.tar.gz", "has_sig": false, "md5_digest": "8c8c324d776c634d19388326a1d3fb92", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11858, "upload_time": "2017-02-14T13:31:18", "url": "https://files.pythonhosted.org/packages/c4/de/95b07ca25b144acfb58668af0217196d967ebfec6904f1d1e41172b248cc/djadyen-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "a973390615ceef2db12b949182dbb413", "sha256": "972776a973ce746fd9a6eda17911e0b817d8d565eeb854022fae7684cb2fcdfc" }, "downloads": -1, "filename": "djadyen-0.1.5.tar.gz", "has_sig": false, "md5_digest": "a973390615ceef2db12b949182dbb413", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11900, "upload_time": "2017-02-20T13:38:25", "url": "https://files.pythonhosted.org/packages/4d/b2/58228e05a046d8e2cd91ae4cebaef5cfca0390ed5a62aa79591c124aa935/djadyen-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "478a601ed0aa1a0a0933f2709b201a0c", "sha256": "3e65c2e1c7b42b590220a3ed7ffa388714e36b57f3b3a6cff87370d72d432192" }, "downloads": -1, "filename": "djadyen-0.1.6.tar.gz", "has_sig": false, "md5_digest": "478a601ed0aa1a0a0933f2709b201a0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11928, "upload_time": "2017-02-21T13:30:39", "url": "https://files.pythonhosted.org/packages/de/7f/394be12fe25eb23939881ba5d64161dda1868667cfa4f47c8ebe9b003e26/djadyen-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "fa419fdfb393d546166cc02bd78bb0db", "sha256": "2dc1f7028bf16f78c38042fa5c848f91b65d6ce1c8dda12fa66c1d7edc526e34" }, "downloads": -1, "filename": "djadyen-0.1.7.tar.gz", "has_sig": false, "md5_digest": "fa419fdfb393d546166cc02bd78bb0db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12083, "upload_time": "2017-03-09T15:07:10", "url": "https://files.pythonhosted.org/packages/51/bd/94ac9144725fae2162d756f035033e7e70263c969fb0d2a14a9543319949/djadyen-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "3cf20823a6fff4a489cdba6674a90cf8", "sha256": "a473c9d21e9bf9894d6a055689a90d621b984ef0cc233f040448af642ca64887" }, "downloads": -1, "filename": "djadyen-0.1.8.tar.gz", "has_sig": false, "md5_digest": "3cf20823a6fff4a489cdba6674a90cf8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12193, "upload_time": "2017-07-14T12:22:15", "url": "https://files.pythonhosted.org/packages/fb/be/714918197d2846298ab7b428ba3f014e1561c4715544be5947c16bf6c897/djadyen-0.1.8.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "86898e4f7fe264970f28f8e490c73473", "sha256": "e952137387042ee98c36225d817824e6762be166f18aa6398db0981fbc9c9769" }, "downloads": -1, "filename": "djadyen-1.0.0.tar.gz", "has_sig": false, "md5_digest": "86898e4f7fe264970f28f8e490c73473", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15784, "upload_time": "2018-04-20T12:31:09", "url": "https://files.pythonhosted.org/packages/38/ac/626f472a9e1838143bbffa1ef32400cd8143b45bd4048ad2c481436ad248/djadyen-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "e301b6d7acced255a0174e83ba0a26c5", "sha256": "eb36aa82ce8e7a82d5c451f4f64321354bca4f3094a3a04dac75d0213aedbc4a" }, "downloads": -1, "filename": "djadyen-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e301b6d7acced255a0174e83ba0a26c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16430, "upload_time": "2018-06-04T08:26:39", "url": "https://files.pythonhosted.org/packages/40/3b/7e261567e3d46915842a98449c04cbd0cb4c71a0403a5357732e1555f795/djadyen-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "a26bb988090ea4da93352de6378f9a3e", "sha256": "87506d4b763cb79fd738790caf6ccaf6b097a1e88534326f2c0e925dbe0fbbdc" }, "downloads": -1, "filename": "djadyen-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a26bb988090ea4da93352de6378f9a3e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24057, "upload_time": "2019-04-25T07:53:38", "url": "https://files.pythonhosted.org/packages/b2/9e/6f610f7bb864c45ead31928236c13f4840deb2952dbd9f4186145d28f934/djadyen-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7ebe153025dabdb7fb6743a07e4efcd8", "sha256": "67ccf0c5a2afc16b93688ef7c9830af83598cb6e108c9ed9cbd04c571f16a57e" }, "downloads": -1, "filename": "djadyen-1.1.0.tar.gz", "has_sig": false, "md5_digest": "7ebe153025dabdb7fb6743a07e4efcd8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20291, "upload_time": "2019-04-25T07:53:40", "url": "https://files.pythonhosted.org/packages/ce/1e/5bfdd3b2dcf34d5405c407b2f39db3899bd5f7e666bfb0e64de30ae63185/djadyen-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "63ac0adf0993e87af57651d259ba191f", "sha256": "3cef983f067f3936c93ce9494cc7cce1595cf9b0c965564a168db21fdce48933" }, "downloads": -1, "filename": "djadyen-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "63ac0adf0993e87af57651d259ba191f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24274, "upload_time": "2019-04-25T08:32:34", "url": "https://files.pythonhosted.org/packages/10/f1/2b570826dc096f5eebf0f4477f6ddda7523f157d7d703f3a93466dd2de48/djadyen-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c7bf7b9bc39acfa1f4487025edb06543", "sha256": "7d244e227e7fbb41a2bd0cbfaac76be21c0f451371c173744d77146ee0c37463" }, "downloads": -1, "filename": "djadyen-1.1.1.tar.gz", "has_sig": false, "md5_digest": "c7bf7b9bc39acfa1f4487025edb06543", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20536, "upload_time": "2019-04-25T08:32:35", "url": "https://files.pythonhosted.org/packages/96/85/887c22079983c5d62a1f1126261e8685ca49bc18af679840344594adec91/djadyen-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "45f664c9d41a6257acacf8097149459b", "sha256": "317e8247d9ae273a58db0007d0aeb3964a198f0e6a8a6063f3d651e90b606a5f" }, "downloads": -1, "filename": "djadyen-1.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "45f664c9d41a6257acacf8097149459b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24443, "upload_time": "2019-05-06T09:54:33", "url": "https://files.pythonhosted.org/packages/2e/14/9ca2c3866ac694ebe90ee13fb76d5e495336dd44b733c2f793993c8ea2b1/djadyen-1.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b966574e339c1442a3d0f2585d062cf8", "sha256": "de31577cf62f6b04cb0d5185e1bfe96adc3297757620a25374d89dcb70821aed" }, "downloads": -1, "filename": "djadyen-1.1.2.tar.gz", "has_sig": false, "md5_digest": "b966574e339c1442a3d0f2585d062cf8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20714, "upload_time": "2019-05-06T09:54:35", "url": "https://files.pythonhosted.org/packages/1c/fc/5a8e820bb41b051df4482e87e2ea0a14f1b3d00abcda70872e0e18a515ce/djadyen-1.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "45f664c9d41a6257acacf8097149459b", "sha256": "317e8247d9ae273a58db0007d0aeb3964a198f0e6a8a6063f3d651e90b606a5f" }, "downloads": -1, "filename": "djadyen-1.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "45f664c9d41a6257acacf8097149459b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24443, "upload_time": "2019-05-06T09:54:33", "url": "https://files.pythonhosted.org/packages/2e/14/9ca2c3866ac694ebe90ee13fb76d5e495336dd44b733c2f793993c8ea2b1/djadyen-1.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b966574e339c1442a3d0f2585d062cf8", "sha256": "de31577cf62f6b04cb0d5185e1bfe96adc3297757620a25374d89dcb70821aed" }, "downloads": -1, "filename": "djadyen-1.1.2.tar.gz", "has_sig": false, "md5_digest": "b966574e339c1442a3d0f2585d062cf8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20714, "upload_time": "2019-05-06T09:54:35", "url": "https://files.pythonhosted.org/packages/1c/fc/5a8e820bb41b051df4482e87e2ea0a14f1b3d00abcda70872e0e18a515ce/djadyen-1.1.2.tar.gz" } ] }