Skip to main content

Etecsa sdk

Project description

ETECSA SDK

SDK para integraciones de aplicaciones de ETECSA, el paquete es llamado esdk.

Table de contenidos

Estructura de modulos

  • Los modulos estan conformados de la siguiente manera:

    -esdk
     --commercial
        ---ecrm
     --payment
        ---transfermovil
     --util
        ---apidevice
    

Instalacion del paquete

Debe instalarse ejecutando en el ambiente virtual o con la version de python deseada utilizando el gestor de paquetes pip de la siguiente manera: pip install esdk

Modulo commercial

El modulo comercial esta conformado por las aplicaciones comerciales de la empresa, hasta el momento se cuenta solamente con la integracion con ecrm.

Ejemplo de validacion de servicios en ecrm

from esdk.commercial.ecrm import APICredentials,APIOperations,APIConstants,ServiceToValidate,ServiceToPay

credential = APICredentials("username", "password")

service = ServiceToValidate("nauta", APIConstants.SERVICE_TYPE_IDENTIFICATOR_NAUTA)
service1 = ServiceToValidate("number", APIConstants.SERVICE_TYPE_IDENTIFICATOR_INVOICE)
service2 = ServiceToValidate("propia", APIConstants.SERVICE_TYPE_IDENTIFICATOR_PROPIA)

lst_services = [service.get_service(),service1.get_service(),service2.get_service()]

operation = APIOperations(credential)

operation.servicesvalidate(lst_services)
Ejemplo de pago de servicios

from esdk.commercial.ecrm import APICredentials,APIOperations,APIConstants,ServiceToValidate,ServiceToPay

credential = APICredentials("username", "password")

service = ServiceToPay("acc1",APIConstants.SERVICE_TYPE_IDENTIFICATOR_INVOICE,"number", 10)
service1 = ServiceToPay("acc2",APIConstants.SERVICE_TYPE_IDENTIFICATOR_INVOICE,"number", 10)
service2 = ServiceToPay("acc3",APIConstants.SERVICE_TYPE_IDENTIFICATOR_INVOICE,"number", 10)


lst_services = [service.get_service(),service1.get_service(),service2.get_service()]

operation = APIOperations(credential)

operation.servicespayment(lst_services, "id","source","pm","cup")

Modulo payment

El modulo payment esta conformado por las pasarelas de pago empleadas en el pais, hasta el momento se cuenta solamente con la integracion con transfermovil.

from esdk.payment.transfer_movil import APICredentials,APIPayload,APIPayment

credential = APICredentials("username", "source","seed")
payload = APIPayload(10,'currency','id','source','url')

payment = APIPayment()
payment.charge(credential,payload)

Modulo util

El modulo util esta conformado por conjunto de funciones, hasta el momento se cuenta solamente con obtener los datos del agente de usuario de la peticion http.

from esdk.util.api_device import APIDevice

api_device = APIDevice('user-agent')
device = api_device.getdevice()

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

esdk-1.0.0.tar.gz (8.9 kB view details)

Uploaded Source

File details

Details for the file esdk-1.0.0.tar.gz.

File metadata

  • Download URL: esdk-1.0.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.0

File hashes

Hashes for esdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f3655a10fed5287051c44879f42fad55890eedd0b6fdd4611ad182a3809475ef
MD5 55f32d74f3d2d12411df72ecfcabaa45
BLAKE2b-256 aed59f0a9707210062235fbb244015a9e0b02551597e0ce5a2801dae6691746a

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