bugfix
This commit is contained in:
parent
ccc6264a7f
commit
027693094b
@ -23,8 +23,8 @@ class PaymentLog:
|
|||||||
dbname = self.env.get_module_dbname('unipay')
|
dbname = self.env.get_module_dbname('unipay')
|
||||||
async with self.db.sqlorContext(dbname) as sor:
|
async with self.db.sqlorContext(dbname) as sor:
|
||||||
return await self.sor_new_log(sor, userid, customerid, channel,
|
return await self.sor_new_log(sor, userid, customerid, channel,
|
||||||
amount, feerate,
|
amount, feerate,
|
||||||
client_ip, currency=currency)
|
client_ip, currency=currency)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
async def sor_new_log(self, sor,
|
async def sor_new_log(self, sor,
|
||||||
@ -117,25 +117,25 @@ async def new_refund_log(request, amount, origin_id):
|
|||||||
if len(recs) < 1:
|
if len(recs) < 1:
|
||||||
raise Exception(f'{origin_id} not a payment_log')
|
raise Exception(f'{origin_id} not a payment_log')
|
||||||
ol = recs[0]
|
ol = recs[0]
|
||||||
ns = {
|
ns = {
|
||||||
"id": env.uuid(),
|
"id": env.uuid(),
|
||||||
"customerid": ol.customerid,
|
"customerid": ol.customerid,
|
||||||
"channelid": ol.channel,
|
"channelid": ol.channel,
|
||||||
"payment_name": REFUND,
|
"payment_name": REFUND,
|
||||||
"payer_client_ip": ol.client_ip,
|
"payer_client_ip": ol.client_ip,
|
||||||
"amount_total": amount,
|
"amount_total": amount,
|
||||||
"pay_feerate": 0.0,
|
"pay_feerate": 0.0,
|
||||||
"pay_fee": 0.0,
|
"pay_fee": 0.0,
|
||||||
"currency": ol.currency,
|
"currency": ol.currency,
|
||||||
"payment_status": '0',
|
"payment_status": '0',
|
||||||
"init_timestamp": timestampstr(),
|
"init_timestamp": timestampstr(),
|
||||||
"payed_timestamp": "2000-01-01 00:00:00.001",
|
"payed_timestamp": "2000-01-01 00:00:00.001",
|
||||||
"cancel_timestamp": "2000-01-01 00:00:00.001",
|
"cancel_timestamp": "2000-01-01 00:00:00.001",
|
||||||
"userid": userid,
|
"userid": userid,
|
||||||
"origin_id": origin_id
|
"origin_id": origin_id
|
||||||
}
|
}
|
||||||
await sor.C('payment_log', ns.copy())
|
await sor.C('payment_log', ns.copy())
|
||||||
return DictObject(**ns)
|
return DictObject(**ns)
|
||||||
|
|
||||||
async def unipay_accounting(request, data):
|
async def unipay_accounting(request, data):
|
||||||
logid = data.out_trade_no
|
logid = data.out_trade_no
|
||||||
@ -154,7 +154,7 @@ async def unipay_accounting(request, data):
|
|||||||
r.customerid,
|
r.customerid,
|
||||||
'RECHARGE',
|
'RECHARGE',
|
||||||
r.id,
|
r.id,
|
||||||
await env.get_business_date(sor),
|
await env.get_business_date(sor),
|
||||||
r.amount_total,
|
r.amount_total,
|
||||||
r.pay_feerate
|
r.pay_feerate
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user