Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
3aa2c438
Commit
3aa2c438
authored
Nov 07, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
73d671c3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
1 deletion
+51
-1
DataConstant.cs
Mall.CacheManager/DataStatistic/DataConstant.cs
+5
-0
UserReidsCache.cs
Mall.CacheManager/User/UserReidsCache.cs
+15
-0
AdapayController.cs
Mall.WebApi/Controllers/Adapay/AdapayController.cs
+31
-1
No files found.
Mall.CacheManager/DataStatistic/DataConstant.cs
View file @
3aa2c438
...
...
@@ -27,5 +27,10 @@ namespace Mall.CacheManager.DataStatistic
///订单支付缓存
/// </summary>
public
static
readonly
string
DATA_OrderPayId
=
"DATA_OrderPayId_"
;
/// <summary>
/// 支付宝支付信息
/// </summary>
public
static
readonly
string
DATA_AliPay_Order
=
"D_AliPay_Order_"
;
}
}
Mall.CacheManager/User/UserReidsCache.cs
View file @
3aa2c438
...
...
@@ -561,5 +561,20 @@ namespace Mall.CacheManager.User
return
downLoad
;
}
#
region
支付宝支付信息
/// <summary>
/// 获取用户支付信息
/// </summary>
/// <param name="cacheKey"></param>
/// <returns></returns>
public
static
List
<
UserWaitPayInfo
>
GetOrderPay
(
string
cacheKey
)
{
var
payInfo
=
redis
.
StringGet
<
List
<
UserWaitPayInfo
>>(
cacheKey
);
return
payInfo
??
new
List
<
UserWaitPayInfo
>();
}
#
endregion
}
}
Mall.WebApi/Controllers/Adapay/AdapayController.cs
View file @
3aa2c438
...
...
@@ -4,6 +4,8 @@ using System.Linq;
using
AdapayCore
;
using
AdapaySDK
;
using
Mall.CacheManager.AppletWeChat
;
using
Mall.CacheManager.User
;
using
Mall.Common
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
using
Mall.Model.Extend.Product
;
...
...
@@ -84,7 +86,35 @@ namespace Mall.WebApi.Controllers.Adapay
if
(
pay_channel
==
"alipay_qr"
)
{
pay_info
=
JObject
.
Parse
(
expend
.
ToString
()).
GetStringValue
(
"qrcode_url"
);
#
region
存入缓存
try
{
string
payInfoKey
=
CacheManager
.
DataStatistic
.
DataConstant
.
DATA_AliPay_Order
+
userInfo
.
OpenId
;
var
zfbPayList
=
UserReidsCache
.
GetOrderPay
(
payInfoKey
);
if
(
zfbPayList
.
Where
(
x
=>
x
.
OrderId
==
orderId
).
Any
())
{
//存在
foreach
(
var
item
in
zfbPayList
.
Where
(
x
=>
x
.
OrderId
==
orderId
))
{
item
.
PayInfo
=
pay_info
;
}
UserReidsCache
.
Set
(
payInfoKey
,
JsonHelper
.
Serialize
(
zfbPayList
),
1800
);
//储存30分钟
}
else
{
zfbPayList
.
Add
(
new
UserWaitPayInfo
()
{
OrderId
=
orderId
,
PayInfo
=
pay_info
});
UserReidsCache
.
Set
(
payInfoKey
,
JsonHelper
.
Serialize
(
zfbPayList
),
1800
);
//储存30分钟
}
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
"GetOrderPay 支付信息存缓存失败"
);
}
#
endregion
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment