|
@@ -28,7 +28,7 @@ namespace MySystem
|
|
|
|
|
|
|
|
|
|
|
|
- string BoxRequestUrl = "https://openapi-test.iboxpay.com";
|
|
|
+ string BoxRequestUrl = "https://openapi.iboxpay.com";
|
|
|
string BoxAppId = "AP7175619323825451008";
|
|
|
string BoxAppSecret = "hUfR53gdjyfiZTBR5bILanMqRD1dXD7y";
|
|
|
string BoxPublicKey = "";
|
|
@@ -305,14 +305,15 @@ namespace MySystem
|
|
|
|
|
|
|
|
|
|
|
|
- public string WeChatPay(string mchtNo, string storeNo, string outOrderNo, string transAmount, string callbackUrl, string subOpenId, string confirmCode, string subAppId, string subAppIdType, string ledgerModel)
|
|
|
+ public string WeChatPay(string mchtNo, string storeNo, string outOrderNo, decimal transAmount, string callbackUrl, string subOpenId, string confirmCode, string subAppId, string subAppIdType, string ledgerModel)
|
|
|
{
|
|
|
function.WriteLog(DateTime.Now.ToString(), "好哒微信公众号和小程序支付");
|
|
|
Dictionary<string, object> reqdic = new Dictionary<string, object>();
|
|
|
reqdic.Add("mchtNo", mchtNo);
|
|
|
reqdic.Add("storeNo", storeNo);
|
|
|
reqdic.Add("outOrderNo", outOrderNo);
|
|
|
- reqdic.Add("transAmount", transAmount);
|
|
|
+ int payMonth = (int)(transAmount * 100);
|
|
|
+ reqdic.Add("transAmount", payMonth);
|
|
|
reqdic.Add("callbackUrl", callbackUrl);
|
|
|
reqdic.Add("subOpenId", subOpenId);
|
|
|
reqdic.Add("confirmCode", confirmCode);
|
|
@@ -326,8 +327,8 @@ namespace MySystem
|
|
|
string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
|
|
|
function.WriteLog("请求头\n" + head, "好哒微信公众号和小程序支付");
|
|
|
function.WriteLog("请求参数\n" + req, "好哒微信公众号和小程序支付");
|
|
|
- function.WriteLog("请求地址:" + BoxRequestUrl + "/hzg/v2/unitedtrade/wechat_js_pay", "好哒微信公众号和小程序支付");
|
|
|
- string result = PostWebRequest(BoxRequestUrl + "/hzg/v2/unitedtrade/wechat_js_pay", req, headdic);
|
|
|
+ function.WriteLog("请求地址:" + BoxRequestUrl + "/api/hzg/v2/unitedtrade/wechat_js_pay", "好哒微信公众号和小程序支付");
|
|
|
+ string result = PostWebRequest(BoxRequestUrl + "/api/hzg/v2/unitedtrade/wechat_js_pay", req, headdic);
|
|
|
function.WriteLog("返回\n" + result + "\n\n", "好哒微信公众号和小程序支付");
|
|
|
|
|
|
return result;
|
|
@@ -376,8 +377,8 @@ namespace MySystem
|
|
|
{
|
|
|
Dictionary<string, string> headdic = new Dictionary<string, string>();
|
|
|
string timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
- headdic.Add("appid", BoxAppId);
|
|
|
- headdic.Add("appsecret", BoxAppSecret);
|
|
|
+
|
|
|
+
|
|
|
headdic.Add("X-Up-AppId", BoxAppId);
|
|
|
headdic.Add("X-Timestamp", timestamp);
|
|
|
headdic.Add("X-Sign-Type", "SHA-256");
|