{ "info": { "author": "Roberto Neves", "author_email": "robertonsilva@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Natural Language :: Portuguese (Brazilian)", "Programming Language :: Python :: 3.6" ], "description": "# Wirecard API v2 Wrapper - Python3\n\nIntegra\u00e7\u00e3o com a API v2 de pagamentos e notifica\u00e7\u00f5es da Wirecard utilizando requests.\n\nConsulte a documenta\u00e7\u00e3o oficial e as [refer\u00eancias API v2 Wirecard](https://dev.wirecard.com.br/reference)\n\n\n# Instala\u00e7\u00e3o\nInstala\u00e7\u00e3o utilizando Pip\n```bash\npip install py3wirecard\n```\nGit/Clone\n```\ngit clone https://github.com/robertons/py3wirecard\ncd py3wirecard\npip install -r requirements.txt\npython setup.py install\n```\n\n## Configura\u00e7\u00e3o\n\n```python\nimport py3wirecard\n\nWireCard(\"API TOKEN\", \"API KEY\",sandbox=True)\n```\n## Cliente\n\n**Cadastro**\n\n```python\ncliente = Customer()\ncliente.ownId = \"1201\"\ncliente.fullname = \"Fulando da Silva\"\ncliente.email = \"fulano@email.com\"\ncliente.birthDate = datetime(1980,1,1)\ncliente.taxDocument = TaxDocument(type=\"CPF\", number = \"000000000\")\ncliente.shippingAddress = Address(street= \"Nome da Rua\", streetNumber=\"01\", complement=\"SN\", district=\"Bairro\", city=\"Cidade\", state=\"UF\", zipCode=00000000, country=\"BRA\")\ncliente.phone = Phone(countryCode=55, areaCode=11, number=999999999)\ncliente.create()\n```\n**Consulta**\n\n```python\ncliente = Customer().get(\"CUS-PCVTIJ37EWBZ\")\n```\n**Lista**\n\n```python\nclientes = Customer().list()\n```\n**Atualiza\u00e7\u00e3o**\n\nPara atualizar um cliente basta criar um novo pedido com os dados do cliente existente informando seu id ou ownId.\n\n## Pedido\n\n**Cadastro**\n\n```python\ncompra = Order()\ncompra.ownId = \"1234\"\ncompra.amount = Amount()\ncompra.items.append(Product(product=\"Nome Produto\", detail=\"Descri\u00e7\u00e3o Produto\", quantity=1, price=23999))\ncompra.customer = Customer()\ncompra.customer.ownId = \"1201\"\ncompra.customer.fullname = \"Fulando da Silva\"\ncompra.customer.email = \"fulano@email.com\"\ncompra.customer.birthDate = datetime(1980,1,1)\ncompra.customer.taxDocument = TaxDocument(type=\"CPF\", number = \"000000000\")\ncompra.customer.shippingAddress = Address(street= \"Nome da Rua\", streetNumber=\"01\", complement=\"SN\", district=\"Bairro\", city=\"Cidade\", state=\"UF\", zipCode=00000000, country=\"BRA\")\ncompra.customer.phone = Phone(countryCode=55, areaCode=11, number=999999999)\ncompra.shippingAddress = Address(street= \"Nome da Rua\", streetNumber=\"01\", complement=\"SN\", district=\"Bairro\", city=\"Cidade\", state=\"UF\", zipCode=00000000, country=\"BRA\")\ncompra.create()\n```\n\n**Consulta**\n\n```python\ncompra = Order().get(\"ORD-01KHBJSQ9QB0\")\n```\n\n## Pagamento\n\n```python\npagamento = Payment()\npagamento.fundingInstrument = FundingInstrument(method = \"CREDIT_CARD\")\n```\nCart\u00e3o de Cr\u00e9dito **(hash)**\n```python\npagamento.fundingInstrument.creditCard = CreditCard(hash = \"HASH...\", holder = Holder(fullname = \"Fulando da Silva\", TaxDocument(type=\"CPF\", number = \"000000000\"), phone = Phone(countryCode=55, areaCode=11, number=999999999), birthdate = datetime(1980,1,1)))\n```\n\nCart\u00e3o de Cr\u00e9dito **(dados)** *(Necess\u00e1rio certifica\u00e7\u00e3o PCI)*\n```python\npagamento.fundingInstrument.creditCard = CreditCard(number=\"5555666677778884\", expirationMonth=\"06\", expirationYear=\"2022\", cvc=\"123\", holder = Holder(fullname = \"Fulando da Silva\", TaxDocument(type=\"CPF\", number = \"000000000\"), phone = Phone(countryCode=55, areaCode=11, number=999999999), birthdate = datetime(1980,1,1)))\n```\nEnvio do Pagamento\n```python\npagamento.create(order_id=\"ORD-01F0UADQ9QB0\")\n```\n**Consulta**\n\n```python\npagamento = Payment().get(\"PAY-1A24BB9K8DX4\")\n```\n## Reembolso\n**Completo de Pagamento**\n```python\nreembolso = Refund().create(\"PAY-1W24IB9J0DX4\")\n```\n**Parcial de Pagamento**\n```python\nreembolso = Refund().create(\"PAY-U67EYCMPR8C4\", amount=1000)\n```\n**Completo de Compra**\n```python\nreembolso = Refund().create(\"ORD-01F8CQ9QB0\")\n```\n**Parcial de Compra**\n```python\nreembolso = Refund().create(\"ORD-01F8CQ9QB0\", amount=1000)\n```\n**Consulta**\n```python\nreembolso = Refund().get(\"REF-VRK1K0N6GOXA\")\n```\n## Notifica\u00e7\u00f5es\n\n**Cadastro de Prefer\u00eancias de Notifica\u00e7\u00f5es**\n```python\nnotificacoes.events = [\n \"ORDER.*\",\n \"PAYMENT.AUTHORIZED\",\n \"PAYMENT.CANCELLED\"\n ]\nnotificacoes.target = \"https://myapi.com/notifications\"\nnotificacoes.media = \"WEBHOOK\"\nnotificacoes.create()\n```\n**Consulta**\n```python\nnotificacao = Notification().get(\"NPR-S1VEAS06KBAXA\")\n```\n**Lista Prefer\u00eancias de Notifica\u00e7\u00f5es**\n```python\nnotificacoes = Notification().list()\n```\n**Excluir Prefer\u00eancias de Notifica\u00e7\u00f5es**\n```python\nNotification().delete(\"NPR-U18BA1ME2MTB\")\n```\n## Webhooks\n**Consultar Webhooks enviados com C\u00f3digo Identificador do Evento**\n```python\nwebhooks = WebHooks().get(\"ORD-01F0UJSQ9QB0\")\n```\n**Consultar Todos Webhooks enviados**\n```python\nwebhooks = WebHooks().get()\n```\n**Reenviar Webhook**\n```python\nwebhook = WebHooks().resend(resource_id=\"PAY-U67EYHGCR8C4\", event=\"PAYMENT.AUTHORIZED\")\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/robertons/py3wirecard", "keywords": "wirecard,payment,payments,credit-card,boleto,moip", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "py3wirecard", "package_url": "https://pypi.org/project/py3wirecard/", "platform": "", "project_url": "https://pypi.org/project/py3wirecard/", "project_urls": { "Homepage": "https://github.com/robertons/py3wirecard" }, "release_url": "https://pypi.org/project/py3wirecard/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "Wirecard API v2 Wrapper", "version": "0.0.3" }, "last_serial": 5788463, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c2d647f8cafebad36990775fa4ce12d7", "sha256": "e85ba019d185543e39da5e3bb351523b6ce062834866fe8a14cd69013116ed01" }, "downloads": -1, "filename": "py3wirecard-0.0.1.tar.gz", "has_sig": false, "md5_digest": "c2d647f8cafebad36990775fa4ce12d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5775, "upload_time": "2019-09-05T19:40:41", "url": "https://files.pythonhosted.org/packages/11/66/15fdd98a59e2cf3534226e70fb7d3e4ed049fc1e68467cd90ad6908c76a3/py3wirecard-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "cd7013bf2a3d505d5d42cb2bfca3c20a", "sha256": "ab9b308e8904be401cc1efc9cba51c54120ea49ca7a68135520ca28c1672ac7e" }, "downloads": -1, "filename": "py3wirecard-0.0.2.tar.gz", "has_sig": false, "md5_digest": "cd7013bf2a3d505d5d42cb2bfca3c20a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5765, "upload_time": "2019-09-05T20:39:02", "url": "https://files.pythonhosted.org/packages/24/ce/6dd4c835966429a8582b66076c133e3de188da35921a646be77eead6de1a/py3wirecard-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "908b88c1301519ca3a325e720597481f", "sha256": "27218702975867c49a84192918aecefdc0c619555caff831bd8f08833e12bac4" }, "downloads": -1, "filename": "py3wirecard-0.0.3.tar.gz", "has_sig": false, "md5_digest": "908b88c1301519ca3a325e720597481f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14165, "upload_time": "2019-09-05T21:11:51", "url": "https://files.pythonhosted.org/packages/6f/b8/bde6c0fcb6e0c2a773aa971d8fdba298729fad828897eff73d8b07c675db/py3wirecard-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "908b88c1301519ca3a325e720597481f", "sha256": "27218702975867c49a84192918aecefdc0c619555caff831bd8f08833e12bac4" }, "downloads": -1, "filename": "py3wirecard-0.0.3.tar.gz", "has_sig": false, "md5_digest": "908b88c1301519ca3a325e720597481f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14165, "upload_time": "2019-09-05T21:11:51", "url": "https://files.pythonhosted.org/packages/6f/b8/bde6c0fcb6e0c2a773aa971d8fdba298729fad828897eff73d8b07c675db/py3wirecard-0.0.3.tar.gz" } ] }