{ "info": { "author": "Michal Kuffa", "author_email": "michal.kuffa@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Topic :: Software Development" ], "description": "trustpaylib\n===========\n\n.. image:: https://travis-ci.org/beezz/trustpaylib.svg?branch=master\n :target: https://travis-ci.org/beezz/trustpaylib\n\n.. image:: https://coveralls.io/repos/beezz/trustpaylib/badge.png\n :target: https://coveralls.io/r/beezz/trustpaylib \n\n\nTrustPay payment solution integration helpers.\n\n\nInstall\n-------\n\n.. code:: bash\n\n $ pip install trustpaylib\n\n\n\nUsage\n-----\n\n\nLink approach\n.............\n\nCreate environment, payment request and generate signed link. \n\n.. code:: pycon\n\n >>> import trustpaylib\n >>> \n >>> env = trustpaylib.build_environment(\n ... aid=\"1234567890\",\n ... secret_key=\"abcd1234\",\n ... # api_url=trustpaylib.TRUSTCARD_API_URL,\n ... )\n >>> pay_request = trustpaylib.build_pay_request(\n ... AMT=\"123.45\",\n ... CUR=\"EUR\",\n ... REF=\"1234567890\",\n ... )\n >>> trustpay_client = trustpaylib.TrustPay(env)\n >>> trustpay_client.build_link(pay_request)\n 'https://ib.trustpay.eu/mapi/paymentservice.aspx?AID=9876543210&REF=1234567890&AMT=123.45&SIG=DF174E635DABBFF7897A82822521DD739AE8CC2F83D65F6448DD2FF991481EA3&CUR=EUR'\n\n\n\nForm approach\n.............\n\nFirst merge payment request with environment variables, validate it and sign.\n`trustpaylib.TrustPay.finalize_request` returns prepared payment\nrequest. As form action use `trustpay_client.environment.api_url`.\n\n\n.. code:: pycon\n\n >>> pay_request = trustpay_client.finalize_request(pay_request)\n >>> trustpay_client.initial_data(pay_request)\n {'AID': '9876543210', 'REF': u'1234567890', 'AMT': u'123.45', 'SIG': 'DF174E635DABBFF7897A82822521DD739AE8CC2F83D65F6448DD2FF991481EA3', 'CUR': u'EUR'}\n >>> trustpay_client.environment.api_url\n 'https://ib.trustpay.eu/mapi/paymentservice.aspx'\n\n\nRedirects handling\n..................\n\nThere's not much you can (or should) do with redirect.\n\n.. note::\n\n Official TrustPay documentation: DO NOT PERFORM ANY ACTION ON THIS REDIRECT.\n Data is not signed and therefore cannot beconsidered as a verified payment result, such\n as the signed results sent to Notification URL or NotificationEmail.\n\n\nBut at least you can check the result code.\n\n\n.. code:: pycon\n\n >>> # data received as get params to redirect\n ... redirect_data = {\"REF\": \"1234567890\", \"RES\": 3, \"PID\": \"1212321\"}\n >>> redirect = trustpaylib.build_redirect(**redirect_data)\n >>> \n >>> trustpay_client.get_result_desc_from_redirect(redirect).short\n 'Authorized'\n >>> trustpay_client.get_result_desc_from_redirect(redirect).long\n 'Payment was successfully authorized. Another notification (with result code 0 - success) will be sent when TrustPay receives and processes payment from 3rd party.'\n\n\n\nNotifications handling\n......................\n\n\nFor received notification, first check signature.\n\n.. code:: pycon\n\n >>> notification_data = {\n ... \"AID\": \"1234567890\",\n ... \"TYP\": \"CRDT\",\n ... \"AMT\": \"123.45\",\n ... \"CUR\": \"EUR\",\n ... \"REF\": \"9876543210\",\n ... \"RES\": \"0\",\n ... \"TID\": \"11111\",\n ... \"OID\": \"1122334455\",\n ... \"TSS\": \"Y\",\n ... \"SIG\": (\n ... \"97C92D7A0C0AD99CE5DE55C3597D5ADA\"\n ... \"0D423991E2D01938BC0F684244814A37\"\n ... ),\n ... }\n >>> notification = trustpaylib.build_notification(**notification_data)\n >>> assert trustpay_client.check_notification_signature(notification)\n\n\nThen check result code.\n\n\n.. code:: pycon\n\n >>> trustpay_client.get_result_desc_from_notification(notification).short\n 'Success'\n >>> trustpay_client.get_result_desc_from_notification(notification).long\n 'Payment was successfully processed.'", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/beezz/trustpaylib", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "trustpaylib", "package_url": "https://pypi.org/project/trustpaylib/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/trustpaylib/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/beezz/trustpaylib" }, "release_url": "https://pypi.org/project/trustpaylib/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "TrustPay payments integration library.", "version": "0.0.1" }, "last_serial": 1168424, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "cb82f58126179dd5f2bcba064cf5cbd8", "sha256": "ce690af3851a837a196b85c527877fa26d4c5a7539a39da8ace486dfa71a514c" }, "downloads": -1, "filename": "trustpaylib-0.0.1.tar.gz", "has_sig": false, "md5_digest": "cb82f58126179dd5f2bcba064cf5cbd8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8690, "upload_time": "2014-07-24T21:14:11", "url": "https://files.pythonhosted.org/packages/3f/36/42bfea7349e0edb1fb11f71f32162e57badcf5bd16a65f2ad8b868913d55/trustpaylib-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cb82f58126179dd5f2bcba064cf5cbd8", "sha256": "ce690af3851a837a196b85c527877fa26d4c5a7539a39da8ace486dfa71a514c" }, "downloads": -1, "filename": "trustpaylib-0.0.1.tar.gz", "has_sig": false, "md5_digest": "cb82f58126179dd5f2bcba064cf5cbd8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8690, "upload_time": "2014-07-24T21:14:11", "url": "https://files.pythonhosted.org/packages/3f/36/42bfea7349e0edb1fb11f71f32162e57badcf5bd16a65f2ad8b868913d55/trustpaylib-0.0.1.tar.gz" } ] }