using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace POSV
{
public class WxPayV3ShortUrlRequestData : AbstractRequestData
{
///
/// 公众账号ID
///
public string AppId { get; set; }
///
/// 商户号
///
public string MchId { get; set; }
///
/// 随机字符串
///
public string NonceStr { get; set; }
///
/// 需要转换的URL,签名用原串,传输需URLencode
///
public string LongUrl { get; set; }
///
/// 签名类型
///
public string SignType { get; set; }
///
///
///
public string Key { get; set; }
public readonly string Sign;
///
/// 转换短链接 请求参数
///
///
///
///
///
///
///
public WxPayV3ShortUrlRequestData(string appId , string mchId , string nonceStr ,
string longUrl , string key , string signType = "MD5")
{
AppId = appId;
MchId = mchId;
NonceStr = nonceStr;
SignType = signType;
LongUrl = longUrl;
Key = key;
#region 设置Request请求参数
//设置package订单参数
NewParameters.Add("appid" , this.AppId); //公众账号ID
NewParameters.Add("mch_id" , this.MchId); //商户号
NewParameters.Add("long_url" , this.LongUrl); //需要转换的URL
NewParameters.Add("nonce_str" , this.NonceStr); //随机字符串
NewParameters.Add("sign_type" , this.SignType); //签名类型
Sign = CreateMd5Sign("key" , this.Key);
NewParameters.Add("sign" , Sign); //签名
#endregion
}
}
}