Skip to main content

An Azul Webservices light wrapper for Python.

Project description

pyazul

Consulta esta wiki para saber más sobre AZUL Webservices.

Instalación

  1. Instala pypi.
  2. $ pip install pyazul

Sale

from pyazul import AzulAPI

def sample_sale():
    auth1 = 'testcert2' # primer auth factor (se obtiene de Azul)
    auth2 = 'testcert2' # segundo auth factor (se obtiene de Azul)
    certificate_path = 'certificate.pem'
    environment = 'prod' # defaults 'dev'
    pyazul = AzulAPI(auth1, auth2, certificate_path)
    params = {
        "Channel": "EC",
        "Store": "37094649930",
        "CardNumber": "",
        "Expiration": "",
        "CVC": "",
        "PosInputMode": "E-Commerce",
        "Amount": "12",
        "CurrencyPosCode": "$",
        "RNN": "null",
        "CustomerServicePhone": "809-111-2222",
        "OrderNumber": "SO039-2",
        "ECommerceUrl": "azul.iterativo.do",
        "CustomOrderId": "53",
        "DataVaultToken": "74EAA676-FB9A-49E3-82CD-485DF85ECB61",
        "ForceNo3DS": "1",
        "SaveToDataVault": "0"
    }
    response = pyazul.sale_transaction(params)

Void

from pyazul import AzulAPI

def sample_void():
    auth1 = 'testcert2' # primer auth factor (se obtiene de Azul)
    auth2 = 'testcert2' # segundo auth factor (se obtiene de Azul)
    certificate_path = 'certificate.pem'
    environment = 'prod' # defaults 'dev'
    pyazul = AzulAPI(auth1, auth2, certificate_path)
    params = {
        "Channel":"EC",
	    "Store":"37094649930",
	    "AzulOrderId": 27917,
    }
    response = pyazul.void_transaction(params)

Refund

from pyazul import AzulAPI

def sample_refund():
    auth1 = 'testcert2' # primer auth factor (se obtiene de Azul)
    auth2 = 'testcert2' # segundo auth factor (se obtiene de Azul)
    certificate_path = 'certificate.pem'
    environment = 'prod' # defaults 'dev'
    pyazul = AzulAPI(auth1, auth2, certificate_path)
    params = {
        "Channel":"EC",
        "Store":"37094649930",
        "PosInputMode":"E-Commerce",
        "Amount":"30000",
        "Itbis":"2800",
        "CurrencyPosCode":"$",
        "OriginalDate":"20191217",
        "OriginalTrxTicketNr":"",
        "AuthorizationCode":"",
        "ResponseCode":"",
        "AcquirerRefData":"",
        "RRN":null,
        "AzulOrderId":40208,
        "CustomerServicePhone":"",
        "OrderNumber":"",
        "ECommerceUrl":"www.Google.com",
        "CustomOrderId":"",
        "DataVaultToken":"",
        "SaveToDataVault":"0",
        "ForceNo3DS":""
    }
    response = pyazul.refund_transaction(params)

© LGPL License

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

pyazul-0.4.2a0.tar.gz (3.8 kB view hashes)

Uploaded Source

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