|
@@ -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) == "2050")
|
|
|
+ if (PeriodEnd.Substring(0, 4) == "9999")
|
|
|
{
|
|
|
- PeriodEnd = "forever";
|
|
|
+ // 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 = "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
|
|
|
|
|
|
|
|
|
//最终受益人信息列表(UBO)----仅企业需要填写
|
|
|
- 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");
|
|
|
//"{\"applyment_state\":\"APPLYMENT_STATE_REJECTED\",\"reject_param\":\"licence_valid_date|cert_valid_date\",\"reject_reason\":\"有效期开始日期填写有误,请填写与营业执照上一致的开始日期,如影印件上无开始日期请填写成立日期/注册日期;有效期结束日期填写有误,请填写与营业执照上一致的日期,如影印件上无结束日期请填写“长期”\"}"
|
|
|
-
|
|
|
+
|
|
|
//{\"applyment_id\":2000002247709762,\"applyment_state\":\"APPLYMENT_STATE_FINISHED\",\"applyment_state_msg\":\"商户入驻申请已完成\",\"audit_detail\":[],\"business_code\":\"0123456789\",\"sign_url\":\"https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQFv7zwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyUXE1czkzb3JlUjIxZHpXbTF5Y2YAAgRjbe9hAwQAjScA\",\"sub_mchid\":\"1619775262\"}
|
|
|
-
|
|
|
+ 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
|
|
|
// Encoding.UTF8.GetBytes(nonce),
|
|
|
// Encoding.UTF8.GetBytes(associatedData));
|
|
|
// gcmBlockCipher.Init(false, aeadParameters);
|
|
|
-
|
|
|
+
|
|
|
// byte[] data = Convert.FromBase64String(ciphertext);
|
|
|
// byte[] plaintext = new byte[gcmBlockCipher.GetOutputSize(data.Length)];
|
|
|
// int length = gcmBlockCipher.ProcessBytes(data, 0, data.Length, plaintext, 0);
|
|
@@ -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);
|