提交代码
This commit is contained in:
parent
49754cc173
commit
42c9bb973f
|
|
@ -48,7 +48,7 @@ namespace HuanMeng.MiaoYu.WebPayApi.Controllers
|
|||
//}
|
||||
|
||||
/// <summary>
|
||||
/// ${tenant}/zfb/${orderId} http://localhost:90/api/Pay/default/wx/WX0T1724769806U000002P001M001RLZ/c2e0468ed21e79ebb4f3164b2a3209ac
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("{tenant?}/{pay?}/{orderId?}/{sign?}")]
|
||||
|
|
@ -76,7 +76,7 @@ namespace HuanMeng.MiaoYu.WebPayApi.Controllers
|
|||
var redis = RedisConnection.GetRedis(appConfig);
|
||||
if (!redis.StringSetLock(baseKey, "", 10))
|
||||
{
|
||||
return "error;重复请求";
|
||||
return "success";
|
||||
}
|
||||
var temantInfo = serviceProvider.GetRequiredService<ITenantInfo>();
|
||||
appConfig.ToITenantInfo(temantInfo);
|
||||
|
|
@ -90,7 +90,7 @@ namespace HuanMeng.MiaoYu.WebPayApi.Controllers
|
|||
if (intentOrder.Status != (int)OrderState.已下单)
|
||||
{
|
||||
redis.KeyDelete(baseKey);
|
||||
return $"error;订单{((OrderState)intentOrder.Status).ToString()}";
|
||||
return $"success";
|
||||
}
|
||||
intentOrder.Status = (int)OrderState.正在发货;
|
||||
await dao.daoDbMiaoYu.context.SaveChangesAsync();
|
||||
|
|
@ -123,10 +123,11 @@ namespace HuanMeng.MiaoYu.WebPayApi.Controllers
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError($"请求支付回调接口,发货失败,请求路径: {context.Request.Path}", ex);
|
||||
intentOrder.Status = (int)OrderState.发货失败;
|
||||
dao.daoDbMiaoYu.context.SaveChanges();
|
||||
logger.LogError($"请求支付回调接口,发货失败,请求路径: {context.Request.Path}", ex);
|
||||
await dao.daoDbMiaoYu.context.SaveChangesAsync();
|
||||
redis.KeyDelete(baseKey);
|
||||
return $"error;出现异常{ex.Message}";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user