Skip to content

Commit

Permalink
Added support to pipenv
Browse files Browse the repository at this point in the history
  • Loading branch information
lecovi committed May 1, 2018
1 parent aa6cf61 commit 9b77fd4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -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"
12 changes: 12 additions & 0 deletions update_mp.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 9b77fd4

Please sign in to comment.