From d612bc7bc971fc2417eb4eb8bc0f82174a199970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=8E=89=E6=BD=87?= <46233031+hhvvhhg@users.noreply.github.com> Date: Tue, 21 Apr 2020 09:48:20 +0800 Subject: [PATCH 1/3] Update client.py --- shouqianba/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shouqianba/client.py b/shouqianba/client.py index b8d4796..f60e19a 100644 --- a/shouqianba/client.py +++ b/shouqianba/client.py @@ -106,8 +106,9 @@ class ShouqianbaClient(BaseClient): PAYWAY_BAIFUBAO = '4' # 百度钱包支付通道 PAYWAY_JD = '5' # 京东钱包支付通道 - def __init__(self, base_url=None, vendor_sn=None, vendor_key=None, terminal_sn=None, terminal_key=None, **kwargs): + def __init__(self, base_url=None, vendor_sn=None, vendor_key=None, app_id=None, terminal_sn=None, terminal_key=None, **kwargs): self.last_order_sn = None + self.app_id = app_id or config.app_id self._default_goods_subject = "Python Client" self.device_id = kwargs.pop('device_id', "50a87771-ca8a-4952-a493-9504c39ab495") # 设备唯一身份ID self.os_info = kwargs.pop("os_info", "Android 5.0") # 当前系统信息 @@ -277,6 +278,7 @@ def activate(self, code, override_terminal=False): """ payload = dict( code=code, + app_id=self.app_id, device_id=self.device_id, sdk_version=self.sdk_version, os_info=self.os_info, From 7d4d0ae81430eca78ec3dd56a1412029bac6031c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=8E=89=E6=BD=87?= <46233031+hhvvhhg@users.noreply.github.com> Date: Tue, 21 Apr 2020 09:51:44 +0800 Subject: [PATCH 2/3] Update config.py --- shouqianba/config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/shouqianba/config.py b/shouqianba/config.py index 427fa87..a27548c 100644 --- a/shouqianba/config.py +++ b/shouqianba/config.py @@ -2,6 +2,7 @@ vendor_sn = None vendor_key = None +app_id= None terminal_sn = None terminal_key = None base_url = "https://vsi-api.shouqianba.com" From 04360cf2c91b52571caf70b0358f1c6405ee2316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=8E=89=E6=BD=87?= <46233031+hhvvhhg@users.noreply.github.com> Date: Tue, 21 Apr 2020 09:53:27 +0800 Subject: [PATCH 3/3] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ac2ec8a..84ad695 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ import shouqianba shouqianba.config.vendor_key = 'd1312asd31123tga123g11' shouqianba.config.vendor_sn = '138121' +shouqianba.config.app_id = '2018080800000001' client = shouqianba.ShouqianbaClient() client.activate("00000008", True)