From 9b77fd42aa69571cbb4d59f2d43a9796209f0cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leandro=20E=2E=20Colombo=20Vi=C3=B1a?= Date: Sun, 29 Apr 2018 23:12:44 -0300 Subject: [PATCH] Added support to pipenv --- .env.dist | 6 ++++++ Pipfile | 14 ++++++++++++++ update_mp.py | 12 ++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 Pipfile create mode 100644 update_mp.py diff --git a/.env.dist b/.env.dist index 2a4f60b..f036a83 100644 --- a/.env.dist +++ b/.env.dist @@ -7,3 +7,9 @@ SECRET_KEY=!a44%)(r2!1wp89@ds(tqzpo#f0qgfxomik)a$16v5v@b%)ecu APP_DOMAIN=localhost DJANGO_CONFIGURATION=Prod DJANGO_SETTINGS_MODULE=website.settings +# Get your credentials from Mercado Pago from +# https://www.mercadopago.com/mla/account/credentials +MERCADOPAGO_USER_ID=your-user-id-is-the-application-number +MERCADOPAGO_APPLICATION_ID=your-application-id +MERCADOPAGO_CLIENT_ID=a-bunch-of-numbers-from-mercadopago-account +MERCADOPAGO_CLIENT_SECRET=your-super-secret-mercadopago-key diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..24a8b62 --- /dev/null +++ b/Pipfile @@ -0,0 +1,14 @@ +[[source]] +url = "https://pypi.python.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +django = "==2.0.4" +django-extensions = "==2.0.7" +pillow = "*" + +[dev-packages] + +[requires] +python_version = "3.6" diff --git a/update_mp.py b/update_mp.py new file mode 100644 index 0000000..3e0860a --- /dev/null +++ b/update_mp.py @@ -0,0 +1,12 @@ +import os +from dotenv import load_dotenv +from mercadopago import MP +load_dotenv() + +MERCADOPAGO_CLIENT_ID = os.getenv('MERCADOPAGO_CLIENT_ID') +MERCADOPAGO_CLIENT_SECRET = os.getenv('MERCADOPAGO_CLIENT_SECRET') + +mp = MP(MERCADOPAGO_CLIENT_ID, MERCADOPAGO_CLIENT_SECRET) +mp_access_token = mp.get_access_token() +response = mp.get('/v1/payments/search') +print(response)