Skip to main content

qbit_py_sdk bass api 接口支持

Project description

qbit-python-sdk

Qbit 概念

开发者 API 旨在允许企业与 Qbit 系统集成,并轻松将其作为其工作流程的一部分。该 API 允许开发者使用【全球账户】、【量子卡】业务等。

项目状态

当前版本0.1.2为测试版本。暂时支持了 auth 相关的接口,其他接口带后续完善,同时也提供了 Qbit Api 所需的 Post、put、delete、get 请求,方便使用者更好调用其他接口,具体使用请看下面代码示例。

注意:请商户的专业技术人员在使用时注意系统和软件的正确性和兼容性,以及带来的风险。

环境要求

  • Python 3.7+

安装

最新版本已经在 pypi 发布。

pip install qbit-py-sdk

使用

import qbit_py_sdk as Qbit

qbit = Qbit.QbitClient("qbit1f6efee44ceb8ca2", "8f70d42a1393802aebf567be27a47879", "https://api-global.qbitnetwork.com")

名词解释

  • Client,合作伙伴在 Qbit 我们称之为 Client。
  • Account, 合作伙伴的客户在 Qbit 我们称之为 Account
  • clientId,商户 id,请联系我们申请。
  • clientSecret,商户密钥,用于签名,请联系我们申请。

开始

获取 access token

codeRes = qbit.get_code(state='324', redirect_uri='')
res = qbit.get_access_token(codeRes.code)
print(res)

刷新 access token

res = qbit.refresh_access_token("refreshToken")
print(res)

调用其他接口示例

# 返回值 status 在 200 - 300 内表示请求正常
params = {
        "id": "5d890eda-16aa-4760-90af-3d60837f5616",
        "limit": 10
    }

res = qbit.config("6b4c6541ea36fcca82ed07d39093e70e32f5d191").get_request(
        "https://api-global.qbitnetwork.com/open-api/v1/budget", **params)

敏感信息加解密

加密-HmacSHA256

from qbit_py_sdk import encryptHmacSHA256

data = {
        "id": "ee74c872-8173-4b67-81b1-5746e7d5ab88",
        "accountId": None,
        "holderId": "d2bd6ab3-3c28-4ac7-a7c4-b7eed5eee367",
        "currency": "USD",
        "settlementCurrency": None,
        "counterparty": "SAILINGWOOD;;US;1800948598;;091000019",
        "transactionAmount": 11,
        "fee": 0,
        "businessType": "Inbound",
        "status": "Closed",
        "transactionTime": "2021-11-22T07:34:10.997Z",
        "transactionId": "124d3804-defa-4033-9f30-1d8b0468e506",
        "clientTransactionId": None,
        "createTime": "2021-11-22T07:34:10.997Z",
        "appendFee": 0,
    }
res = encryptHmacSHA256("25d55ad283aa400af464c76d713c07ad", **data)
print(res == "8287d5539c03918c9de51176162c2bf7065d5a8756b014e3293be1920c20d102")

联系我们

如果你发现了BUG或者有任何疑问、建议,请通过 issue 进行反馈。

也欢迎访问我们的官网

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

qbit_py_sdk-0.1.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

qbit_py_sdk-0.1.2-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file qbit_py_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: qbit_py_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.5rc1

File hashes

Hashes for qbit_py_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 eca28e3982c398796899187d2c3fe13ee9adc24472f8f7bdc02320533f228bba
MD5 c2373904ade537855facaf41c9992dee
BLAKE2b-256 0d2ff84b7270bf97d9f1193d221e9e28a9620d605f26a25cbdf6cba0b218adf5

See more details on using hashes here.

File details

Details for the file qbit_py_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: qbit_py_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.5rc1

File hashes

Hashes for qbit_py_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3bbe19883320aeeeda0c43943891a09242a87849622f19116ded90d34a6ece96
MD5 c901f65291b6b4488c25466b79e53d24
BLAKE2b-256 3ea5a9ed3cd13ac216b062bb66e1cf667e588356a3a78b0078b4b2c69a76924f

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