/// <summary> /// 初始化支付宝参数生成器 /// </summary> /// <param name="config">配置</param> /// <param name="param">参数</param> public AlipayParameterBuilder(AlipayConfig config, PayParamBase param = null) { config.CheckNull(nameof(config)); Config = config; _builder = new UrlParameterBuilder(); Content = new AlipayContentBuilder(); Init(param); }
/// <summary> /// 初始化 /// </summary> private void Init(PayParamBase param) { Format("json").Charset(Config.Charset).SignType("RSA2").Timestamp().Version("1.0").AppId(Config.AppId); if (param == null) { return; } param.Init(); Content.Init(param); ReturnUrl(param.ReturnUrl).NotifyUrl(param.NotifyUrl); }
/// <summary> /// 初始化支付参数 /// </summary> /// <param name="param">支付参数</param> public AlipayContentBuilder Init(PayParamBase param) { if (param == null) { return(this); } return(OutTradeNo(param.OrderId) .Subject(param.Subject) .TotalAmount(param.Money) .TimeoutExpress(param.Timeout)); }