|
@@ -17,7 +17,7 @@ namespace WingPaymentService.Common.WeChat
|
|
*/
|
|
*/
|
|
public async Task<WxPayData> Micropay(WxPayData inputObj, int timeOut = 10)
|
|
public async Task<WxPayData> Micropay(WxPayData inputObj, int timeOut = 10)
|
|
{
|
|
{
|
|
- string url = "https://api.mch.weixin.qq.com/pay/micropay";
|
|
|
|
|
|
+ string url = $"{WxPayConfig.GetConfig().GetServerUrl()}/pay/micropay";
|
|
//检测必填参数
|
|
//检测必填参数
|
|
if (!inputObj.IsSet("body"))
|
|
if (!inputObj.IsSet("body"))
|
|
{
|
|
{
|
|
@@ -70,7 +70,7 @@ namespace WingPaymentService.Common.WeChat
|
|
*/
|
|
*/
|
|
public async Task<WxPayData> OrderQuery(WxPayData inputObj, int timeOut = 6)
|
|
public async Task<WxPayData> OrderQuery(WxPayData inputObj, int timeOut = 6)
|
|
{
|
|
{
|
|
- string url = "https://api.mch.weixin.qq.com/pay/orderquery";
|
|
|
|
|
|
+ string url = $"{WxPayConfig.GetConfig().GetServerUrl()}/pay/orderquery";
|
|
//检测必填参数
|
|
//检测必填参数
|
|
if (!inputObj.IsSet("out_trade_no") && !inputObj.IsSet("transaction_id"))
|
|
if (!inputObj.IsSet("out_trade_no") && !inputObj.IsSet("transaction_id"))
|
|
{
|
|
{
|
|
@@ -112,7 +112,7 @@ namespace WingPaymentService.Common.WeChat
|
|
*/
|
|
*/
|
|
public async Task<WxPayData> Reverse(WxPayData inputObj, int timeOut = 6)
|
|
public async Task<WxPayData> Reverse(WxPayData inputObj, int timeOut = 6)
|
|
{
|
|
{
|
|
- string url = "https://api.mch.weixin.qq.com/secapi/pay/reverse";
|
|
|
|
|
|
+ string url = $"{WxPayConfig.GetConfig().GetServerUrl()}/secapi/pay/reverse";
|
|
//检测必填参数
|
|
//检测必填参数
|
|
if (!inputObj.IsSet("out_trade_no") && !inputObj.IsSet("transaction_id"))
|
|
if (!inputObj.IsSet("out_trade_no") && !inputObj.IsSet("transaction_id"))
|
|
{
|
|
{
|
|
@@ -153,7 +153,7 @@ namespace WingPaymentService.Common.WeChat
|
|
*/
|
|
*/
|
|
public async Task<WxPayData> Refund(WxPayData inputObj, int timeOut = 6)
|
|
public async Task<WxPayData> Refund(WxPayData inputObj, int timeOut = 6)
|
|
{
|
|
{
|
|
- string url = "https://api.mch.weixin.qq.com/secapi/pay/refund";
|
|
|
|
|
|
+ string url = $"{WxPayConfig.GetConfig().GetServerUrl()}/secapi/pay/refund";
|
|
//检测必填参数
|
|
//检测必填参数
|
|
if (!inputObj.IsSet("out_trade_no") && !inputObj.IsSet("transaction_id"))
|
|
if (!inputObj.IsSet("out_trade_no") && !inputObj.IsSet("transaction_id"))
|
|
{
|
|
{
|
|
@@ -212,7 +212,7 @@ namespace WingPaymentService.Common.WeChat
|
|
*/
|
|
*/
|
|
public async Task<WxPayData> RefundQuery(WxPayData inputObj, int timeOut = 6)
|
|
public async Task<WxPayData> RefundQuery(WxPayData inputObj, int timeOut = 6)
|
|
{
|
|
{
|
|
- string url = "https://api.mch.weixin.qq.com/pay/refundquery";
|
|
|
|
|
|
+ string url = $"{WxPayConfig.GetConfig().GetServerUrl()}/pay/refundquery";
|
|
//检测必填参数
|
|
//检测必填参数
|
|
if (!inputObj.IsSet("out_refund_no") && !inputObj.IsSet("out_trade_no") &&
|
|
if (!inputObj.IsSet("out_refund_no") && !inputObj.IsSet("out_trade_no") &&
|
|
!inputObj.IsSet("transaction_id") && !inputObj.IsSet("refund_id"))
|
|
!inputObj.IsSet("transaction_id") && !inputObj.IsSet("refund_id"))
|
|
@@ -253,7 +253,7 @@ namespace WingPaymentService.Common.WeChat
|
|
*/
|
|
*/
|
|
public async Task<WxPayData> DownloadBill(WxPayData inputObj, int timeOut = 6)
|
|
public async Task<WxPayData> DownloadBill(WxPayData inputObj, int timeOut = 6)
|
|
{
|
|
{
|
|
- string url = "https://api.mch.weixin.qq.com/pay/downloadbill";
|
|
|
|
|
|
+ string url = $"{WxPayConfig.GetConfig().GetServerUrl()}/pay/downloadbill";
|
|
//检测必填参数
|
|
//检测必填参数
|
|
if (!inputObj.IsSet("bill_date"))
|
|
if (!inputObj.IsSet("bill_date"))
|
|
{
|
|
{
|
|
@@ -298,7 +298,7 @@ namespace WingPaymentService.Common.WeChat
|
|
*/
|
|
*/
|
|
public async Task<WxPayData> ShortUrl(WxPayData inputObj, int timeOut = 6)
|
|
public async Task<WxPayData> ShortUrl(WxPayData inputObj, int timeOut = 6)
|
|
{
|
|
{
|
|
- string url = "https://api.mch.weixin.qq.com/tools/shorturl";
|
|
|
|
|
|
+ string url = $"{WxPayConfig.GetConfig().GetServerUrl()}/tools/shorturl";
|
|
//检测必填参数
|
|
//检测必填参数
|
|
if (!inputObj.IsSet("long_url"))
|
|
if (!inputObj.IsSet("long_url"))
|
|
{
|
|
{
|
|
@@ -337,7 +337,7 @@ namespace WingPaymentService.Common.WeChat
|
|
*/
|
|
*/
|
|
public async Task<WxPayData> UnifiedOrder(WxPayData inputObj, int timeOut = 6)
|
|
public async Task<WxPayData> UnifiedOrder(WxPayData inputObj, int timeOut = 6)
|
|
{
|
|
{
|
|
- string url = "https://api.mch.weixin.qq.com/pay/unifiedorder";
|
|
|
|
|
|
+ string url = $"{WxPayConfig.GetConfig().GetServerUrl()}/pay/unifiedorder";
|
|
//检测必填参数
|
|
//检测必填参数
|
|
if (!inputObj.IsSet("out_trade_no"))
|
|
if (!inputObj.IsSet("out_trade_no"))
|
|
{
|
|
{
|
|
@@ -366,12 +366,7 @@ namespace WingPaymentService.Common.WeChat
|
|
throw new WxPayException("统一支付接口中,缺少必填参数product_id!trade_type为JSAPI时,product_id为必填参数!");
|
|
throw new WxPayException("统一支付接口中,缺少必填参数product_id!trade_type为JSAPI时,product_id为必填参数!");
|
|
}
|
|
}
|
|
|
|
|
|
- //异步通知url未设置,则使用配置文件中的url
|
|
|
|
- if (!inputObj.IsSet("notify_url"))
|
|
|
|
- {
|
|
|
|
- inputObj.SetValue("notify_url", WxPayConfig.GetConfig().GetNotifyUrl());//异步通知url
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ inputObj.SetValue("notify_url", WxPayConfig.GetConfig().GetNotifyUrl());//异步通知url
|
|
inputObj.SetValue("appid", WxPayConfig.GetConfig().GetAppId());//公众账号ID
|
|
inputObj.SetValue("appid", WxPayConfig.GetConfig().GetAppId());//公众账号ID
|
|
inputObj.SetValue("mch_id", WxPayConfig.GetConfig().GetMchId());//商户号
|
|
inputObj.SetValue("mch_id", WxPayConfig.GetConfig().GetMchId());//商户号
|
|
inputObj.SetValue("spbill_create_ip", WxPayConfig.GetConfig().GetIp());//终端ip
|
|
inputObj.SetValue("spbill_create_ip", WxPayConfig.GetConfig().GetIp());//终端ip
|
|
@@ -407,7 +402,7 @@ namespace WingPaymentService.Common.WeChat
|
|
*/
|
|
*/
|
|
public async Task<WxPayData> CloseOrder(WxPayData inputObj, int timeOut = 6)
|
|
public async Task<WxPayData> CloseOrder(WxPayData inputObj, int timeOut = 6)
|
|
{
|
|
{
|
|
- string url = "https://api.mch.weixin.qq.com/pay/closeorder";
|
|
|
|
|
|
+ string url = $"{WxPayConfig.GetConfig().GetServerUrl()}/pay/closeorder";
|
|
//检测必填参数
|
|
//检测必填参数
|
|
if (!inputObj.IsSet("out_trade_no"))
|
|
if (!inputObj.IsSet("out_trade_no"))
|
|
{
|
|
{
|