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); }
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); }
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); }