|
@@ -55,7 +55,7 @@ namespace MySystem
|
|
|
|
|
|
Dictionary<string, object> subject_info = new Dictionary<string, object>();
|
|
|
string SubjectType = info.SubjectType;
|
|
|
- if(SubjectType == "SUBJECT_TYPE_SMALL") SubjectType = "SUBJECT_TYPE_MICRO";
|
|
|
+ if (SubjectType == "SUBJECT_TYPE_SMALL") SubjectType = "SUBJECT_TYPE_MICRO";
|
|
|
subject_info.Add("subject_type", SubjectType);
|
|
|
|
|
|
Dictionary<string, object> business_licence_info = new Dictionary<string, object>();
|
|
@@ -65,12 +65,14 @@ namespace MySystem
|
|
|
business_licence_info.Add("legal_person", info.CertLegalPerson);
|
|
|
business_licence_info.Add("company_address", info.BizStoreAddress);
|
|
|
string PeriodEnd = info.PeriodEnd.Value.ToString("yyyy-MM-dd");
|
|
|
- if(PeriodEnd.Substring(0, 4) == "2050")
|
|
|
+
|
|
|
+ if (PeriodEnd.Substring(0, 4) == "9999")
|
|
|
{
|
|
|
- PeriodEnd = "forever";
|
|
|
+
|
|
|
+ PeriodEnd = "长期";
|
|
|
}
|
|
|
business_licence_info.Add("licence_valid_date", "[\"" + info.PeriodBegin.Value.ToString("yyyy-MM-dd") + "\",\"" + PeriodEnd + "\"]");
|
|
|
-
|
|
|
+
|
|
|
subject_info.Add("business_licence_info", business_licence_info);
|
|
|
result.Add("subject_info", subject_info);
|
|
|
|
|
@@ -80,15 +82,16 @@ namespace MySystem
|
|
|
identification_info.Add("identification_name", RSAEncrypt(info.CertLegalPerson));
|
|
|
identification_info.Add("identification_number", RSAEncrypt(info.IdCardNumber));
|
|
|
string CardPeriodEnd = info.CardPeriodEnd.Value.ToString("yyyy-MM-dd");
|
|
|
- if(CardPeriodEnd.Substring(0, 4) == "2050")
|
|
|
+ if (CardPeriodEnd.Substring(0, 4) == "2050")
|
|
|
{
|
|
|
- CardPeriodEnd = "forever";
|
|
|
+
|
|
|
+ CardPeriodEnd = "长期";
|
|
|
}
|
|
|
identification_info.Add("identification_valid_date", "[\"" + info.CardPeriodBegin.Value.ToString("yyyy-MM-dd") + "\",\"" + CardPeriodEnd + "\"]");
|
|
|
identification_info.Add("identification_front_copy", GetMediaId("/" + info.IdCardCopy));
|
|
|
identification_info.Add("identification_back_copy", GetMediaId("/" + info.IdCardNational));
|
|
|
bool owner = true;
|
|
|
- if(info.SubjectType == "SUBJECT_TYPE_ENTERPRISE")
|
|
|
+ if (info.SubjectType == "SUBJECT_TYPE_ENTERPRISE")
|
|
|
{
|
|
|
identification_info.Add("identification_address", RSAEncrypt(info.IdCardAddress));
|
|
|
identification_info.Add("owner", owner);
|
|
@@ -97,7 +100,7 @@ namespace MySystem
|
|
|
|
|
|
|
|
|
|
|
|
- if(info.SubjectType == "SUBJECT_TYPE_ENTERPRISE" && !owner)
|
|
|
+ if (info.SubjectType == "SUBJECT_TYPE_ENTERPRISE" && !owner)
|
|
|
{
|
|
|
List<Dictionary<string, object>> ubo_info_list = new List<Dictionary<string, object>>();
|
|
|
Dictionary<string, object> ubo_info_list_item = new Dictionary<string, object>();
|
|
@@ -108,7 +111,7 @@ namespace MySystem
|
|
|
ubo_info_list_item.Add("ubo_id_doc_number", RSAEncrypt(info.IdCardNumber));
|
|
|
ubo_info_list_item.Add("ubo_id_doc_address", RSAEncrypt(info.IdCardAddress));
|
|
|
ubo_info_list_item.Add("ubo_period_begin", info.CardPeriodBegin.Value.ToString("yyyy-MM-dd"));
|
|
|
- if(CardPeriodEnd == "forever")
|
|
|
+ if (CardPeriodEnd == "forever")
|
|
|
{
|
|
|
CardPeriodEnd = "长期";
|
|
|
}
|
|
@@ -141,9 +144,11 @@ namespace MySystem
|
|
|
{
|
|
|
result = postJson("https://api.mch.weixin.qq.com/v3/apply4subject/applyment?applyment_id=" + BusinessCode, "", "GET");
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
-
|
|
|
+ function.WriteLog(BusinessCode, "间连商户开户意愿确认(提交申请单)查询申请单状态-请求参数");
|
|
|
+ function.WriteLog(result, "间连商户开户意愿确认(提交申请单)查询申请单状态");
|
|
|
+
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -152,13 +157,13 @@ namespace MySystem
|
|
|
return result;
|
|
|
}
|
|
|
#endregion
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
#region 获取平台证书
|
|
|
|
|
|
public string GetPlatCert()
|
|
|
- {
|
|
|
+ {
|
|
|
string merchantId = MchId;
|
|
|
string result = postJson("https://api.mch.weixin.qq.com/v3/certificates", "", "GET");
|
|
|
return result;
|
|
@@ -204,7 +209,7 @@ namespace MySystem
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -307,16 +312,16 @@ namespace MySystem
|
|
|
builder.Append(hash[i].ToString("x2"));
|
|
|
}
|
|
|
var sha256 = builder.ToString();
|
|
|
- string metaStr = "{\"filename\":\""+ filename + "\",\"sha256\":\"" + sha256 + "\"}";
|
|
|
+ string metaStr = "{\"filename\":\"" + filename + "\",\"sha256\":\"" + sha256 + "\"}";
|
|
|
media_id = UploadImgApi(metaStr, imgBytesIn, filename);
|
|
|
RedisDbconn.Instance.Set(key, media_id);
|
|
|
return media_id;
|
|
|
}
|
|
|
|
|
|
- public string UploadImgApi(string metaStr, Byte[] imgBytesIn,string filename)
|
|
|
+ public string UploadImgApi(string metaStr, Byte[] imgBytesIn, string filename)
|
|
|
{
|
|
|
string url = "https://api.mch.weixin.qq.com/v3/merchant/media/upload";
|
|
|
-
|
|
|
+
|
|
|
string merchantId = MchId;
|
|
|
string privateKey = prikey;
|
|
|
#region 定义请求体中的内容 并转成二进制
|
|
@@ -335,16 +340,16 @@ namespace MySystem
|
|
|
+ Enter
|
|
|
+ "--" + boundary
|
|
|
+ Enter
|
|
|
- + "Content-Disposition:form-data;name=\"file\";filename=\""+ filename + "\";"
|
|
|
+ + "Content-Disposition:form-data;name=\"file\";filename=\"" + filename + "\";"
|
|
|
+ Enter
|
|
|
+ "Content-Type:image/jpeg"
|
|
|
+ Enter
|
|
|
+ Enter;
|
|
|
byte[] byteData2
|
|
|
= imgBytesIn;
|
|
|
- string campaignIDStr3
|
|
|
+ string campaignIDStr3
|
|
|
= Enter
|
|
|
- + "--" + boundary
|
|
|
+ + "--" + boundary
|
|
|
+ Enter;
|
|
|
var byteData1 = System.Text.Encoding.UTF8.GetBytes(campaignIDStr1);
|
|
|
|
|
@@ -352,7 +357,7 @@ namespace MySystem
|
|
|
#endregion
|
|
|
|
|
|
string transactionsResponse = UploadImg_postJson(url, byteData1, byteData2, byteData3, metaStr, privateKey, merchantId, serialNo, boundary, "POST");
|
|
|
- var result=JsonMapper.ToObject(transactionsResponse);
|
|
|
+ var result = JsonMapper.ToObject(transactionsResponse);
|
|
|
return result["media_id"].ToString();
|
|
|
}
|
|
|
public string UploadImg_postJson(string url, byte[] b1, byte[] b2, byte[] b3, string metaStr, string privateKey, string merchantId, string serialNo, string boundary, string method = "POST")
|
|
@@ -436,7 +441,7 @@ namespace MySystem
|
|
|
#region 获取文件sha256
|
|
|
|
|
|
public string GetSha256(FileStream stream)
|
|
|
- {
|
|
|
+ {
|
|
|
using (SHA256 mySHA256 = SHA256.Create())
|
|
|
{
|
|
|
byte[] hashValue = mySHA256.ComputeHash(stream);
|