示例#1
0
        protected override void InitParams()
        {
            PayParams.Clear();

            PayParams
            .SafeAdd("mch_id", m_Merchant.Id)
            .SafeAdd("nonce_str", GenerateNonceString());

            var sign = PayParams.ToSortDict().WechatSign(m_Merchant.ApiSecret);

            PayParams.SafeAdd("sign", sign);
        }
示例#2
0
        public override async Task <T> PostAsync()
        {
            InitParams();

            var xmlData   = PayParams.ToSortDict().ToXml();
            var xmlResult = await Util.PostAsync(PostUrl, xmlData);

            var resultDict = xmlResult.ToSortDict();

            var response = ParseResult(resultDict);

            return(response);
        }
示例#3
0
        protected virtual void InitParams()
        {
            PayParams.Clear();

            PayParams
            .SafeAdd("appid", m_Merchant.AppId)
            .SafeAdd("mch_id", m_Merchant.Id)
            .SafeAdd("nonce_str", GenerateNonceString());

            AddBizParams();

            var sign = PayParams.ToSortDict().WechatSign(m_Merchant.SignKey);

            PayParams.SafeAdd("sign", sign);
        }