Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

半屏小程序管理接口 #2664

Merged
merged 24 commits into from
Jul 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c985768
modify
JeffreySu Jun 9, 2022
83429d5
更新 Sample
JeffreySu Jun 9, 2022
ac5308b
更新配置文件编码
JeffreySu Jun 9, 2022
9f7e9d7
跟新微信支付(V2)
JeffreySu Jun 9, 2022
c53eee9
更新 TenPayV3(APIv2)独立Demo
JeffreySu Jun 13, 2022
93b2513
添加注释
JeffreySu Jun 17, 2022
a63d1b1
更新Nuget版本信息
JeffreySu Jun 20, 2022
0562082
Merge pull request #2656 from JeffreySu/Developer
JeffreySu Jun 20, 2022
3b59304
Revert "更新Nuget版本信息"
JeffreySu Jun 21, 2022
24922a6
Merge branch 'Developer' into Developer-NewSamples
JeffreySu Jun 21, 2022
9f55cb9
TenPayV3 v0.6.3 添加“发起商家转账API” #2652 感谢 @y1024866464
JeffreySu Jun 29, 2022
c24d4a3
Merge pull request #2659 from JeffreySu/TenpayV3-Transfer
JeffreySu Jun 29, 2022
c702106
Merge branch 'TenpayV3-Transfer' into Developer-NewSamples
JeffreySu Jun 29, 2022
e816d9f
Sample v6.5.15 更新Sample链接
JeffreySu Jun 29, 2022
9814de9
Merge pull request #2660 from JeffreySu/Developer-NewSamples
JeffreySu Jun 29, 2022
480e7b3
更新 TenPayV2 Sample
JeffreySu Jun 30, 2022
67fb6bc
修改 TenPayV2 Sample 命名空间
JeffreySu Jul 2, 2022
2e3f749
更新 TenPayV2 Sample
JeffreySu Jul 2, 2022
39d3606
完成TenPayV2 - JSAPI 支付 独立Sample
JeffreySu Jul 2, 2022
26b69fb
Work v3.15.5.1 修复 ExternalApi.GetFollowUserList() 接口请求类型为 GET
JeffreySu Jul 3, 2022
6675316
Merge pull request #2662 from JeffreySu/Developer-NewSamples
JeffreySu Jul 3, 2022
67aa87d
Merge pull request #48 from JeffreySu/master
mc7246 Jul 6, 2022
6a61dc3
半屏小程序管理
mc7246 Jul 6, 2022
376a2c8
小程序客服管理
mc7246 Jul 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public ActionResult Index()
return View();
}

/// <summary>
/// 支付应答
/// </summary>
/// <returns></returns>
public ActionResult FeedBack()
{
//创建支付应答对象
Expand All @@ -80,13 +84,16 @@ public ActionResult FeedBack()
return Content(result);
}

/// <summary>
/// JSAPI 支付
/// </summary>
/// <returns></returns>
public ActionResult JsApi()
{
//string appId = TenPayInfo.AppId;
string timeStamp = "";
string nonceStr = "";
string packageValue = "";
string paySign = "";
string timeStamp = null;
string nonceStr = null;
string packageValue = null;
string paySign = null;

string sp_billno = Request.Form["order_no"];
//当前时间 yyyyMMdd
Expand Down Expand Up @@ -136,15 +143,6 @@ public ActionResult JsApi()
paySignReqHandler.SetParameter("timestamp", timeStamp);
paySignReqHandler.SetParameter("package", packageValue);
paySign = paySignReqHandler.CreateSHA1Sign();
//TenPay.Delivernotify(TenPayInfo.AppId, "oX99MDgNcgwnz3zFN3DNmo8uwa-w", "111112222233333", sp_billno,
// timeStamp, "1", "ok", "53cca9d47b883bd4a5c85a9300df3da0cb48565c", "sha1");


//获取debug信息,建议把请求和debug信息写入日志,方便定位问题
//string pakcageDebuginfo = packageReqHandler.getDebugInfo();
//result +="<br/>pakcageDebuginfo:" + pakcageDebuginfo + "<br/>");
//string paySignDebuginfo = paySignReqHandler.getDebugInfo();
//result +="<br/>paySignDebuginfo:" + paySignDebuginfo + "<br/>");

//TODO:和JSSDK一样整合信息包
ViewData["appId"] = TenPayInfo.AppId;
Expand All @@ -156,7 +154,10 @@ public ActionResult JsApi()
return View();
}


/// <summary>
/// Native 支付
/// </summary>
/// <returns></returns>
public ActionResult Native()
{
string sp_billno = Request.Form["order_no"];
Expand Down Expand Up @@ -198,6 +199,10 @@ public ActionResult Native()
return View();
}

/// <summary>
/// NativeCall
/// </summary>
/// <returns></returns>
public ActionResult NativeCall()
{
string sp_billno = Request.Form["order_no"];
Expand Down Expand Up @@ -264,14 +269,12 @@ public ActionResult NativeCall()
return View();
}

public ActionResult Alert()
{
return Content("success");
}

/// <summary>
/// 支付回调
/// </summary>
/// <returns></returns>
public ActionResult PayNotifyUrl()
{

ResponseHandler resHandler = new ResponseHandler(null);
resHandler.Init();
resHandler.SetKey(TenPayInfo.Key, TenPayInfo.AppKey);
Expand Down Expand Up @@ -340,6 +343,10 @@ public ActionResult PayNotifyUrl()
return Content("Success");
}

/// <summary>
/// 退款
/// </summary>
/// <returns></returns>
protected ActionResult Refund()
{
//创建请求对象
Expand Down Expand Up @@ -370,6 +377,7 @@ protected ActionResult Refund()
reqHandler.SetParameter("service_version", "1.1");

string requestUrl = reqHandler.GetRequestURL();
//输入证书地址和秘钥,根据实际情况修改
httpClient.SetCertInfo("c:\\key\\1900000109.pfx", "1900000109");
//设置请求内容
httpClient.SetReqContent(requestUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace Senparc.Weixin.Sample.Net6.Controllers
{
/*
* 友情提示:微信支付正式上线之前,请进行沙箱测试!
* 单元测试见:Senparc.Weixin.MP.Test.TenPayV3/TenPayV3Test.cs/GetSignKeyTest()
* 单元测试见:Senparc.Weixin.MP.Test/TenPayV3/TenPayV3Test.cs/GetSignKeyTest()
*/


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>6.5.14</Version>
<Version>6.5.15</Version>
<UserSecretsId>35e58786-0820-4cde-b1ff-f4c6198d00f7</UserSecretsId>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
目前 Senparc.Weixin SDK 已支持微信 8.x API 中几乎所有接口以及<strong>小程序</strong>
</h1>
<p>
当前站点运行 <a href="https://github.com/JeffreySu/WeiXinMPSDK/tree/master/Samples/netcore3-mvc/" target="_blank">Sample</a>
当前站点运行 <a href="https://github.com/JeffreySu/WeiXinMPSDK/tree/master/Samples/All/net6-mvc/" target="_blank">Sample</a>
版本:v@(TempData["SampleVersion"]) (@TempData["BuildTime"])
</p>
<p>&nbsp;</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
<p>@Html.ActionLink("点击这里使用H5支付", "H5Pay", "TenPayV3", new { productId = Model.Id, hc = Model.GetHashCode() }, null)</p>
<hr />

<h2>支付方式二:“扫一扫”支付</h2>
<h2>支付方式二:“扫一扫”支付(JsApi)</h2>
<p>
使用微信“扫一扫”下方二维码完成支付:<br />
<img src="@Url.Action("ProductPayCode",new{productId=Model.Id,hc=Model.GetHashCode()})" width="300" />
</p>
<p>提示:如果是在微信内部打开商品页面,则不会进入此页面,直接进入 JsApi 支付。</p>
<hr />

</body>
Expand Down
2 changes: 1 addition & 1 deletion Samples/MP/Senparc.Weixin.Sample.MP/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
{
options.AccountSettingFunc = context => Senparc.Weixin.Config.SenparcWeixinSetting;
});

#endregion

#endregion
Expand Down Expand Up @@ -69,7 +70,6 @@
#endif
#endregion


app.UseRouting();

app.UseAuthorization();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

<!--引用 Nuget 包-->
<ItemGroup>
<PackageReference Include="Senparc.Weixin.AspNet" Version="0.7.7" />
<PackageReference Include="Senparc.Weixin.MP" Version="16.17.9" />
<PackageReference Include="Senparc.Weixin.MP.Middleware" Version="0.7.7" />
<PackageReference Include="Senparc.Weixin.MP.MVC" Version="7.11.7" />
<PackageReference Include="Senparc.Weixin.AspNet" Version="0.8.1" />
<PackageReference Include="Senparc.Weixin.MP" Version="16.18.2.1" />
<PackageReference Include="Senparc.Weixin.MP.Middleware" Version="0.8.1" />
<PackageReference Include="Senparc.Weixin.MP.MVC" Version="7.12.1" />
</ItemGroup>

<!--直接引用源码-->
Expand Down
33 changes: 16 additions & 17 deletions Samples/MP/Senparc.Weixin.Sample.MP/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
{
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",

//������Ϣ�ᱻ�Զ�ʶ����������˵�������õIJ�������ɾ�������޸� key �󽫻��޷��Զ�ʶ��
//以下信息会被自动识别,如无特殊说明,不用的参数可以删除,但修改 key 后将会无法自动识别!

//CO2NET ����
//CO2NET 设置
"SenparcSetting": {
//����Ϊ CO2NET �� SenparcSetting ȫ�����ã������޸� key����ɾ���κ���
//以下为 CO2NET SenparcSetting 全局配置,请勿修改 key,勿删除任何项

"IsDebug": true,
"DefaultCacheNamespace": "DefaultCache",

//�ֲ�ʽ����
"Cache_Redis_Configuration": "#{Cache_Redis_Configuration}#", //Redis����
"Cache_Memcached_Configuration": "#{Cache_Memcached_Configuration}#", //Memcached����
//分布式缓存
"Cache_Redis_Configuration": "#{Cache_Redis_Configuration}#", //Redis配置
"Cache_Memcached_Configuration": "#{Cache_Memcached_Configuration}#", //Memcached配置
"SenparcUnionAgentKey": "#{SenparcUnionAgentKey}#" //SenparcUnionAgentKey
},
//Senparc.Weixin SDK ����
//Senparc.Weixin SDK 设置
"SenparcWeixinSetting": {
//����Ϊ Senparc.Weixin �� SenparcWeixinSetting ΢������
//ע�⣺���е��ַ���ֵ�����ܱ������ֵ�������������������ַ����������Ը�����Ҫ��ɾ����Ӧ���������ã���
//以下为 Senparc.Weixin SenparcWeixinSetting 微信配置
//注意:所有的字符串值都可能被用于字典索引,因此请勿留空字符串(但可以根据需要,删除对应的整条设置)!

//΢��ȫ��
//微信全局
"IsDebug": true,

//���²�ʹ�õIJ�������ɾ����key �޸ĺ󽫻�ʧЧ
//以下不使用的参数可以删除,key 修改后将会失效

//���ں�
"Token": "#{Token}#", //˵�����ַ���������#��{}����Ϊ Azure DevOps Ĭ�ϵ�ռλ����ʽ���������������Ϣ����ɾ��ͬռλ�����޸������ַ�����������#��{}���磺{"Token": "MyFullToken"}
//公众号
"Token": "#{Token}#", //说明:字符串内两侧#和{}符号为 Azure DevOps 默认的占位符格式,如果您有明文信息,请删除同占位符,修改整体字符串,不保留#和{},如:{"Token": "MyFullToken"}
"EncodingAESKey": "#{EncodingAESKey}#",
"WeixinAppId": "#{WeixinAppId}#",
"WeixinAppSecret": "#{WeixinAppSecret}#"

//����׷�Ӹ�������ƽ̨��������Ϣ
}
}
Loading