{"id":34113240,"url":"https://github.com/luffy-genius/openapi","last_synced_at":"2026-04-02T03:50:54.164Z","repository":{"id":38422217,"uuid":"506570088","full_name":"luffy-genius/openapi","owner":"luffy-genius","description":"openapi of all third-party","archived":false,"fork":false,"pushed_at":"2026-02-20T01:05:18.000Z","size":204,"stargazers_count":10,"open_issues_count":5,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-20T05:05:59.022Z","etag":null,"topics":["alipay","aliyun","crm","doudian","feishu","lark","openapi","python3","sms","tanmarket","wechat","wechat-pay","xiaoetong"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luffy-genius.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-06-23T09:07:38.000Z","updated_at":"2026-01-17T15:33:55.000Z","dependencies_parsed_at":"2023-02-08T06:31:07.099Z","dependency_job_id":"6cedaf11-a09a-4483-9d74-e144c98f917e","html_url":"https://github.com/luffy-genius/openapi","commit_stats":{"total_commits":77,"total_committers":2,"mean_commits":38.5,"dds":"0.038961038961038974","last_synced_commit":"6825a239a69da4a53fa1d3e35b96d5eeb20ae0ee"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/luffy-genius/openapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luffy-genius%2Fopenapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luffy-genius%2Fopenapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luffy-genius%2Fopenapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luffy-genius%2Fopenapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luffy-genius","download_url":"https://codeload.github.com/luffy-genius/openapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luffy-genius%2Fopenapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alipay","aliyun","crm","doudian","feishu","lark","openapi","python3","sms","tanmarket","wechat","wechat-pay","xiaoetong"],"created_at":"2025-12-14T19:10:47.084Z","updated_at":"2026-04-02T03:50:54.156Z","avatar_url":"https://github.com/luffy-genius.png","language":"Python","readme":"## OpenAPI\n\n### 概述\n\n`OpenAPI` 集成了各类第三方的 SDK。\n\n### 安装\n\n```\npip3 install openapipy\n```\n\n### 使用\n\n#### 支付宝\n\n\u003e https://opendocs.alipay.com/open/270/105898\n\n```python3\nfrom openapi.providers.alipay import Client, Result\nclient = Client(\n    app_id='2016081500252288',\n    app_private_key_path='./resources/app_private_test2',\n    app_cert_public_key_path='./resources/appCertPublicKey_2016081500252288_test.crt',\n    alipay_root_cert_path='./resources/alipayRootCert_test.crt',\n    alipay_cert_public_key_path='./resources/alipayCertPublicKey_RSA2_test.crt',\n    is_sandbox=True\n)\n\npc_pay_params = client.build_query_params(client.build_params(\n    'alipay.trade.page.pay',\n    {\n        'subject': 'popmart-molly',\n        'out_trade_no': 'pc123456',\n        'total_amount': '999.99',\n        'product_code': 'FAST_INSTANT_TRADE_PAY'\n    },\n    notify_url='http://47.94.172.250:9527/api/v1/pay/alipay/',\n    return_url='http://47.94.172.250:9527/api/v1/pay/alipay/'\n))\npc_pay_url = f'{client.API_BASE_URL}?{pc_pay_params}'\nprint(pc_pay_url)\n\nresult: Result = client.request(\n    'get', 'alipay.trade.query',\n    params={\n        'out_trade_no': 'pc123456',\n        # 'trade_no': ''\n    }\n)\nprint(result)\n```\n\n#### 微信\n\n```python3\nimport json\n\nfrom openapi.providers.wechat.pay import Client\n\nwxpay_api = Client(\n    app_id='app_id',\n    mch_id='mch_id',\n    api_key_path='api_key_path',\n    is_sandbox=False\n)\n\n# 查询订单\nresult = wxpay_api.request(\n    'post', '/pay/orderquery',\n    data={\n        # 'out_trade_no': '9wfafGR31rCytY68wSFcXCII',\n        'transaction_id': '4200001591202211145504991626'\n    }\n)\nprint(result)\n\ndata = {\n    'body': '米诺地尔町',\n    'out_trade_no': '1232112359910',\n    'total_fee': 1,\n    'spbill_create_ip': '127.0.0.1',\n    'notify_url': 'htt',\n    'trade_type': 'NATIVE',\n    'attach': json.dumps({'x': 1})\n}\n\n# 创建订单 -\u003e pc\nresult = wxpay_api.request('post', '/pay/unifiedorder', data=data)\nprint(result)\n\n# 创建订单 -\u003e h5\ndata.update(trade_type='MWEB', out_trade_no='1231asd1222')\nresult = wxpay_api.request('post', '/pay/unifiedorder', data=data)\nprint(result)\n\n# 创建订单 -\u003e jsapi, 微信内\ndata.update(trade_type='JSAPI', out_trade_no='21321asd12311313', openid='ofwIAuEgpTZZwdPc1aort93xO')\nresult = wxpay_api.request('post', '/pay/unifiedorder', data=data)\nprint(result)\nif result.result_code == wxpay_api.codes.SUCCESS:\n    jsapi_data = wxpay_api.get_jsapi_data(result.data['prepay_id'])\n    print(jsapi_data)\n```\n\n#### 抖店\n\n\u003e https://op.jinritemai.com/docs/api-docs/13/54\n\n```python3\nfrom openapi.providers.doudian import Client as DouDianClient, Result\n\nclient = DouDianClient('your_appid', 'your_secret', 'your_shop_id')\n# 获取商品列表\nresult: Result = client.request('post', '/product/listV2', data={'page': 1, 'size': 10})\nprint(result)\n```\n\n#### 小鹅通\n\n\u003e https://api-doc.xiaoe-tech.com/?s=/2\u0026page_id=420\n\n```python3\nfrom openapi.providers.xiaoetong import Client as XiaoetongClient, Result\n\nclient = XiaoetongClient('your_appid', 'your_secret', 'your_client_id')\n# 获取分销人列表\nresult: Result = client.request('post', '/xe.distributor.list.get/1.0.0', data={})\nprint(result)\n```\n\n### 支持\n\n```\n2022 By ZhichaoLiu.\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluffy-genius%2Fopenapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluffy-genius%2Fopenapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluffy-genius%2Fopenapi/lists"}