-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from ipid/main
fix: 二维码接口使用 getPayParam;二维码显示尺寸限定为 300x300 且避免说明挡住二维码图片
- Loading branch information
Showing
3 changed files
with
18 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import time | ||
|
||
|
||
def get_qrcode_url(_request, token, project_id, order_id): | ||
url = f"https://show.bilibili.com/api/ticket/order/createstatus?token={token}" | ||
f"×tamp={int(round(time.time() * 1000))}" | ||
f"&project_id={project_id}&orderId={order_id}" | ||
def get_qrcode_url(_request, order_id): | ||
url = f"https://show.bilibili.com/api/ticket/order/getPayParam?order_id={order_id}" | ||
data = _request.get(url).json() | ||
if data["errno"] == 0: | ||
return data["data"]["payParam"]["code_url"] | ||
else: | ||
try: | ||
if data["errno"] == 0: | ||
return data["data"]["code_url"] | ||
else: | ||
raise Exception | ||
except Exception: | ||
return None |