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

小程序虚拟支付 迁移代码 #2961

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 0 additions & 17 deletions src/Senparc.Weixin.MP/Senparc.Weixin.MP/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -428,23 +428,6 @@ public enum Event
/// </summary>
subscribe_msg_sent_event,
#endregion

#region 小程序虚拟支付
/// <summary>
/// 道具发货推送
/// </summary>
xpay_goods_deliver_notify,

/// <summary>
/// 代币支付推送
/// </summary>
xpay_coin_pay_notify,

/// <summary>
/// 退款推送
/// </summary>
xpay_refund_notify,
#endregion
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,6 @@ public virtual async Task<IResponseMessageBase> OnEventRequestAsync(IRequestMess
break;
#endregion

#region 小程序虚拟支付
case Event.xpay_goods_deliver_notify:
responseMessage = await OnEvent_XPay_Goods_Deliver_NotifyAsync(RequestMessage as RequestMessageEvent_XPay_Goods_Deliver_Notify);
break;
case Event.xpay_coin_pay_notify:
responseMessage = await OnEvent_XPay_Coin_Pay_NotifyAsync(RequestMessage as RequestMessageEvent_XPay_Coin_Pay_Notify);
break;
case Event.xpay_refund_notify:
responseMessage = await OnEvent_XPay_Refund_NotifyAsync(RequestMessage as RequestMessageEvent_XPay_Refund_Notify);
break;
#endregion

default:
throw new Exceptions.UnknownRequestMsgTypeException("未知的Event下属请求信息", null);
}
Expand Down Expand Up @@ -781,39 +769,6 @@ public virtual async Task<IResponseMessageBase> OnEvent_Subscribe_Msg_SentReques
}
#endregion

#region 小程序虚拟支付

/// <summary>
/// 小程序虚拟支付 - 道具发货推送
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public virtual async Task<IResponseMessageBase> OnEvent_XPay_Goods_Deliver_NotifyAsync(RequestMessageEvent_XPay_Goods_Deliver_Notify requestMessage)
{
return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPay_Goods_Deliver_Notify(requestMessage)).ConfigureAwait(false);
}

/// <summary>
/// 小程序虚拟支付 - 代币支付推送
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public virtual async Task<IResponseMessageBase> OnEvent_XPay_Coin_Pay_NotifyAsync(RequestMessageEvent_XPay_Coin_Pay_Notify requestMessage)
{
return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPay_Coin_Pay_Notify(requestMessage)).ConfigureAwait(false);
}

/// <summary>
/// 小程序虚拟支付 - 退款推送
/// </summary>
/// <param name="requestMessage"></param>
/// <returns></returns>
public virtual async Task<IResponseMessageBase> OnEvent_XPay_Refund_NotifyAsync(RequestMessageEvent_XPay_Refund_Notify requestMessage)
{
return await DefaultAsyncMethod(requestMessage, () => OnEvent_XPay_Refund_Notify(requestMessage)).ConfigureAwait(false);
}
#endregion

#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -249,18 +249,6 @@ public virtual IResponseMessageBase OnEventRequest(IRequestMessageEventBase requ
break;
#endregion

#region 小程序虚拟支付
case Event.xpay_goods_deliver_notify:
responseMessage = OnEvent_XPay_Goods_Deliver_Notify(RequestMessage as RequestMessageEvent_XPay_Goods_Deliver_Notify);
break;
case Event.xpay_coin_pay_notify:
responseMessage = OnEvent_XPay_Coin_Pay_Notify(RequestMessage as RequestMessageEvent_XPay_Coin_Pay_Notify);
break;
case Event.xpay_refund_notify:
responseMessage = OnEvent_XPay_Refund_Notify(RequestMessage as RequestMessageEvent_XPay_Refund_Notify);
break;
#endregion

default:
throw new Exceptions.UnknownRequestMsgTypeException("未知的Event下属请求信息", null);
}
Expand Down Expand Up @@ -786,21 +774,6 @@ public virtual IResponseMessageBase OnEvent_Subscribe_Msg_SentRequest(RequestMes
return DefaultResponseMessage(requestMessage);
}
#endregion

#region 小程序虚拟支付
public virtual IResponseMessageBase OnEvent_XPay_Goods_Deliver_Notify(RequestMessageEvent_XPay_Goods_Deliver_Notify requestMessage)
{
return DefaultResponseMessage(requestMessage);
}
public virtual IResponseMessageBase OnEvent_XPay_Coin_Pay_Notify(RequestMessageEvent_XPay_Coin_Pay_Notify requestMessage)
{
return DefaultResponseMessage(requestMessage);
}
public virtual IResponseMessageBase OnEvent_XPay_Refund_Notify(RequestMessageEvent_XPay_Refund_Notify requestMessage)
{
return DefaultResponseMessage(requestMessage);
}
#endregion
#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ and limitations under the License.
using Senparc.NeuChar;
using Senparc.Weixin.CommonAPIs;
using Senparc.Weixin.Entities;
using Senparc.Weixin.Open.XPayAPIs.XPayJson;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 小程序虚拟支付
/// https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html#_2-3-%E6%9C%8D%E5%8A%A1%E5%99%A8API
/// </summary>
[NcApiBind(NeuChar.PlatformType.WeChat_Open, true)]
[NcApiBind(NeuChar.PlatformType.WeChat_MiniProgram, true)]
public class XPayApi
{
#region 同步方法
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 绑定广告金充值账户
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 代币支付退款(currency_pay接口的逆操作)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 代币支付退款(currency_pay接口的逆操作)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 充值广告金
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 创建提现单
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 扣减代币(一般用于代币支付)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 扣减代币(一般用于代币支付)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 通知已经发货完成(只能通知现金单),正常通过xpay_goods_deliver_notify消息推送返回成功就不需要调用这个api接口。这个接口用于异常情况推送不成功时手动将单改成已发货状态
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 查询广告金发放记录
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Senparc.Weixin.Entities;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 查询创建的订单(现金单,非代币单)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 查询批量发布道具任务
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 查询批量上传道具任务
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 查询用户代币余额
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 查询提现单
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 对使用jsapi接口下的单进行退款,此接口只是启动退款任务成功,启动后需要调用query_order接口来查询退款单状态,等状态变成退款完成后即为最终成功
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 启动批量发布道具任务
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace Senparc.Weixin.Open.XPayAPIs.XPayJson
namespace Senparc.Weixin.WxOpen.AdvancedAPIs.XPay
{
/// <summary>
/// 启动批量上传道具任务
Expand Down
Loading