{ "info": { "author": "Zope Corporation", "author_email": "zope-dev@zope.org", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Authorize.Net Integration\n=========================\n\nAuthorize.Net provides credit card (henceforth \"CC\") processing via a protocol\non top of HTTPS. Authorize.Net's customers are \"merchants\". The merchant is\nthe entity accepting a CC as payment. This package provides a simple\ninterface to Authorize.Net's \"Advanced Integration Method\" (AIM).\n\nSeveral terms used in this document:\n\n - authorize: check validity of CC information and for sufficient balance\n - capture: the approval of transfer of funds from the CC holder to the\n merchant\n - settlement: the actual transfer of funds from the CC holder\n to the merchant\n - credit: issuing a refund from the merchant to the card holder\n - voiding: canceling a previous transaction\n\nSettlement is performed in daily batches. The cut-off time for which is\nspecified in the merchant's settings available on the Authorize.Net merchant\ninterface.\n\nThere are many other settings which can be configured via the merchant\ninterface, but this module attempts to work independently of most of them.\nWhere specific settings are required they will be marked with the phrase\n\"required merchant interface setting\".\n\nTransaction Keys\n----------------\n\nEach AIM transaction must be accompanied by a merchant login and a\n\"transaction key\". This key is obtained from the merchant interface. After\nimporting the CcProcessor class you must pass it your login and transaction\nkey:\n\n >>> from zc.authorizedotnet.processing import CcProcessor\n >>> from zc.creditcard import (AMEX, DISCOVER, MASTERCARD,\n ... VISA, UNKNOWN_CARD_TYPE)\n >>> cc = CcProcessor(server=SERVER_NAME, login=LOGIN, key=KEY)\n\n\nAuthorizing\n-----------\n\nTo authorize a charge use the ``authorize`` method. It returns a\n``Transaction`` object.\n\n >>> result = cc.authorize(amount='2.00', card_num='4007000000027',\n ... exp_date='0530')\n\nThe result object contains details about the transaction.\n\n >>> result.response\n 'approved'\n >>> result.response_reason\n 'This transaction has been approved.'\n >>> result.approval_code\n '123456'\n >>> auth_trans_id = result.trans_id\n >>> result.trans_id\n '123456789'\n\nWhen the card_num is sent in, the result also contains the type of credit card:\n\n >>> result.card_type == VISA\n True\n\nIf no credit card number is provided, card_type is None:\n\n >>> result2 = cc.authorize(amount='2.00', exp_date='0530')\n >>> result2.card_type == None\n True\n\n >>> result2 = cc.authorize(amount='2.00', card_num='', exp_date='0530')\n >>> result2.card_type == None\n True\n\n\n\nCapturing Authorized Transactions\n---------------------------------\n\nNow if we want to capture the transaction that was previously authorized, we\ncan do so.\n\n >>> result = cc.captureAuthorized(trans_id=result.trans_id)\n >>> result.response\n 'approved'\n\n\nCredit (refund) transactions\n----------------------------\n\nA previosly credited transaction can be refunded. The amount of the\nrefund cannot exceed the amount captured. At least the last four\ndigits of the credit card number must be provided, along with the\ntransaction id.\n\nCredit will only work when the transaction has been settled by the\nbanks, that is if we try refunding immediately, it will fail:\n\n >>> result = cc.credit(trans_id=auth_trans_id,\n ... card_num='4007000000027',\n ... exp_date='0530',\n ... amount='1.00',\n ... )\n >>> result.response_reason\n 'The referenced transaction does not meet the criteria for issuing a credit.'\n >>> result.response\n 'error'\n\n\nVoiding Transactions\n--------------------\n\nIf we need to stop a transaction that has not yet been completed (like the\ncrediting of the captured transaction above) we can do so with the ``void``\nmethod.\n\n >>> result = cc.void(trans_id=auth_trans_id)\n >>> result.response\n 'approved'\n\n\nTransaction Errors\n------------------\n\nIf something about the transaction is erroneous, the transaction results\nindicate so.\n\n >>> result = cc.authorize(amount='2.50', card_num='4007000000027',\n ... exp_date='0599')\n\nThe result object reflecs the error.\n\n >>> result.response\n 'error'\n >>> result.response_reason\n 'The credit card has expired.'\n\nThe valid values for the ``response`` attribute are 'approved', 'declined',\nand 'error'.\n\n\nAddress Verification System (AVS)\n---------------------------------\n\nAVS is used to assert that the billing information provided for a transaction\nmust match (to some degree or another) the cardholder's actual billing data.\nThe gateway can be configured to disallow transactions that don't meet certain\nAVS criteria.\n\n\n >>> result = cc.authorize(amount='27.00', card_num='4222222222222',\n ... exp_date='0530', address='000 Bad Street',\n ... zip='90210')\n >>> result.response\n 'declined'\n >>> result.response_reason\n 'The transaction resulted in an AVS mismatch...'\n\n\nDuplicate Window\n----------------\n\nThe gateway provides a way to detect and reject duplicate transactions within\na certain time window. Any transaction with the same CC information (card\nnumber and expiration date) and amount duplicated within the window will be\nrejected.\n\nThe first transaction will work.\n\n >>> result = cc.authorize(amount='3.00', card_num='4007000000027',\n ... exp_date='0530', invoice_num='123')\n >>> result.response\n 'approved'\n\nA duplicate transaction will fail with an appropriate message.\n\n >>> result2 = cc.authorize(amount='3.00', card_num='4007000000027',\n ... exp_date='0530', invoice_num='123')\n >>> result2.response\n 'error'\n >>> result2.response_reason\n 'A duplicate transaction has been submitted.'\n\nSimilar transactions can be unaliased by including a unique invoice_num\nfield:\n\n >>> result3 = cc.authorize(amount='3.00', card_num='4007000000027',\n ... exp_date='0530', invoice_num='124')\n >>> result3.response\n 'approved'\n\nThe default window size is 120 seconds, but any other value (including 0) can\nbe provided by passing ``duplicate_window`` to the transaction method.\n\n >>> cc.captureAuthorized(trans_id=result.trans_id).response\n 'approved'\n\n >>> cc.captureAuthorized(trans_id=result.trans_id).response_reason\n 'This transaction has already been captured.'\n\n >>> cc.captureAuthorized(trans_id=result.trans_id, duplicate_window=0\n ... ).response\n 'approved'\n\nBut voiding doesn't report errors if the same transaction is voided inside\nthe duplicate window.\n\n >>> cc.void(trans_id=result.trans_id).response\n 'approved'\n\n >>> cc.void(trans_id=result.trans_id).response\n 'approved'\n\n\nLine items\n----------\n\nAn itemized listing of the order can be included in the authorization\ndata as a sequcence of sequences.\n\n >>> result = cc.authorize(amount='2.98', card_num='4007000000027',\n ... exp_date='0530',\n ... line_items=[\n ... # id name description qty unit price tax\n ... ('1', 'G-1000', 'Gadget', '1', '1.99', 'Y'),\n ... ('2', 'A-150', 'Accessory','1', '0.99', 'Y'),\n ... ])\n >>> result.response\n 'approved'\n\nthe result will have a card_type attribute.\n\n >>> result.card_type == VISA\n True\n\n\nThe MD5 Hash Security Feature\n-----------------------------\n\nAuthorize.Net provides for validating transaction responses via an MD5 hash.\nThe required merchant interface setting to use this feature is under\n\"Settings and Profile\" and then \"MD5 Hash\". Enter a \"salt\" value in the\nfields provided and submit the form. You may then provide the ``salt``\nparameter to the CcProcessor constructor to enable response validation.\n\nWARNING: The format of the \"amount\" field is very important for this feature\nto work correctly. The field must be formatted in the \"canonical\" way for the\ncurrency in use. For the US dollar that means no leading zeros and two (and\nonly two) decimal places. If the amount is not formatted properly in the\nrequest, the hashes will not match and the transaction will raise an exception.\n\nIf you want to enable hash checking, provide a ``salt`` value to the\n``CcProcessor`` constructor. If an incorrect salt value is used, or the\nhash given in the transaction doesn't match the true hash value an exception\nis raised.\n\n >>> cc = CcProcessor(server=SERVER_NAME, login=LOGIN, key=KEY,\n ... salt='wrong')\n >>> result = cc.authorize(amount='10.00', card_num='4007000000027',\n ... exp_date='0530')\n Traceback (most recent call last):\n ...\n ValueError: MD5 hash is not valid (trans_id = ...)\n\n\nError Checking\n--------------\n\nIf you don't pass a string for the amount when doing an authorization, an\nexception will be raised. This is to avoid charging the wrong amount due to\nfloating point representation issues.\n\n >>> cc.authorize(amount=5.00, number='4007000000027', expiration='0530')\n Traceback (most recent call last):\n ...\n ValueError: amount must be a string", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://svn.zope.org/zc.authorizedotnet", "keywords": "credit card authorize.net CC AIM", "license": "ZPL 2.1", "maintainer": null, "maintainer_email": null, "name": "zc.authorizedotnet", "package_url": "https://pypi.org/project/zc.authorizedotnet/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/zc.authorizedotnet/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://svn.zope.org/zc.authorizedotnet" }, "release_url": "https://pypi.org/project/zc.authorizedotnet/1.3.1/", "requires_dist": null, "requires_python": null, "summary": "A simple interface to Authorize.Net's AIM API", "version": "1.3.1" }, "last_serial": 802158, "releases": { "1.3": [ { "comment_text": "", "digests": { "md5": "3e4b1ac9ed6be705350d10139bc6e195", "sha256": "6994cbf7bb1a5cad0b2750e44f214b8cbab9404920a59ab5571a45cd1d4f8825" }, "downloads": -1, "filename": "zc.authorizedotnet-1.3-py2.4.egg", "has_sig": false, "md5_digest": "3e4b1ac9ed6be705350d10139bc6e195", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 21415, "upload_time": "2007-11-19T21:46:03", "url": "https://files.pythonhosted.org/packages/a9/98/2991d920a80e4afb59accfab58e0f0193da55fe723d6e7f27be1a828637a/zc.authorizedotnet-1.3-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "67f86be52614db268be4a8c3a8113cf1", "sha256": "93405f4f6e380429def27e86267a9b6e9c3a34530074d05fedb4291263ff8881" }, "downloads": -1, "filename": "zc.authorizedotnet-1.3.tar.gz", "has_sig": false, "md5_digest": "67f86be52614db268be4a8c3a8113cf1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9573, "upload_time": "2007-11-19T21:46:03", "url": "https://files.pythonhosted.org/packages/a8/7e/baaec4396d5fd521699c002fd1f9c4a043cf892bc7aa53271fb986744963/zc.authorizedotnet-1.3.tar.gz" } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "76790713031b6d193af19e68ab73794c", "sha256": "cc0f748803830a6fb0c2d05e000234effc7ae1ececae6058ae9303b6c2f8c6b7" }, "downloads": -1, "filename": "zc.authorizedotnet-1.3.1.tar.gz", "has_sig": false, "md5_digest": "76790713031b6d193af19e68ab73794c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9461, "upload_time": "2010-04-07T21:12:36", "url": "https://files.pythonhosted.org/packages/27/1d/3d68bc12ac2783405f00fbc0ac9deb67fd8857e7418c289023b87cdc20fe/zc.authorizedotnet-1.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "76790713031b6d193af19e68ab73794c", "sha256": "cc0f748803830a6fb0c2d05e000234effc7ae1ececae6058ae9303b6c2f8c6b7" }, "downloads": -1, "filename": "zc.authorizedotnet-1.3.1.tar.gz", "has_sig": false, "md5_digest": "76790713031b6d193af19e68ab73794c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9461, "upload_time": "2010-04-07T21:12:36", "url": "https://files.pythonhosted.org/packages/27/1d/3d68bc12ac2783405f00fbc0ac9deb67fd8857e7418c289023b87cdc20fe/zc.authorizedotnet-1.3.1.tar.gz" } ] }