Skip to content

Commit

Permalink
Merge pull request #2 from hhvvhhg/master
Browse files Browse the repository at this point in the history
添加激活必填参数app_id
  • Loading branch information
roylogic authored Apr 25, 2020
2 parents 40f6e04 + 04360cf commit 4e27e17
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion shouqianba/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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") # 当前系统信息
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions shouqianba/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 4e27e17

Please # to comment.