Git Product home page Git Product logo

culqi-python's Introduction

Culqi Python

License Latest Unstable Version Build Status

Biblioteca de CULQI para el lenguaje Python, pagos simples en tu sitio web. Consume el Culqi API.

Versión actual Culqi API
0.1.8 (2017-01-17) v2

Requisitos

  • Python 2.6, 2.7, 3.3, 3.4, 3.5
  • Credenciales de comercio en Culqi (1).

Instalación

pip install culqipy

Ejemplo

Imports

# example.py
import uuid
import culqipy

Inicialización

culqipy.COD_COMMERCE = "pk_test_vzMuTHoueOMlgUPj"
culqipy.API_KEY = "sk_test_UTCQSGcXW8bCyU59"

Crear Token

token = culqipy.Token.create(
      card_number="4111111111111111",
      currency_code="PEN",
      cvv="123",
      exp_month=9,
      exp_year=2020,
      fingerprint="q352454534",
      last_name="Muro",
      email="[email protected]",
      first_name="William")

print(token["id"])

Crear Cargo

charge = culqipy.Charge.create(
      address="Avenida Lima 1232",
      address_city="LIMA",
      amount=1000,
      country_code="PE",
      currency_code="PEN",
      email="[email protected]",
      first_name="William",
      installments=0,
      last_name="Muro",
      metadata="",
      phone_number=3333339,
      product_description="Venta de prueba",
      token_id=token["id"])

print(charge["id"])

Crear Plan

plan = culqipy.Plan.create(
      alias="plan-test-"+str(uuid.uuid1()),
      amount=1000,
      currency_code="PEN",
      interval="day",
      interval_count=2,
      limit=10,
      name="Plan de Prueba "+str(uuid.uuid1()),
      trial_days=50)

print(plan["alias"])

Crear Suscripción

subscription = culqipy.Subscription.create(
      address="Avenida Lima 123213",
      address_city="LIMA",
      country_code="PE",
      email="[email protected]",
      last_name="Muro",
      first_name="William",
      phone_number=1234567789,
      plan_alias=plan["alias"],
      token_id=token["id"])

print(subscription)

Crear Devolución

refund = culqipy.Refund.create(
      amount=500,
      charge_id=charge["id"],
      reason="give me money back")

print(refund)

Nota

Cada metodo retona un objecto json y puede ser accedido de la siguiente forma jsonObject["key"]

Changelog

Todos los cambios en las versiones de esta biblioteca están listados en CHANGELOG.

Dependencias para el desarrollo

requests

Testing

Solo debe ejecutar el siguiente comando

python culqipy/test.py

Autor

Willy Aguirre (@marti1125 - Team Culqi)

Licencia

El código fuente de culqi-python está distribuido bajo MIT License, revisar el archivo LICENSE.

culqi-python's People

Contributors

marti1125 avatar william-muro-culqi avatar

Watchers

 avatar  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.