GithubHelp home page GithubHelp logo

paulanti / python-orangedata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vanzhiganov/python-orangedata

0.0 1.0 1.0 33 KB

https://github.com/irtimir/Python-OrangeData.git

License: MIT License

Python 100.00%

python-orangedata's Introduction

PythonOrangeData

Ссылка на сервис: http://orangedata.ru/

Python integration for OrangeData service

Актуальная версия библиотеки: 2.1.1

Использование:

  • создать объект класса OrangeDataClient
from client import OrangeDataClient

params = {
    'inn': '3123011520',
    'api_url': 'https://apip.orangedata.ru:2443',
    'sign_pkey': 'private_key.pem',
    'client_key': 'client.key',
    'client_cert': 'client.crt',
}

client = OrangeDataClient(**params)
  • создание чека, добавление сущностей
client.create_order(**order_kwargs)

client.add_position_to_order(**position_to_order_kwargs_1)
client.add_position_to_order(**position_to_order_kwargs_2)

client.add_payment_to_order(**payment_to_order_kwargs)

client.add_agent_to_order(**agent_to_order_kwargs)

client.add_user_attribute(**agent_user_attribute_kwargs)


# отправить сформированный документ
client.send_order()
  • получение чека
order = client.get_order_status(order_id)
  • создание коррекции
client.create_correction(**correction_kwargs)

# отправка сформированной коррекции
client.post_correction()
  • получение коррекции
correction = client.get_correction_status(correction_number)

Методы, которые отправляют данные на апи (send_order, get_order_status, post_correction, get_correction_status) имеют схожий формат возвращаемых данных:

>>> client.send_order()
{
    'code': 201,
    'data': '',
    'headers': {...}
}
  • code - код ответа от сервера
  • data - декодированное тело ответа
  • headers - заголовки ответа

python-orangedata's People

Contributors

irtimir avatar paulanti avatar

Watchers

James Cloos avatar

Forkers

pik-software

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.