{ "info": { "author": "Wonwoo, lee", "author_email": "bluedisk@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django :: 2.0", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only" ], "description": "Django-Iamport\n==============\n\nIamport Application for Django\n\n\uc7a5\uace0\uc6a9 \uc544\uc784\ud3ec\ud2b8 \ud3ec\ud305 \uc785\ub2c8\ub2e4. \uc544\uc9c1 \uce74\ub4dc \uacb0\uc81c\ub9cc \ub3d9\uc791 \ud655\uc778 \ub418\uc5c8\uc2b5\ub2c8\ub2e4.\n\nInstall\n=======\n\n1. pip install django-iamport\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n2. setting.py \uc218\uc815\n~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n\n INSTALLED_APPS = [\n ...\n\n\n 'payment.apps.PaymentConfig',\n\n ...\n\n\n PAYMENT_MERCHANT_ID = '\uc544\uc784\ud3ec\ud2b8\uc5d0\uc11c \ubc1c\uae09\ubc1b\uc740 \uc0c1\uc810 ID'\n\n PAYMENT_REST_KEY = '\uc544\uc784\ud3ec\ud2b8\uc5d0\uc11c \ubc1c\uae09 \ubc1b\uc740 REST KEY'\n PAYMENT_REST_SECRET = '\uc544\uc784\ud3ec\ud2b8\uc5d0\uc11c \ubc1c\uae09 \ubc1b\uc740 REST SECRET'\n\n PAYMENT_MODEL = 'shop.OrderPayment' # Payment\ub97c \uc0c1\uc18d \ubc1b\uc740 \uc8fc\ubb38 \ubaa8\ub378\n\n # \uc544\uc784\ud3ec\ud2b8 \uc804\ub2ec \ud30c\ub77c\uba54\ud130(\uadf8\ub300\ub85c \uc544\uc784\ud3ec\ud2b8 \ubaa8\ub4c8\uc5d0 \uc804\ub2ec \ub429\ub2c8\ub2e4)\n # IMP.request_pay() \ud30c\ub77c\uba54\ud130 : \n\n PAYMENT_CONFIG = { \n 'company': '\uc6b0\ub9ac \ud68c\uc0ac', # PG\ud45c\uae30 \ud68c\uc0ac\uba85 \n 'pg': 'html5_inicis', # PG \uc885\ub958 (\uc544\uc784\ud3ec\ud2b8 \uc124\uc815)\n 'pay_method': 'card' # \uacb0\uc81c \ubc29\ubc95\n }\n\n\ud30c\ub77c\uba54\ud130\ub294 `IMP.request\\_pay()\n\ud30c\ub77c\uba54\ud130 `__\n\ucc38\uc870)\n\n3. URL \uc120\uc5b8 \ud3ec\ud568\ud558\uae30\n~~~~~~~~~~~~~~~~~~~~\n\n\ub8e8\ud2b8 urls.py \uc0c1\uc5d0 \ub2e4\uc74c \ub77c\uc778 \ud3ec\ud568\n\n.. code:: python\n\n urlpatterns = [\n\n ...\n\n path('payment/', include('payment.urls')),\n \n ...\n ]\n\n4. Payment \ubaa8\ub378 \uc0c1\uc18d\ud558\uae30\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nPayment \ubaa8\ub378\uc744 \uc0c1\uc18d \ubc1b\uc544\uc11c \uc2e4\uc81c\ub85c \uc0ac\uc6a9\ud560 \uacb0\uc81c \uc815\ubcf4 \ubaa8\ub378\uc744 \ub9cc\ub4e4\uc5b4\uc57c\n\ub429\ub2c8\ub2e4. Payment\ub294 \ub2e4\uc74c\uacfc \uac19\uc774 \ucd94\uc0c1 \ubaa8\ub378\ub85c \uc120\uc5b8 \ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4.\n\n.. code:: python\n\n class Payment(models.Model):\n\n class Meta:\n abstract = True\n\n def __str__(self):\n return \"%s-%s%s-\" % (self.buyer_name, self.amount, self.name)\n\n name = models.CharField('\uc8fc\ubb38\uba85', max_length=100)\n\n ... \uc911\uac04 \uc0dd\ub7b5 ...\n\n card_id = models.CharField('\uce74\ub4dc\uc2b9\uc778\ubc88\ud638', max_length=50, null=True, blank=True)\n\n receipt_url = models.URLField('\uc601\uc218\uc99d URL', null=True, blank=True)\n\n @staticmethod\n def from_order(order, pay_type):\n raise NotImplementedError()\n\n def on_success(self):\n raise NotImplementedError()\n\nPayment \ucd94\uc0c1 \ubaa8\ub378\uc744 \uc0c1\uc18d \ubc1b\uc740 \ub2e4\uc74c \ud544\uc694\ud55c \ud544\ub4dc\ub4e4\uc744 \ucd94\uac00\ud574\uc11c \uc0ac\uc6a9\uc790\n\ubaa8\ub378\uc744 \ub9cc\ub4ed\ub2c8\ub2e4.\n\nPayment\ub97c \uc0c1\uc18d\ubc1b\uc740 \uc608\uc81c\n\n.. code:: python\n\n class OrderPayment(Payment):\n\n class Meta:\n verbose_name = \"\uc81c\ud488 \uacb0\uc81c\"\n verbose_name_plural = \"\uc81c\ud488 \uacb0\uc81c \ubaa9\ub85d\"\n\n order = models.ForeignKey(Apply, on_delete=models.SET_NULL, null=True, related_name='payments')\n\n @staticmethod\n def from_order(order):\n\n payment = OrderPayment()\n payment.name = '\uc6b0\ub9ac\uc0c1\uc810 : %s %s' % order.name\n payment.order = order\n\n payment.amount = order.roomtype.price\n\n payment.buyer_email = order.email\n payment.buyer_name = order.name\n payment.buyer_tel = order.cell\n payment.buyer_addr = order.addr + \" \" + order.subaddr\n payment.buyer_postcode = order.postcode\n payment.save()\n\n # ID \uc0dd\uc131\ud558\uae30\n if settings.DEBUG:\n prefix = \"myshop_debug\"\n else:\n prefix = \"myshop\"\n\n now = timezone.localtime(timezone.now())\n now = now.strftime('%Y%m%d_%H%M%S')\n\n payment.uid = \"%s_%s_%s\" % (prefix, now, payment.pk)\n payment.save()\n\n return payment\n\n # \uacb0\uc81c \uc644\ub8cc \ud6c4\ucc98\ub9ac \ud558\uae30(\uc644\ub8cc \uc2dc \ud638\ucd9c \ub429\ub2c8\ub2e4)\n def on_success(self):\n self.order.pay_status = 'confirmed'\n self.order.save()\n\n # \uacb0\uc81c \uc7ac\uc2dc\ub3c4 URL\n def get_retry_url(self):\n return reverse('myshop:retry_order', args=[self.order.pk])\n\n # \uacb0\uc81c \ud6c4 \uc774\ub3d9 \ud560 Home URL\n def get_home_url(self):\n return '/' \n\n5. \uacb0\uc81c \uc2dc\uc791\ud558\uae30\n~~~~~~~~~~~~~~~~\n\n\uc0c1\uc18d\ubc1b\uc740 \ubaa8\ub378(\uc5ec\uae30\uc120 OrderPayment)\uc758 \uc778\uc2a4\ud134\uc2a4\ub97c \uc0dd\uc131, \uc800\uc7a5\ud55c \ud6c4 \ud574\ub2f9\npk\ub97c args\ub85c 'payment:pay' \ubdf0\ub97c \ud638\ucd9c\ud558\uba74 \uacb0\uc81c \ud504\ub85c\uc138\uc2a4\uac00 \uc9c4\ud589 \ub429\ub2c8\ub2e4.\n\nex:\n\n::\n\n def pay_start(request):\n payment = OrderPayment.from_order(order_info)\n return HttpResponseRedirect(reverse('payment:pay', args=[payment.pk]))\n\n6. Template \uc0ac\uc6a9\uc790\ud654 \ud558\uae30\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\ubaa8\ub4e0 \ubdf0 \ud15c\ud50c\ub9bf\uc740 templates/site\\_base.html \ub97c \uc0c1\uc18d \ud569\ub2c8\ub2e4.\nsite\\_base.html\ub97c Override\ud574\uc11c \uc0ac\uc6a9\uc790 \ud15c\ud50c\ub9bf\uc744 \uc120\uc5b8\ud558\uc2dc\uba74 \ub429\ub2c8\ub2e4.\n\n- \uc8fc\uc758 : \uc11c\ube0c \ud15c\ud50c\ub9bf\ub4e4\uc740 jQuery\uac00 site\\_base.html \uc0c1\uc5d0 \ud3ec\ud568\ub41c\uac83\uc73c\ub85c\n \uac04\uc8fc\ud569\ub2c8\ub2e4.\n\nTODO\n====\n\n- [STRIKEOUT:REST prepare call]\n- [STRIKEOUT:card]\n- notification\n- vbank\n- \ud6c4\ucc98\ub9ac \uc2e4\ud328\uc2dc \ucc98\ub9ac\n- \ub2e4\uc911 PG \uc9c0\uc6d0\n- \ub2e4\uc911 \uacb0\uc81c \ubaa8\ub378 \uc9c0\uc6d0", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bluedisk/django-iamport", "keywords": "django iamport korean-pg payment", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-iamport", "package_url": "https://pypi.org/project/django-iamport/", "platform": "", "project_url": "https://pypi.org/project/django-iamport/", "project_urls": { "Homepage": "https://github.com/bluedisk/django-iamport" }, "release_url": "https://pypi.org/project/django-iamport/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "Iamport implementation for Django 2+", "version": "0.2.0" }, "last_serial": 5296422, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "162808759735c18ff876d1d74ba9d5fe", "sha256": "3af136293b5d410f4a14f02b0a037d37bbe2c10b35cb52fdbcb7d3bd364bd0fc" }, "downloads": -1, "filename": "django-iamport-0.1.1.tar.gz", "has_sig": false, "md5_digest": "162808759735c18ff876d1d74ba9d5fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6812, "upload_time": "2018-07-10T13:28:14", "url": "https://files.pythonhosted.org/packages/7f/8e/cc9f877e81d71f32cdab4df2936f922fb396eb5012db0aefc7cb886e69f2/django-iamport-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "37568ab12ec91021ca0d422478c36c6d", "sha256": "3f37c230dcfb301b116eeadc99ce139c95310d28d4c8beb1e95601fc7b000a93" }, "downloads": -1, "filename": "django-iamport-0.1.2.tar.gz", "has_sig": false, "md5_digest": "37568ab12ec91021ca0d422478c36c6d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11448, "upload_time": "2018-07-10T13:42:03", "url": "https://files.pythonhosted.org/packages/11/d5/30d1c1e615eb8d6c5b2c8726740a14111b4fc74eabdc4faf8ba2f1d6c9d3/django-iamport-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "643f102f9b39f9d24ae7c1c7c711232c", "sha256": "f1a3a5b8901ef547429bdbeaf5118a7358d38a541fc5f7ff5362110bd32ea447" }, "downloads": -1, "filename": "django-iamport-0.1.3.tar.gz", "has_sig": false, "md5_digest": "643f102f9b39f9d24ae7c1c7c711232c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11673, "upload_time": "2018-07-10T14:14:25", "url": "https://files.pythonhosted.org/packages/6c/84/0a6625f0b72e6cb74f525fb7312359c749d277ad5a235bd18a03c6e128f9/django-iamport-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "593e3765aa7c1997892feb2e0d533d05", "sha256": "07a637a57f1902362ef847ca2d1093e4789f6818ed037a1f472cbe7990542527" }, "downloads": -1, "filename": "django-iamport-0.2.0.tar.gz", "has_sig": false, "md5_digest": "593e3765aa7c1997892feb2e0d533d05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12316, "upload_time": "2019-05-21T08:15:27", "url": "https://files.pythonhosted.org/packages/9f/80/127b448b605b2a29151596b525cf93841f53b90b757ddc37fca27cff0f76/django-iamport-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "593e3765aa7c1997892feb2e0d533d05", "sha256": "07a637a57f1902362ef847ca2d1093e4789f6818ed037a1f472cbe7990542527" }, "downloads": -1, "filename": "django-iamport-0.2.0.tar.gz", "has_sig": false, "md5_digest": "593e3765aa7c1997892feb2e0d533d05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12316, "upload_time": "2019-05-21T08:15:27", "url": "https://files.pythonhosted.org/packages/9f/80/127b448b605b2a29151596b525cf93841f53b90b757ddc37fca27cff0f76/django-iamport-0.2.0.tar.gz" } ] }