|
|
@@ -0,0 +1,92 @@
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Text;
|
|
|
+using Library;
|
|
|
+using MySystem.Entity.UnionPay;
|
|
|
+
|
|
|
+namespace MySystem.Util.UnionPay
|
|
|
+{
|
|
|
+ /// <summary>
|
|
|
+ /// 银联商户简化操作帮助类
|
|
|
+ /// </summary>
|
|
|
+ public class UnionPayMerchantSimpleHelper : UnionPayBase
|
|
|
+ {
|
|
|
+ public readonly static UnionPayMerchantSimpleHelper Instance = new UnionPayMerchantSimpleHelper();
|
|
|
+ private UnionPayMerchantSimpleHelper()
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 简化版商户注册
|
|
|
+ /// </summary>
|
|
|
+ /// <returns>注册结果</returns>
|
|
|
+ public void SimpleMerchantRegister(MySystem.Models.Main.MerchantAddInfo merchantAddInfo)
|
|
|
+ {
|
|
|
+ string userName = "";
|
|
|
+ string password = "";
|
|
|
+ string phone = "";
|
|
|
+ string legalPersonName = "";
|
|
|
+ int certificateType = 0;
|
|
|
+ string certificateNo = "";
|
|
|
+ string certificateStartDate = "";
|
|
|
+ string certificateEndDate = "";
|
|
|
+ string businessLicenseNo = "";
|
|
|
+ string businessLicenseStartDate = "";
|
|
|
+ string businessLicenseEndDate = "";
|
|
|
+ string merchantName = "";
|
|
|
+ string mccCode = "";
|
|
|
+ string address = "";
|
|
|
+ string contactPhoneNo = "";
|
|
|
+ string accountName = "";
|
|
|
+ string accountNo = "";
|
|
|
+ string bankName = "";
|
|
|
+ // 构建完整的请求对象
|
|
|
+ var merchantRegisterRequest = new UnionPayMerchantRegisterRequest
|
|
|
+ {
|
|
|
+ affiliateHeadMerchant = false,
|
|
|
+ channelTypes = new List<int> { 1 }, // 默认设置为微信支付渠道
|
|
|
+ userRegistrationInfo = new UserRegistrationInfo
|
|
|
+ {
|
|
|
+ userName = userName,
|
|
|
+ password = password,
|
|
|
+ phone = phone
|
|
|
+ },
|
|
|
+ legalPerson = new LegalPersonInfo
|
|
|
+ {
|
|
|
+ legalPersonName = legalPersonName,
|
|
|
+ certificateType = certificateType,
|
|
|
+ certificateNo = certificateNo,
|
|
|
+ certificateStartDate = certificateStartDate,
|
|
|
+ certificateEndDate = certificateEndDate
|
|
|
+ },
|
|
|
+ businessLicense = new BusinessLicenseInfo
|
|
|
+ {
|
|
|
+ businessLicenseNo = businessLicenseNo,
|
|
|
+ businessLicenseStartDate = businessLicenseStartDate,
|
|
|
+ businessLicenseEndDate = businessLicenseEndDate
|
|
|
+ },
|
|
|
+ merchantInfo = new MerchantInfo
|
|
|
+ {
|
|
|
+ merchantType = 1, // 默认设置为企业商户
|
|
|
+ merchantName = merchantName,
|
|
|
+ mccCode = mccCode,
|
|
|
+ address = address,
|
|
|
+ contactPhoneNo = contactPhoneNo
|
|
|
+ },
|
|
|
+ settleAccountInfo = new SettleAccountInfo
|
|
|
+ {
|
|
|
+ bankCardHolder = accountName,
|
|
|
+ bankCardAccount = accountNo,
|
|
|
+ bankName = bankName,
|
|
|
+ bankCardAccountType = 1, // 默认设置为对公账户
|
|
|
+ settleType = 1 // 默认设置为T+1结算
|
|
|
+ },
|
|
|
+ // 其他必填字段设置默认值
|
|
|
+ shopInfo = new ShopInfo(),
|
|
|
+ extraInfoDto = new ExtraInfoDto()
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|