{ "info": { "author": "getpaid community", "author_email": "getpaid-dev@googlegroups.com", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Framework :: Zope3", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Office/Business :: Financial", "Topic :: Software Development :: Libraries" ], "description": "This package contains ups for getpaid.\n\n\n=======\nCHANGES\n=======\n\n0.4 (unreleased)\n----------------\n\n\n0.3 (2008-08-29)\n----------------\n\n* Added buildout files and general text documents to project root.\n\n\n\nDetailed Documentation\n**********************\n\n===========\ngetpaid ups\n===========\n\nThis modules provides an integration package for getpaid and UPS \n( www.ups.com ). \n\nUsage\n-----\n\nFirst we need to create an instance of a UPS rating utility and configure \nit with our UPS Account Information. In order to run the unit tests in this\npackage the values for UPS_USERNAME, UPS_PASSWORD, UPS_ACCESS_KEY need to\nbe setup in the shell/process environment.\n\nAlso note that rates.py currently returns FakeResponse( ) to these requests.\nTo get a real response from the server, simply comment that line (#66) out.\n\n >>> from getpaid.ups import interfaces\n >>> from getpaid.ups.rates import UPSRateService\n >>> ups = UPSRateService()\n >>> ups.username = UPS_USERNAME\n >>> ups.password = UPS_PASSWORD\n >>> ups.access_key = UPS_ACCESS_KEY\n >>> ups.pickup_type = '01'\n \nWe need to explicitly specify which ups services we're allowing for a store.\n\n >>> ups.services = interfaces.UPS_SERVICES.by_value.keys()\n\nOrigin Information\n------------------\n\nWe also need to configure our store to setup a default origin location for\npackages to originate from. for brevity, we've done configured the store \nsettings in the test setup with a san francisco address.\n\nCreating an Order to Ship\n-------------------------\n\nLet's create an order with some items we'd like to have shipped.\n\n >>> from getpaid.core import order, item, cart\n >>> myorder = order.Order()\n >>> myorder.shopping_cart = mycart = cart.ShoppingCart()\n >>> mycart\n \n\n >>> line_item = item.ShippableLineItem()\n >>> line_item.item_id = \"sku-code-1\"\n >>> line_item.quantity = 2\n >>> line_item.weight = 5.5\n >>> mycart[ line_item.item_id ] = line_item\n\nDestination Information\n-----------------------\n\nWe need some additional information for an order to successfully\nprocess it, first some contact information:\n\n >>> from getpaid.core import payment\n >>> user_contact = payment.ContactInformation()\n >>> user_contact.name = \"John Smith\"\n >>> user_contact.email = \"js@example.org\"\n >>> user_contact.phone_number = '7033291513'\n >>> myorder.contact_information = user_contact\n\nand of course a place to ship to:\n\n >>> ship_address = payment.ShippingAddress()\n >>> ship_address.ship_same_billing = False\n >>> ship_address.ship_first_line = '2702 Occidental Dr'\n >>> ship_address.ship_city = 'Vienna'\n >>> ship_address.ship_state = \"VA\"\n >>> ship_address.ship_country = \"US\"\n >>> ship_address.ship_postal_code = '22180'\n >>> myorder.shipping_address = ship_address\n\nGetting Shipping Options\n------------------------\n\nNow we can query UPS to find out the various services, delivery windows, and\n prices that UPS can offer for transit.\n \n >>> results = ups.getRates( myorder )\n >>> results.shipments.sort( lambda x,y:cmp(x.cost,y.cost) )\n >>> methods = results.shipments \n >>> len(methods)\n 6\n\nPrices will vary over time, for testing purposes, we sort and compare\nthe expected serices types by cost (low to high)\n\n >>> methods[0].service\n u'UPS Ground'\n >>> methods[1].service\n u'UPS Three Day Select'\n >>> methods[2].service\n u'UPS 2nd Day Air'\n >>> methods[3].service\n u'UPS Next Day Air Saver'\n\nFailure Modes\n-------------\n\nif the store shipping information isn't setup correctly we get a type\nerror asking to look at the store settings.\n\n >>> from zope.component import getUtility\n >>> from getpaid.core.interfaces import IStoreSettings\n >>> settings = getUtility( IStoreSettings )\n >>> settings.contact_state = \"\"\n >>> ups.getRates( myorder )\n Traceback (most recent call last):\n ...\n TypeError: Invalid Store Address Settings in Store Admin\n\n\nTODO: Test\n\nstatus available on results objects\n\n \n\n\n\nDownload\n**********************", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "getpaid.ups", "package_url": "https://pypi.org/project/getpaid.ups/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/getpaid.ups/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/getpaid.ups/0.3/", "requires_dist": null, "requires_python": null, "summary": "Get paid UPS functionality", "version": "0.3" }, "last_serial": 792376, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "6f3af67cb073ce89debe7d47915b4f40", "sha256": "3457afff0225544ea114e0e9a2ae06f514dd81425c82e86534fa50997340fa51" }, "downloads": -1, "filename": "getpaid.ups-0.3.tar.gz", "has_sig": false, "md5_digest": "6f3af67cb073ce89debe7d47915b4f40", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 915220, "upload_time": "2009-01-28T20:05:53", "url": "https://files.pythonhosted.org/packages/0c/6e/0c4df7f8d7f8fec552dc28e1e20a8937906671852aacd4b29cf5a455cddb/getpaid.ups-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6f3af67cb073ce89debe7d47915b4f40", "sha256": "3457afff0225544ea114e0e9a2ae06f514dd81425c82e86534fa50997340fa51" }, "downloads": -1, "filename": "getpaid.ups-0.3.tar.gz", "has_sig": false, "md5_digest": "6f3af67cb073ce89debe7d47915b4f40", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 915220, "upload_time": "2009-01-28T20:05:53", "url": "https://files.pythonhosted.org/packages/0c/6e/0c4df7f8d7f8fec552dc28e1e20a8937906671852aacd4b29cf5a455cddb/getpaid.ups-0.3.tar.gz" } ] }