|
@@ -28,7 +28,7 @@ namespace MySystem
|
|
|
// string BrhCode = "001040";
|
|
|
|
|
|
//生产环境
|
|
|
- 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
|
|
|
/// <param name="subAppIdType">对应的类型,默认为公众号, SUBSCRIPTION: 公众号 MINI_PROGRAM: 小程序</param>
|
|
|
/// <param name="ledgerModel">分账类型:1不分账 2分账,注意只有开通了分账才能传这个字段</param>
|
|
|
/// <returns></returns>
|
|
|
- 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); //支付确认码,由4位纯数字组成,每次请求时随机生成
|
|
@@ -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);//开发者id
|
|
|
- headdic.Add("appsecret", BoxAppSecret);//开发者密码
|
|
|
+ // headdic.Add("appid", BoxAppId);//开发者id
|
|
|
+ // headdic.Add("appsecret", BoxAppSecret);//开发者密码
|
|
|
headdic.Add("X-Up-AppId", BoxAppId);
|
|
|
headdic.Add("X-Timestamp", timestamp);
|
|
|
headdic.Add("X-Sign-Type", "SHA-256");
|