Giter Site home page Giter Site logo

iugu-python's People

Contributors

diegosouzacosta avatar horacioibrahim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

iugu-python's Issues

Opção para carregar o API_TOKEN do settings.py do Django

Horacio, acho que seria interessante se tivesse a opção de carregar o Token diretamente do settings.py do Django, teria como implementar isso? Poderia haver os seguintes dados no settings do Django:

IUGU_TOKEN = ''
IUGU_TOKEN_TEST = ''
IUGU_TEST = True

O sistema poderia acessar o settings do Django e capturar o Token direto de lá, exemplo:

from django.conf import settings
API_TOKEN = settings.IUGU_TOKEN_TEST if settings.IUGU_TEST else settings.IUGU_TOKEN

Nesse caso você poderia tentar carregar o settings.py, caso ocorra erro tentaria carregar o os.environ["IUGU_API_TOKEN"] ou vice-versa.

the JSON object must be str, not 'bytes'

Hello,

When I create a simple slip_bank charge show me this error:

Environment:

Request Method: POST
Request URL: http://local.enota.com.br:8000/cursos/matricular/confirmar/

Django Version: 1.8.1
Python Version: 3.4.2
Installed Applications:
('django_extensions',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'django_filters',
'social.apps.django_app.default',
'bootstrap3',
'crispy_forms',
'compressor',
'braces',
'accounts',
'core',
'cursos',
'assinatura',
'debug_toolbar')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'core.context_middleware.JSONMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware')

Traceback:
File "/Users/fellipeh/.virtualenvs/enota/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response

  1.                 response = wrapped_callback(request, _callback_args, *_callback_kwargs)
    
    File "/Users/fellipeh/.virtualenvs/enota/lib/python3.4/site-packages/django/views/decorators/http.py" in inner
  2.         return func(request, _args, *_kwargs)
    
    File "/Users/fellipeh/.virtualenvs/enota/lib/python3.4/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  3.             return view_func(request, _args, *_kwargs)
    
    File "/Users/fellipeh/Developer/django/enota/assinatura/views.py" in confirma_checkout_curso
  4.                 payment = pagar_curso(request, id_user=request.user.id, id_curso=curso_id)
    
    File "/Users/fellipeh/.virtualenvs/enota/lib/python3.4/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  5.             return view_func(request, _args, *_kwargs)
    
    File "/Users/fellipeh/Developer/django/enota/assinatura/views.py" in pagar_curso
  6.     charge = client.create_charge(u.email, item)
    
    File "/Users/fellipeh/.virtualenvs/enota/lib/python3.4/site-packages/iugu_python-0.9.6-py3.4.egg/iugu/merchant.py" in create_charge
  7.     results = self.__conn.post(urn, data)
    
    File "/Users/fellipeh/.virtualenvs/enota/lib/python3.4/site-packages/iugu_python-0.9.6-py3.4.egg/iugu/base.py" in post
  8.     return self.__validation(response)
    
    File "/Users/fellipeh/.virtualenvs/enota/lib/python3.4/site-packages/iugu_python-0.9.6-py3.4.egg/iugu/base.py" in __validation
  9.     results = json_load(response)
    
    File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/json/init.py" in load
  10.     parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
    
    File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/json/init.py" in loads
  11.                         s.**class**.**name**))
    

Exception Type: TypeError at /cursos/matricular/confirmar/
Exception Value: the JSON object must be str, not 'bytes'

Evitar atualização de campo customer de uma assinatura

Conforme atendimento de número 782 do suporte Iugu.com não é possível alterar customer de uma assinatura, assim evitar o envio (uma request) desnecessário se o cliente da lib estiver alterando somente customer de uma assinatura (subir uma exceção).

Improve config/settings token

Add environment variable or instantiate the API_TOKEN. Currently this in config.py that deeply in inner install path.
Something:
token = os.environ["IUGU_API_TOKEN"]
or
client = IuguClass(token="XXX")

Problema com acentos

Ao salvar um cliente com acento (ex: Jéssica) está aparecendo J?ssica no iugu, e em python está retornando J\xe9ssica

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.