{ "info": { "author": "RakGyu Song", "author_email": "reeoss@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT 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 :: Software Development :: Libraries :: Python Modules" ], "description": "=====================\nI'mport; REST Client\n=====================\n\n.. image:: https://travis-ci.org/james-song/iamport-rest-client-python3.svg?branch=master\n :target: https://travis-ci.org/james-song/iamport-rest-client-python3\n\n.. image:: https://codecov.io/gh/james-song/iamport-rest-client-python3/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/james-song/iamport-rest-client-python3\n\n\nPython3 \uc0ac\uc6a9\uc790\ub97c \uc704\ud55c \uc544\uc784\ud3ec\ud2b8 REST API \uc5f0\ub3d9 \ubaa8\ub4c8\uc785\ub2c8\ub2e4.\n\n* \uc774\uc6a9 \uc911 \ubc1c\uc0dd\ud55c \ubb38\uc81c\uc5d0 \ub300\ud574 \ucc45\uc784\uc9c0\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.\n* `Iamport \uacf5\uc2dd \ub77c\uc774\ube0c\ub7ec\ub9ac `_ \uac00 \uad00\ub9ac\ub418\uc9c0 \uc54a\uc544 \ud3ec\ud06c\ud558\uc5ec \ub9cc\ub4e4\uc5c8\uc2b5\ub2c8\ub2e4\n\n\uc124\uce58\n=======\n\n.. code-block:: shell\n\n pip install iamport-rest-client2\n\n\n\uae30\ub2a5\n======\n1. \uacb0\uc81c \uc815\ubcf4 \ucc3e\uae30\n2. \uac00\uaca9 \ud655\uc778\n3. \ucde8\uc18c\n4. \ube44 \uc778\uc99d \uacb0\uc81c\n5. \uc815\uae30 \uc608\uc57d \uacb0\uc81c\n6. \uacb0\uc81c \uc5c6\uc774 \uce74\ub4dc\uc815\ubcf4 \ub4f1\ub85d\n\n\n\uc0ac\uc6a9\ubc95\n=======\n\n\uc900\ube44\n------\n\n\uc0ac\uc6a9\ud558\uae30 \uc704\ud574 \uac1d\uccb4\ub97c \ub9cc\ub4ed\ub2c8\ub2e4.\n\n.. code-block:: python\n\n from iamport import Iamport\n\n # \ud14c\uc2a4\ud2b8 \uc6a9\n iamport = Iamport(imp_key='{\ud14c\uc2a4\ud2b8\uc6a9 \ud0a4}', imp_secret='{\ud14c\uc2a4\ud2b8 \uc2dc\ud06c\ub9bf}')\n # \ud14c\uc2a4\ud2b8\uc6a9 \ud0a4\uc640 \uc2dc\ud06c\ub9bf\uc740 tests/conftest.py \ud30c\uc77c\uc5d0 DEFAULT_TEST_IMP_KEY, DEFAULT_TEST_IMP_SECRET\ub97c \ucc38\uace0\ud558\uc138\uc694.\n\n # \uc2e4\uc81c \uc0c1\uc810 \uc815\ubcf4\n iamport = Iamport(imp_key='{\ubc1c\uae09\ubc1b\uc740 \ud0a4}', imp_secret='{\ubc1c\uae09\ubc1b\uc740 \uc2dc\ud06c\ub9bf}')\n\n\n\n\ucc3e\uae30\n------\n\n\uacb0\uc81c\ub97c \uc9c4\ud589\ud55c \uc0c1\ud488 \uc544\uc774\ub514\ub098, \uc804\ub2ec\ubc1b\uc740 IMP \uc544\uc774\ub514\ub97c \uc774\uc6a9\ud574 \uacb0\uc81c \uc815\ubcf4\ub97c \ucc3e\uc2b5\ub2c8\ub2e4.\n\n.. code-block:: python\n\n # \uc0c1\ud488 \uc544\uc774\ub514\ub85c \uc870\ud68c\n response = iamport.find(merchant_uid='{\uc0c1\ud488 \uc544\uc774\ub514}')\n\n # I'mport; \uc544\uc774\ub514\ub85c \uc870\ud68c\n response = iamport.find(imp_uid='{IMP UID}')\n\n\n\uac00\uaca9 \ud655\uc778\n----------\n\n\uc2e4\uc81c \uc81c\ud488 \uac00\uaca9\uacfc \uacb0\uc81c\ub41c \uac00\uaca9\uc774 \uac19\uc740\uc9c0 \ud655\uc778\ud569\ub2c8\ub2e4.\n\n.. code-block:: python\n\n # \uc0c1\ud488 \uc544\uc774\ub514\ub85c \ud655\uc778\n iamport.is_paid(product_price, merchant_uid='{\uc0c1\ud488 \uc544\uc774\ub514}')\n\n # I'mport; \uc544\uc774\ub514\ub85c \ud655\uc778\n iamport.is_paid(product_price, imp_uid='{IMP UID}')\n\n # \uc774\ubbf8 \ucc3e\uc740 response \uc7ac\ud65c\uc6a9\ud558\uc5ec \ud655\uc778\n iamport.is_paid(product_price, response=response)\n\n\n\ucde8\uc18c\n------\n\n\uacb0\uc81c\ub97c \ucde8\uc18c\ud569\ub2c8\ub2e4.\n\n.. code-block:: python\n\n # \uc0c1\ud488 \uc544\uc774\ub514\ub85c \ucde8\uc18c\n response = iamport.cancel(u'\ucde8\uc18c\ud558\ub294 \uc774\uc720', merchant_uid='{\uc0c1\ud488 \uc544\uc774\ub514}')\n\n # I'mport; \uc544\uc774\ub514\ub85c \ucde8\uc18c\n response = iamport.cancel(u'\ucde8\uc18c\ud558\ub294 \uc774\uc720', imp_uid='{IMP UID}')\n\n # \ucde8\uc18c\uc2dc \uc624\ub958 \uc608\uc678\ucc98\ub9ac(\uc774\ubbf8 \ucde8\uc18c\ub41c \uacb0\uc81c\ub294 \uc5d0\ub7ec\uac00 \ubc1c\uc0dd\ud568)\n try:\n response = iamport.cancel(u'\ucde8\uc18c\ud558\ub294 \uc774\uc720', imp_uid='{IMP UID}')\n except Iamport.ResponseError as e:\n print e.code\n print e.message # \uc5d0\ub7ec\ub09c \uc774\uc720\ub97c \uc54c \uc218 \uc788\uc74c\n except Iamport.HttpError as http_error:\n print http_error.code\n print http_error.reason # HTTP not 200 \uc5d0\ub7ec\ub09c \uc774\uc720\ub97c \uc54c \uc218 \uc788\uc74c\n\n\ube44\uc778\uc99d \uacb0\uc81c\n-------------\n\n1\ud68c\uc131 \ube44\uc778\uc99d \uacb0\uc81c\ub97c \uc9c4\ud589\ud569\ub2c8\ub2e4.\n\n.. code-block:: python\n\n # \ud14c\uc2a4\ud2b8\uc6a9 \uac12\n payload = {\n 'merchant_uid': '00000000',\n 'amount': 5000,\n 'card_number': '4092-0230-1234-1234',\n 'expiry': '2019-03',\n 'birth': '500203',\n 'pwd_2digit': '19'\n }\n try:\n response = iamport.pay_onetime(**payload)\n except KeyError:\n # \ud544\uc218 \uac12\uc774 \uc5c6\uc744\ub54c \uc5d0\ub7ec \ucc98\ub9ac\n pass\n except Iamport.ResponseError as e:\n # \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n except Iamport.HttpError as http_error:\n # HTTP not 200 \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n\n\uc800\uc7a5\ub41c \ube4c\ub9c1\ud0a4\ub85c \uc7ac\uacb0\uc81c\ud569\ub2c8\ub2e4.\n\n.. code-block:: python\n\n # \ud14c\uc2a4\ud2b8\uc6a9 \uac12\n payload = {\n 'customer_uid': '{\uace0\uac1d \uc544\uc774\ub514}',\n 'merchant_uid': '00000000',\n 'amount': 5000,\n }\n try:\n response = iamport.pay_again(**payload)\n except KeyError:\n # \ud544\uc218 \uac12\uc774 \uc5c6\uc744\ub54c \uc5d0\ub7ec \ucc98\ub9ac\n pass\n except Iamport.ResponseError as e:\n # \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n except Iamport.HttpError as http_error:\n # HTTP not 200 \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n\n\uc815\uae30 \uc608\uc57d \uacb0\uc81c\n----------------\n\n\uc815\uae30 \uacb0\uc81c\ub97c \uc608\uc57d\ud569\ub2c8\ub2e4.\n\n.. code-block:: python\n\n # \ud14c\uc2a4\ud2b8\uc6a9 \uac12\n payload = {\n 'customer_uid': '{\uace0\uac1d \uc544\uc774\ub514}',\n 'schedules': [\n {\n 'merchant_uid': 'test_merchant_01',\n # UNIX timestamp\n\t 'schedule_at': 1478150985,\n\t 'amount': 1004\n },\n {\n 'merhcant_uid': 'test_merchant_02',\n\t # UNIX timestamp\n\t 'schedule_at': 1478150985,\n\t 'amount': 5000,\n\t 'name': '{\uc8fc\ubb38\uba85}',\n\t 'buyer_name': '{\uc8fc\ubb38\uc790\uba85}',\n\t 'buyer_email': '{\uc8fc\ubb38\uc790 \uc774\uba54\uc77c}',\n\t 'buyer_tel': '{\uc8fc\ubb38\uc790 \uc804\ud654\ubc88\ud638}',\n\t 'buyer_addr': '{\uc8fc\ubb38\uc790 \uc8fc\uc18c}',\n\t 'buyer_postcode': '{\uc8fc\ubb38\uc790 \uc6b0\ud3b8\ubc88\ud638}',\n },\n ]\n }\n try:\n reponse = iamport.pay_schedule(**payload)\n except KeyError:\n # \ud544\uc218 \uac12\uc774 \uc5c6\uc744\ub54c \uc5d0\ub7ec \ucc98\ub9ac\n pass\n except Iamport.ResponseError as e:\n # \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n except Iamport.HttpError as http_error:\n # HTTP not 200 \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n\n\uc815\uae30 \uacb0\uc81c \uc608\uc57d\uc744 \ucde8\uc18c\ud569\ub2c8\ub2e4.\n\n.. code-block:: python\n\n # \ud14c\uc2a4\ud2b8\uc6a9 \uac12 (merchant_uid \uac00 \ub204\ub77d\ub418\uba74 customer_uid \uc5d0 \ub300\ud55c \uacb0\uc81c\uc608\uc57d\uc815\ubcf4 \uc77c\uad04\ucde8\uc18c)\n payload = {\n 'customer_uid': '{\uace0\uac1d \uc544\uc774\ub514}',\n 'merchant_uid': 'test_merchant_01',\n }\n try:\n response = iamport.pay_unschedule(**payload)\n except KeyError:\n # \ud544\uc218 \uac12\uc774 \uc5c6\uc744\ub54c \uc5d0\ub7ec \ucc98\ub9ac\n pass\n except Iamport.ResponseError as e:\n # \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n except Iamport.HttpError as http_error:\n # HTTP not 200 \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n\n\uacb0\uc81c \uc0ac\uc804 \uac80\uc99d\n----------------\n\n\uacb0\uc81c\ub420 \ub0b4\uc5ed\uc5d0 \ub300\ud55c \uc0ac\uc804\uc815\ubcf4\ub97c \ub4f1\ub85d\ud569\ub2c8\ub2e4\n\n.. code-block:: python\n\n # \ud14c\uc2a4\ud2b8\uc6a9 \uac12\n amount = 12000\n mid = 'merchant_test'\n try:\n response = iamport.prepare(amount=amount, merchant_uid=mid)\n except Iamport.ResponseError as e:\n # \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n except Iamport.HttpError as http_error:\n # HTTP not 200 \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n\n\ub4f1\ub85d\ub41c \uc0ac\uc804\uc815\ubcf4\ub97c \ud655\uc778\ud569\ub2c8\ub2e4\n\n.. code-block:: python\n\n # \ud14c\uc2a4\ud2b8\uc6a9 \uac12\n amount = 12000\n mid = 'merchant_test'\n try:\n result = iamport.prepare_validate(merchant_uid=mid, amount=amount)\n except Iamport.ResponseError as e:\n # \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n except Iamport.HttpError as http_error:\n # HTTP not 200 \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n\n\n\uce74\ub4dc\uc815\ubcf4 \ub4f1\ub85d\n----------------\n\n\uacb0\uc81c \uc5c6\uc774 \uce74\ub4dc \uc815\ubcf4\ub97c \ub4f1\ub85d\ud569\ub2c8\ub2e4\n\n.. code-block:: python\n\n # \ud14c\uc2a4\ud2b8\uc6a9 \uac12\n payload = {\n 'customer_uid': '{\uace0\uac1d \uc544\uc774\ub514}',\n 'card_number': '4092-0230-1234-1234',\n 'expiry': '2019-03',\n 'birth': '500203',\n 'pwd_2digit': '19' # \ubc95\uc778\uc77c\ub550 \uc0dd\ub7b5 \uac00\ub2a5\n }\n try:\n response = iamport.customer_create(**payload)\n except Iamport.ResponseError as e:\n # \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n except Iamport.HttpError as http_error:\n # HTTP not 200 \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n\n\ub4f1\ub85d\ub41c \uce74\ub4dc \uc815\ubcf4(=\ube4c\ub9c1\ud0a4)\ub97c \uc694\uccad\ud569\ub2c8\ub2e4\n\n.. code-block:: python\n\n # \ud14c\uc2a4\ud2b8\uc6a9 \uac12\n customer_uid = '{\uace0\uac1d \uc544\uc774\ub514}'\n try:\n response = iamport.customer_get(customer_uid)\n except Iamport.ResponseError as e:\n # \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n except Iamport.HttpError as http_error:\n # HTTP not 200 \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n\n\n\uad6c\ub9e4\uc790\uc758 \ube4c\ub9c1\ud0a4 \uc815\ubcf4\ub97c \uc0ad\uc81c \ud569\ub2c8\ub2e4\n\n.. code-block:: python\n\n # \ud14c\uc2a4\ud2b8\uc6a9 \uac12\n customer_uid = '{\uace0\uac1d \uc544\uc774\ub514}'\n try:\n response = iamport.customer_delete(customer_uid)\n except Iamport.ResponseError as e:\n # \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n except Iamport.HttpError as http_error:\n # HTTP not 200 \uc751\ub2f5 \uc5d0\ub7ec \ucc98\ub9ac\n pass\n\n\n\uac1c\ubc1c\ud658\uacbd \ubc0f \ud14c\uc2a4\ud2b8 \uc124\uc815\n==========================\nmacOS \uae30\uc900\n\n.. code-block:: bash\n\n pip install -r requirements.txt\n pytest\n\n\n\ud560 \uc77c\n======\n- \uacb0\uc81c \ubaa9\ub85d \uc77d\uae30\n- \ubb38\uc11c\ud654\n- \uae30\ud0c0 \ub4f1\ub4f1", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/james-song/iamport-rest-client-python3", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "iamport-rest-client2", "package_url": "https://pypi.org/project/iamport-rest-client2/", "platform": "", "project_url": "https://pypi.org/project/iamport-rest-client2/", "project_urls": { "Homepage": "https://github.com/james-song/iamport-rest-client-python3" }, "release_url": "https://pypi.org/project/iamport-rest-client2/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "REST client for I'mport;(http://www.iamport.kr)", "version": "0.0.2" }, "last_serial": 4290840, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b3b977d3d5a7d999e7c88b81b4ab0ebc", "sha256": "2ff54c655a9b3f800141ef0bf28a685ed74a85d0e1f19329f06d1b31d1c199b7" }, "downloads": -1, "filename": "iamport-rest-client2-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b3b977d3d5a7d999e7c88b81b4ab0ebc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8321, "upload_time": "2018-07-12T14:41:57", "url": "https://files.pythonhosted.org/packages/46/49/df13a9e566ede1b53466e49f482efe40cb4d38deb5bc60cb20bdee7f578d/iamport-rest-client2-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "241ebab619638d810d29837404e2a167", "sha256": "764bb62ec29734848a8d774bdbc8b5a0bb6af825be2a4643a8840a57bb3adba3" }, "downloads": -1, "filename": "iamport-rest-client2-0.0.2.tar.gz", "has_sig": false, "md5_digest": "241ebab619638d810d29837404e2a167", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8720, "upload_time": "2018-09-20T00:56:16", "url": "https://files.pythonhosted.org/packages/5c/98/7a8ad9b81c5d45c5dfddee391abf13dc45c8711a94b4b5ac318a98f3b668/iamport-rest-client2-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "241ebab619638d810d29837404e2a167", "sha256": "764bb62ec29734848a8d774bdbc8b5a0bb6af825be2a4643a8840a57bb3adba3" }, "downloads": -1, "filename": "iamport-rest-client2-0.0.2.tar.gz", "has_sig": false, "md5_digest": "241ebab619638d810d29837404e2a167", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8720, "upload_time": "2018-09-20T00:56:16", "url": "https://files.pythonhosted.org/packages/5c/98/7a8ad9b81c5d45c5dfddee391abf13dc45c8711a94b4b5ac318a98f3b668/iamport-rest-client2-0.0.2.tar.gz" } ] }