Browse Source

mod simple pay

tomoya 1 week ago
parent
commit
b025dea2b7

+ 4 - 4
backend/app/app/api/api_v1/endpoints/simplepayment.py

@@ -91,13 +91,13 @@ def ecpay_payment(
     }
 
     inv_params = {
-        # 'RelateNumber': 'Tea0001', # 特店自訂編號
+        'RelateNumber': MerchantTradeNo, # 特店自訂編號
         # 'CustomerID': 'TEA_0000001', # 客戶編號
-        # 'CustomerIdentifier': '53348111', # 統一編號
-        # 'CustomerName': '客戶名稱',
+        'CustomerIdentifier': user_data.taxID if user_data.taxID else '', # 統一編號
+        'CustomerName': user_data.name,
         # 'CustomerAddr': '客戶地址',
         # 'CustomerPhone': '0912345678', # 客戶手機號碼
-        # 'CustomerEmail': 'abc@ecpay.com.tw',
+        'CustomerEmail': user_data.email,
         # 'ClearanceMark': '2', # 通關方式
         # 'TaxType': '1', # 課稅類別
         # 'CarruerType': '', # 載具類別

+ 0 - 8
backend/app/app/models/simplepay.py

@@ -14,14 +14,6 @@ class SimplePay(Base):
   id = Column(Integer, primary_key=True, index=True)
   email = Column(String(50), index=True, nullable=False)
   name = Column(String(30), index=True)
-  phone = Column(String(15), index=True)
-  company = Column(String(20))
-  url = Column(String(100), index=True, nullable=False)
-  area = Column(String(20))
-  language = Column(String(20))
-  ages = Column(String(30))
-  target = Column(String(50))
-  theme = Column(String(20))
   taxID = Column(String(20))
   tradeDesc = Column(String(20))
   item = Column(String(20), nullable=False)

+ 1 - 23
backend/app/app/schemas/simplepay.py

@@ -6,14 +6,6 @@ from pydantic import BaseModel, EmailStr, HttpUrl
 class SimplePayBase(BaseModel):
     email: Optional[EmailStr] = None
     name : Optional[str] = None
-    phone : Optional[str] = None
-    company: Optional[str] = None
-    url: Optional[HttpUrl] = None
-    area: Optional[str] = None
-    language: Optional[str] = None
-    ages: Optional[str] = None
-    target: Optional[str] = None
-    theme: Optional[str] = None
     taxID: Optional[str] = None
     tradeDesc: Optional[str] = None
     item: Optional[str] = None
@@ -23,13 +15,6 @@ class SimplePayBase(BaseModel):
 class SimplePayCreate(SimplePayBase):
     email: EmailStr
     name : str
-    phone : str
-    url: HttpUrl
-    area: str
-    language: str
-    ages: str
-    target: str
-    theme: str
     tradeDesc: Optional[str] = None
     item: Optional[str] = None
     amount: Optional[str] = None
@@ -43,16 +28,9 @@ class SimplePayInDBBase(SimplePayBase):
     id: int
     email: EmailStr
     name : str
-    company: str
-    url: HttpUrl
-    area: str
-    language: str
-    ages: str
-    target: str
-    theme: str
     taxID: str
-    item: str
     tradeDesc: str
+    item: str
     amount: str
     payment_state: str