Skip to content

python-cielo is a simple lib for making payments over the Cielo webservice

Notifications You must be signed in to change notification settings

guilhermetavares/python-cielo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-cielo

python-cielo is a lightweight lib for making payments over the Cielo webservice (Brazil)

Installation

Use PIP or easy_install:

pip install -e git+git://github.com/guilhermetavares/python-cielo.git#egg=python-cielo

Usage

Cielo key and affiliation:

CIELO_API_KEY = '25fbb99741c739dd84d7b06ec78c9bac718838630f30b112d033ce2e621b34f3'
CIELO_AFFILIATION_ID = '1006993069'

For send a simple transaction:

from cielo import PaymentAttempt, CASH, VISA
from decimal import Decimal

params = {
        'affiliation_id': CIELO_AFFILIATION_ID,
        'api_key': CIELO_API_KEY,
        'card_type': VISA,
        'total': Decimal('1.00'),  # when amount ends with .00 attempt is automatically authorized
        'order_id': '7DSD163AH1',  # strings are allowed here
        'card_number': '4012001037141112',
        'cvc2': 423,
        'exp_month': 1,
        'exp_year': 2010,
        'card_holders_name': 'JOAO DA SILVA',
        'installments': 1,
        'transaction': CASH,
        'sandbox': True,
        'use_ssl': None # if is None, will be considered the opposite of sandbox.
    }
attempt = PaymentAttempt(**params)
attempt.get_authorized()
attempt.capture()

To see more operations see the file: tests.py

Tests

For tests:

python tests.py

Documentation

Docs are hosted at ReadTheDocs.

About

python-cielo is a simple lib for making payments over the Cielo webservice

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%