|
@@ -32,7 +32,7 @@ def ecpay_payment(
|
|
|
MerchantTradeNo = 'test'+datetime.now().strftime("NO%Y%m%d%H%M%S")
|
|
|
remark = {'MerchantTradeNo':MerchantTradeNo}
|
|
|
remark_string = json.dumps(remark, ensure_ascii=False)
|
|
|
- ytviews = crud.simplepay.create_with_payment_data(db,
|
|
|
+ simplepay = crud.simplepay.create_with_payment_data(db,
|
|
|
obj_in=user_data,
|
|
|
epayment='ecpay',
|
|
|
remark=remark_string)
|
|
@@ -44,10 +44,10 @@ def ecpay_payment(
|
|
|
'TotalAmount': user_data.amount,
|
|
|
'TradeDesc': user_data.tradeDesc,
|
|
|
'ItemName': user_data.item,
|
|
|
- 'ReturnURL': 'https://cloud.choozmo.com/api/v1/payment/ytviews-ecpay-result-return',
|
|
|
+ 'ReturnURL': 'https://cloud.choozmo.com/api/v1/payment/simple-pay-ecpay-result-return',
|
|
|
'ChoosePayment': 'ALL',
|
|
|
- 'ClientBackURL': 'https://cloud.choozmo.com/test-yt-views',
|
|
|
- 'ItemURL': 'https://cloud.choozmo.com/test-yt-views',
|
|
|
+ 'ClientBackURL': 'https://cloud.choozmo.com/test-simple-pay',
|
|
|
+ 'ItemURL': 'https://cloud.choozmo.com/test-simple-pay',
|
|
|
'Remark': '',
|
|
|
'ChooseSubPayment': '',
|
|
|
'OrderResultURL': '',
|
|
@@ -56,7 +56,7 @@ def ecpay_payment(
|
|
|
'IgnorePayment': 'ATM#CVS#BARCODE',
|
|
|
'PlatformID': '',
|
|
|
'InvoiceMark': 'N',
|
|
|
- 'CustomField1': str(ytviews.id),
|
|
|
+ 'CustomField1': str(simplepay.id),
|
|
|
'CustomField2': user_data.taxID if user_data.taxID else '',
|
|
|
'CustomField3': '',
|
|
|
'CustomField4': '',
|
|
@@ -168,10 +168,10 @@ def ecpay_payment(
|
|
|
'TotalAmount': user_data.amount,
|
|
|
'TradeDesc': user_data.tradeDesc,
|
|
|
'ItemName': user_data.item,
|
|
|
- 'ReturnURL': 'https://cloud.choozmo.com/api/v1/payment/ytviews-ecpay-result-return',
|
|
|
+ 'ReturnURL': 'https://cloud.choozmo.com/api/v1/payment/simple-pay-ecpay-result-return',
|
|
|
'ChoosePayment': 'ALL',
|
|
|
- 'ClientBackURL': 'https://cloud.choozmo.com/yt-views',
|
|
|
- 'ItemURL': 'https://cloud.choozmo.com/yt-views',
|
|
|
+ 'ClientBackURL': 'https://cloud.choozmo.com/simple-pay',
|
|
|
+ 'ItemURL': 'https://cloud.choozmo.com/simple-pay',
|
|
|
'Remark': '',
|
|
|
'ChooseSubPayment': '',
|
|
|
'OrderResultURL': '',
|
|
@@ -321,7 +321,7 @@ CheckMacValue: {CheckMacValue}\
|
|
|
|
|
|
if RtnCode==1:
|
|
|
simplepay_id = int(CustomField1)
|
|
|
- simplepay = crud.simplepay.get(db=db, id=ytviews_id)
|
|
|
+ simplepay = crud.simplepay.get(db=db, id=simplepay_id)
|
|
|
remark = json.loads(simplepay.remark)
|
|
|
remark['TradeNo'] = TradeNo
|
|
|
crud.simplepay.update(db, db_obj=simplepay, obj_in={"payment_state":"succeeded", "remark":json.dumps(remark, ensure_ascii=False)})
|