sputnik8 / atol-rb Goto Github PK
View Code? Open in Web Editor NEWATOL KaaS client for Ruby
License: MIT License
ATOL KaaS client for Ruby
License: MIT License
При тестировании интеграции с АТОЛ с помощью данного gem-а заметил следующую особенность:
Atol::StateBadRequestError ({"error":{"code":11,"error_id":"adec8ba2-6ec3-4163-bf1f-f0a663a9da56","text":"Переданный токен не активен","type":"system"},"timestamp":"24.04.2020 13:23:55"})
Atol::IncomingExistExternalIdError ({"error":{"code":10,"error_id":"4bd55993-f094-4ea9-ae06-60dcf3bacfc7","text":"Не распознан токен запроса","type":"system"},"timestamp":"24.04.2020 13:24:48"})
Если посмотреть в документацию https://online.atol.ru/files/API_atol_online_v4.pdf в таблицу 6 на странице 60, то можно увидеть, что передаваемым кодам ошибок (поле code
в json с ошибкой) есть соответствующие человекопонятные названия:
Ошибка | Код ошибки |
---|---|
MissingToken | 10 |
ExpiredToken | 11 |
Мне данные названия кажутся более понятными и соответствующими сути происходящих ошибок.
Предлагаю названия всех эксепшнов в
Lines 31 to 51 in 5ef433f
Error
в конце названия эксепшна).
Т.е. для моего примера это было бы в следующем виде:
Atol::ExpiredTokenError ({"error":{"code":11,"error_id":"adec8ba2-6ec3-4163-bf1f-f0a663a9da56","text":"Переданный токен не активен","type":"system"},"timestamp":"24.04.2020 13:23:55"})
Atol::MissingTokenError ({"error":{"code":10,"error_id":"4bd55993-f094-4ea9-ae06-60dcf3bacfc7","text":"Не распознан токен запроса","type":"system"},"timestamp":"24.04.2020 13:24:48"})
Необходимо обновить wiki и указать company_email, как обязательный параметр инициализации приложения.
Atol.config.tap do |config|
...
config.company_email = "[email protected]"
end
Спасибо
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.