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


Download files

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

Source Distribution

paggcerto-python-0.0.3.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

paggcerto_python-0.0.3-py2.py3-none-any.whl (5.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file paggcerto-python-0.0.3.tar.gz.

File metadata

  • Download URL: paggcerto-python-0.0.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5

File hashes

Hashes for paggcerto-python-0.0.3.tar.gz
Algorithm Hash digest
SHA256 135047a825d2f135c7c17f40220f9e1892af4945484a4c140b20f51266fcb40e
MD5 a266526efc8a5dbf2c2620f9f6646190
BLAKE2b-256 1cb1c0117e0d049fada88aa24daf415090ffa14694767e4b29f5d986f14b43ee

See more details on using hashes here.

File details

Details for the file paggcerto_python-0.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: paggcerto_python-0.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5

File hashes

Hashes for paggcerto_python-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 747dec17c3f2293ba7fb1c2611cca37df2c1c6814636471cd4dc179e40023a99
MD5 b9870404fc4f5986dd2d0fa82381d85f
BLAKE2b-256 90f00c972c09ff9449a9b0c3ea0a11a2e594b34f39f2f0597c11c2f0cac8012a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page