Giter VIP home page Giter VIP logo

python-tbk's Introduction

Unofficial TBK Web Services Python SDK

image

image

Requirements

  • python: ~2.7, ^3.6
  • libxml2 >= 2.9.1
  • libxmlsec1 >= 1.2.14

馃嚞馃嚙

Installation

Just run:

$ pip install python-tbk

Usage

As simple as call (snakecased) webpay api methods:

>>> from tbk.services import WebpayService
>>> from tbk.commerce import Commerce
>>> from tbk import INTEGRACION
>>> commerce = Commerce(commerce_code, key_data, cert_data, tbk_cert_data, INTEGRACION)
>>> webpay = WebpayService(commerce)
>>> transaction = webpay.init_transaction(amount, buy_order, return_url, final_url)
>>> print(transaction['token'])
e87df74f7af4dcfdc1d17521b07413ff9a004a7b423dc47ad09f6a8166a73842

Conventions

This library use a snake cased naming convention for webservices and params for a more pythonic implementation. Every camelcased name in the webpay API was transformed to snakecase:

initTransaction(amount, buyOrder, returnURL, finalURL, sessionId)

became:

init_transaction(amount, buy_order, return_url, final_url, session_id)

Documentation

You can refer to http://www.transbankdevelopers.cl/?m=api for official API documentation. This library documentation is on the way.

Loggers

There are two levels of loggers:

tbk.services
tbk.soap

Specific service logger are defined by class name:

tbk.services.WebpayService

Bugs?

Issues are welcome at https://github.com/cornershop/python-tbk/issues

馃嚜馃嚫

Instalaci贸n

Ejecuta:

$ pip install python-tbk

Uso

Tan simple como llamar los m茅todos del API de Webpay (pero snakecased):

>>> from tbk.services import WebpayService
>>> from tbk.commerce import Commerce
>>> from tbk import INTEGRACION
>>> commerce = Commerce(commerce_code, key_data, cert_data, tbk_cert_data, INTEGRACION)
>>> webpay = WebpayService(commerce)
>>> transaction = webpay.init_transaction(amount, buy_order, return_url, final_url)
>>> print(transaction['token'])
e87df74f7af4dcfdc1d17521b07413ff9a004a7b423dc47ad09f6a8166a73842

Convenciones

La librer铆a usa una convenci贸n de nombres snakecased para ser m谩s pythonica. Cada nombre camelcased en el API de Webpay se transform贸 a snakecased:

initTransaction(amount, buyOrder, returnURL, finalURL, sessionId)

se traduce en:

init_transaction(amount, buy_order, return_url, final_url, session_id)

Documentaci贸n

La documentaci贸n oficial se encuentra disponible en http://www.transbankdevelopers.cl/?m=api. La documentaci贸n de esta librer铆a est谩 en desarrollo.

Loggers

Se encuentran definidos dos niveles de logger:

tbk.services
tbk.soap

El logger espec铆fico de un servicio est谩 definido por su nombre de clase:

tbk.services.WebpayService

Testing cards / Tarjetas de prueba

Credit / Cr茅dito

Marca VISA MASTERCARD
No de Tarjeta 4051885600446623 5186059559590568
A帽o Expiraci贸n Cualquiera Cualquiera
CVV 123 123
Resultado APROBADO RECHAZADO

Debit / D茅bito

APRUEBA RECHAZA
TARJETA 4051885600446620 5186059559590560
RUT 11.111.111-1 11.111.111-1
PASSWORD 123 123

python-tbk's People

Contributors

fceruti avatar pedroburon avatar

Watchers

 avatar

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.