瀏覽代碼

fix merge

conradlan 3 年之前
父節點
當前提交
2f0523e696
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5 4
      app/api/api_v1/endpoints/linepay.py

+ 5 - 4
app/api/api_v1/endpoints/linepay.py

@@ -1,3 +1,5 @@
+import uuid
+
 from fastapi import APIRouter
 from linepay import LinePayApi
 from fastapi.templating import Jinja2Templates
@@ -8,15 +10,14 @@ templates = Jinja2Templates(directory="templates")
 router = APIRouter()
 
 LINE_PAY_CHANNEL_ID = "1656387996"
-SECRET_KEY = \
-    "df2f77bd544240801a048bd4293afd8eeb7fff3cb7050e42c791db4b83ebadcd"
+SECRET_KEY = "37336af5452f74ee871a9fa38d81602e"
 
 HOST_NAME = "https://api.ptt.cx:8750"
 # Line Pay Config
 LINE_PAY_CHANNEL_ID = LINE_PAY_CHANNEL_ID
 LINE_PAY_CHANNEL_SECRET = "37336af5452f74ee871a9fa38d81602e"
 # LINE_PAY_REQEST_BASE_URL = "https://{}".format(HOST_NAME)
-LINE_PAY_REQEST_BASE_URL = "https://api.ptt.cx:8750/api/v1/linepay"
+LINE_PAY_REQEST_BASE_URL = "https://api.ptt.cx:8750"
 line = LinePayApi(
     LINE_PAY_CHANNEL_ID, LINE_PAY_CHANNEL_SECRET, is_sandbox=True
 )
@@ -28,7 +29,7 @@ CACHE = {}
 # Request
 @router.post('/request')
 async def pay_request():
-    order_id = "20211227011"
+    order_id = str(uuid.uuid4())
     amount = "1"
     currency = "TWD"