{"id":15728604,"url":"https://github.com/juniors90/flask-mercadopago","last_synced_at":"2025-05-13T04:54:43.982Z","repository":{"id":49829179,"uuid":"518287197","full_name":"juniors90/Flask-Mercadopago","owner":"juniors90","description":"Implementation of Mercado Pago OAuth in Flask.","archived":false,"fork":false,"pushed_at":"2023-02-12T22:16:05.000Z","size":978,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T04:54:37.435Z","etag":null,"topics":["flask","mercadopago","mercadopago-api","oauth","oauth1","python","python3","requests"],"latest_commit_sha":null,"homepage":"https://flask-mercadopago.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juniors90.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-27T02:51:01.000Z","updated_at":"2025-01-13T14:49:38.000Z","dependencies_parsed_at":"2024-10-24T21:22:14.151Z","dependency_job_id":"fc57dca0-3002-4f40-9ab0-c8265054c5d2","html_url":"https://github.com/juniors90/Flask-Mercadopago","commit_stats":{"total_commits":54,"total_committers":2,"mean_commits":27.0,"dds":"0.31481481481481477","last_synced_commit":"baf630ab467b0ddcf34a2c24723a5e9391229c25"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniors90%2FFlask-Mercadopago","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniors90%2FFlask-Mercadopago/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniors90%2FFlask-Mercadopago/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniors90%2FFlask-Mercadopago/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juniors90","download_url":"https://codeload.github.com/juniors90/Flask-Mercadopago/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253877505,"owners_count":21977643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","mercadopago","mercadopago-api","oauth","oauth1","python","python3","requests"],"created_at":"2024-10-03T23:04:34.464Z","updated_at":"2025-05-13T04:54:43.957Z","avatar_url":"https://github.com/juniors90.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask-Mercadopago\n\n![PyPI](https://img.shields.io/pypi/v/Flask-Mercadopago)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/Flask-Mercadopago)\n[![codecov](https://codecov.io/gh/juniors90/Flask-Mercadopago/branch/main/graph/badge.svg?token=ePNLhWhSV7)](https://codecov.io/gh/juniors90/Flask-Mercadopago)\n![docstr-cov](https://img.shields.io/endpoint?url=https://api.jsonbin.io/v3/b/62e15eac8ebcdb758843f9af?meta=false)\n[![Build status](https://github.com/juniors90/Flask-Mercadopago/actions/workflows/main.yml/badge.svg)](https://github.com/juniors90/Flask-Mercadopago/actions)\n[![Documentation Status](https://readthedocs.org/projects/flask-mercadopago/badge/?version=latest)](https://flask-mercadopago.readthedocs.io/en/latest/?badge=latest)\n[![GitHub issues](https://img.shields.io/github/issues/juniors90/Flask-Mercadopago)](https://github.com/juniors90/Flask-Mercadopago/issues)\n[![GitHub forks](https://img.shields.io/github/forks/juniors90/Flask-Mercadopago)](https://github.com/juniors90/Flask-Mercadopago/network)\n[![GitHub stars](https://img.shields.io/github/stars/juniors90/Flask-Mercadopago)](https://github.com/juniors90/Flask-Mercadopago/stargazers)\n[![GitHub license](https://img.shields.io/github/license/juniors90/Flask-Mercadopago)](https://github.com/juniors90/Flask-Mercadopago/blob/main/LICENSE)\n[![GitHub contributors](https://img.shields.io/github/contributors/juniors90/Flask-Mercadopago?color=green)](https://github.com/juniors90/Flask-Mercadopago/graphs/contributors)\n[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nFlask-Mercadopago is a collection of methods for the implementation of Mercado Pago OAuth in Flask.\n\n## Features\n\n- [x] [Authentication generation](https://www.mercadopago.com.ar/developers/en/reference/oauth/_oauth_token/post).\n- [x] [Preference generation](https://www.mercadopago.com.ar/developers/en/reference/preferences/_checkout_preferences/post).\n- [x] [Checkout Pro integration](https://www.mercadopago.com.ar/developers/en/docs/checkout-pro/landing).\n\n\n## Requirements\n\nPython 3.8+\n\n## Dependecies for this project.\n\n- [Flask(\u003e=2.0.1)](https://flask.palletsprojects.com/en/2.0.x/) for build the backend.\n- [Requests](https://requests.readthedocs.io/en/latest/) for build the backend.\n- [mercadopago](https://github.com/mercadopago/sdk-python) for build the backend.\n\n## intallation\n\nYou can install via pip:\n\n```cmd\n    $\u003e pip install Flask-Mercadopago\n```\n\n## Example\n\nRegister the extension:\n\n```python\nfrom datetime import datetime\nfrom flask import Flask, jsonify\n# To follow the naming rule of Flask extension, although\n# this project's name is Flask-Mercadopago, the actual package\n# installed is named `flask_mercadopago`.\nfrom flask_mercadopago import Mercadopago\n\napp = Flask(__name__)\napp.config[\"APP_ACCESS_TOKEN\"]=\"APP_USR-558881221729581-091712-44fdc612e60e3e638775d8b4003edd51-471763966\"\nmercadopago = Mercadopago(app)\n\n@app.route(\"/\")\ndef index():\n    card_token_object = {\n        \"card_number\": \"4074090000000004\",\n        \"security_code\": \"123\",\n        \"expiration_year\": datetime.now().strftime(\"%Y\"),\n        \"expiration_month\": \"12\",\n        \"cardholder\": {\n            \"name\": \"APRO\",\n            \"identification\": {\"CPF\": \"19119119100\"},\n        },\n    }\n\n    card_token_created = mercadopago.card_token().create(card_token_object)\n\n    payment_data = {\n        \"transaction_amount\": 100,\n        \"token\": card_token_created[\"response\"][\"id\"],\n        \"description\": \"Payment description\",\n        \"payment_method_id\": 'visa',\n        \"installments\": 1,\n        \"payer\": {\n            \"email\": 'test_user_123456@testuser.com'\n        }\n    }\n    result = mercadopago.payment().create(payment_data)\n    payment = result[\"response\"]\n    return jsonify(payment) \n\nif __name__ == '__main__':\n    app.run(host=\"0.0.0.0\", port=5000, debug=True)\n```\n\n## Recommended running instructions for dev:\n\n1. Create a virtual environment:\n\n    ```shell script\n    $\u003e python3 -m venv venv\n    ```\n\n2. Activate the newly created environment:\n\n   On macOS and Linux:\n    ```shell script\n    $\u003e source venv/bin/activate\n    ```\n   \n   On Windows\n   ```\n   c:\\\u003e .\\env\\Scripts\\activate\n   ```\n\n3. Install dependencies:\n\n    ```shell script\n    $\u003e (venv) python -m pip install -r requirements/dev.txt\n    ```\n\n4. Start the sample app on server locally:\n\n    ```shell script\n    $\u003e (venv) python sample_app/app.py\n    ```\n  \nYou will get a form like this:\n\n![form rendering](https://raw.githubusercontent.com/juniors90/Flask-Mercadopago/main/docs/source/_static/form.png)\n\nWhen the validation, the response data will be rendered with proper style:\n\n![validations](https://raw.githubusercontent.com/juniors90/Flask-Mercadopago/main/docs/source/_static/validations.png)\n    \n## Links\n\n- [Documentation](https://flask-mercadopago.readthedocs.io)\n- [Example Application](https://github.com/juniors90/Flask-Mercadopago/tree/main/sample_app)\n- [PyPI Releases](https://pypi.org/project/Flask-Mercadopago/)\n- [Changelog](https://github.com/juniors90/Flask-Mercadopago/blob/main/CHANGELOG.rst)\n\n## Authors\n\n- Ferreira, Juan David\n\nPlease submit bug reports, suggestions for improvements and patches via\nthe (E-mail: juandavid9a0@gmail.com).\n\n## Contributors\n\nCredits goes to these peoples:\n\n\u003ca href=\"https://github.com/juniors90/Flask-Mercadopago/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=juniors90/Flask-Mercadopago\" /\u003e\n\u003c/a\u003e\n\n## Official repository and Issues\n\n- https://github.com/juniors90/Flask-Mercadopago\n\n\n## License\n\n`Flask-Mercadopago` is free software you can redistribute it and/or modify it\nunder the terms of the MIT License. For more information, you can see the\n[LICENSE](https://github.com/juniors90/Flask-Mercadopago/blob/main/LICENSE) file\nfor details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniors90%2Fflask-mercadopago","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuniors90%2Fflask-mercadopago","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniors90%2Fflask-mercadopago/lists"}