Mobio license SDK
Project description
Thư viện license Mobio
Cài đặt:
$ pip3 install mobio-license-sdk
Sử dụng:
1. Khởi tạo sdk:
from mobio.sdks.license import MobioLicenseSDK
MobioLicenseSDK().config(
admin_host="", # admin host
redis_uri="", # redis uri
module_use="", # liên hệ admin để khai báo tên của module
module_encrypt="", # liên hệ admin để lấy mã
license_key="", # key salt
)
2. Lấy thông tin license:
from mobio.sdks.license import MobioLicenseSDK
result = MobioLicenseSDK().get_json_license(
merchant_id,
)
"""
{
... # license info
}
"""
3. Lấy số lượng tài khoản tối đa:
from mobio.sdks.license import MobioLicenseSDK
result = MobioLicenseSDK().get_number_user(
merchant_id,
)
"""
{
"number": 12
}
"""
4. Lấy số lượng profile tối đa:
from mobio.sdks.license import MobioLicenseSDK
result = MobioLicenseSDK().get_number_profile(
merchant_id,
)
"""
{
"number": 50000
}
"""
5. Lấy số lượng profile ẩn danh tối đa:
from mobio.sdks.license import MobioLicenseSDK
result = MobioLicenseSDK().get_number_profile_anonymous(
merchant_id,
)
"""
{
"number": 100000
}
"""
6. Lấy số lượng page social tối đa:
from mobio.sdks.license import MobioLicenseSDK
result = MobioLicenseSDK().get_number_page_social(
merchant_id,
)
"""
{
"number": 6
}
"""
7. Lấy số lượng tin nhắn còn được gửi trong tháng:
from mobio.sdks.license import MobioLicenseSDK
result = MobioLicenseSDK().get_number_messages_allow_used(
merchant_id,
day_of_month=None # ngày kiểm tra YYYYmmdd (ITC), nếu None sdk tự động lấy ngày hiện tại
)
"""
{
"number": 1200,
"messages": "" # thông báo nếu có
}
"""
8. Kiểm tra lượng tin nhắn cần sử dụng cho chiến dịch:
from mobio.sdks.license import MobioLicenseSDK
result = MobioLicenseSDK().use_message_for_campaign(
merchant_id,
number_of_message, # số mess cần sử dụng
day_of_month=None # ngày kiểm tra YYYYmmdd (ITC), nếu None sdk tự động lấy ngày hiện tại
)
"""
{
"number": 12,
"messages": "" # thông báo nếu có
"success": 1 # trạng thái sử dụng, 1: thành công, 0: thất bại.
# nếu thành công dữ liệu số mess đã sử dụng sẽ lưu lại để tính toán cho lần tiếp theo.
}
"""
9. Hàm mã hóa và giải mã:
from mobio.sdks.license import MobioLicenseSDK
result = MobioLicenseSDK().decrypt1(
key_salt, # key salt theo hàm mã hóa
data # dữ liệu cần giải mã
)
result = MobioLicenseSDK().encrypt2(
data # dữ liệu cần mã hóa
)
result = MobioLicenseSDK().decrypt2(
data # dữ liệu cần giải mã
)
# kết quả là kiểu string
10. Hàm kiểm tra merchant đã hết hạn chưa:
from mobio.sdks.license import MobioLicenseSDK
result = MobioLicenseSDK().merchant_has_expired(
merchant_id
)
# result = True : merchant đã hết hạn
# result = False : merchant chưa hết hạn
Log - 1.0.1
- tạo sdk
Log - 1.0.2
- init export class SDK
Log - 1.0.3
- thêm các hàm lấy thông số license
Log - 1.0.4
- thay đổi requirements
Log - 1.0.5
- sửa import sai
Log - 1.0.6
- thêm cơ chế cache file license, tự động tải mới file sau 1 khoảng thời gian
Log - 1.0.7
- export các hàm mã hóa và giải mã
Log - 1.0.8
- Hàm kiểm tra merchant đã hết hạn chưa
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mobio-license-sdk-1.0.8.tar.gz
(17.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mobio-license-sdk-1.0.8.tar.gz.
File metadata
- Download URL: mobio-license-sdk-1.0.8.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3ac681618a729feaec42498d52ad537ffb8312f3da53f1c58a09380b72fa9b2
|
|
| MD5 |
21286fd0206733ea892f999a48a8777e
|
|
| BLAKE2b-256 |
b45e845db165aac3073a3b782969b3156d75c30623c0a1172467572242ac3d9f
|
File details
Details for the file mobio_license_sdk-1.0.8-py3-none-any.whl.
File metadata
- Download URL: mobio_license_sdk-1.0.8-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab9454685f06e5df53058ea350ea92c4e19669acec21f1b05eadbc4466c2acc4
|
|
| MD5 |
686cb757bb225c76e20096499590d4e3
|
|
| BLAKE2b-256 |
d472746705bd113a031e126d17c195ee15c31e78e18a5265b2d211ff455610a4
|