Skip to main content

Python bindings for Paggcerto API

Project description

Paggcerto Python API

The Paggcerto Python API provides convenient access to the Paggcerto API from applications written in the Python language.

Quick Install

This lib can be found on pip. To install it, use:

$ pip install paggcerto-python

Usage

Export environment variables

export PAGGCERTO_API_USER=...
export PAGGCERTO_API_PASSWORD=...
export PAGGCERTO_API_USE_SANDBOX=True

Creating a Client

import python_http_client
from paggcerto import PaggcertoAPIClient, Client, PersonType, SexType, PaymentMethodType

api = PaggcertoAPIClient()

client = Client(
    cpfCnpj="31618850075",
    name="Maria Joao dos Santos",
    sex=SexType.F,
    dateOfBirth="01/25/1978",
    phone="7927667035",
    cellphone="79993764596",
    email="saragabriellyribeiro_@zf.com",
    typePerson=PersonType.F,
    zipCode="49030-720",
    address="Avenida Tancredo Neves",
    number="10",
    complement="Próximo ao conjunto inácio barbosa",
    neighborhood="Inacio Barbosa",
    city="Aracaju",
    uf="SE",
    note="O cliente possui apenas um dependente.",
    paymentMethod=PaymentMethodType.C
)
try:
    response = api.client.core.client.register.post(request_body=client.get())
    print(response.to_dict['client']['publicId'])
except python_http_client.HTTPError as e:
    print(e.to_dict)

Adding a credit card

import python_http_client
from paggcerto import PaggcertoAPIClient, CreditCard, Expiration

api = PaggcertoAPIClient()

credit_card = CreditCard(
    numberCard="4329626344167265",
    name="Maria Joao dos Santos",
    cvv="345",
    publicIdClient="MAY0uoO7mTpO4tBnY"
    expiration=Expiration(month="11", year="21")
)
try:
    response = api.client.core.card.register.post(request_body=credit_card.get())
    print(response.to_dict['card']['publicId'])
except python_http_client.HTTPError as e:
    print(e.to_dict)

Documentation

Project details


Release history Release notifications

This version

0.0.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for paggcerto-python, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size paggcerto_python-0.0.3-py2.py3-none-any.whl (5.0 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size paggcerto-python-0.0.3.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page