/// <summary> /// 获取内容参数生成器 /// </summary> /// <param name="param">支付参数</param> protected virtual AlipayContentBuilder GetContentBuilder(PayParam param) { var builder = new AlipayContentBuilder(); builder.Load(param); return(builder); }
public void TestContent() { var contentBuilder = new AlipayContentBuilder(); contentBuilder.OutTradeNo("a"); _builder.Content(contentBuilder); Assert.Equal("biz_content={\"out_trade_no\":\"a\"}&charset=utf-8&format=json&sign_type=RSA2×tamp=2000-10-10 10:10:10&version=1.0", _builder.ToString()); }
/// <summary> /// 初始化内容生成器 /// </summary> /// <param name="builder">内容参数生成器</param> /// <param name="param">支付参数</param> protected override void InitContentBuilder(AlipayContentBuilder builder, AlipayBarcodePayRequest param) { builder.OutTradeNo(param.OrderId).TotalAmount(param.Money).Subject(param.Subject) .Body(param.Body).TimeoutExpress(param.Timeout).NotifyUrl(param.NotifyUrl).AuthCode(param.AuthCode); }
/// <summary> /// 初始化内容生成器 /// </summary> /// <param name="builder">内容参数生成器</param> /// <param name="param">支付参数</param> protected override void InitContentBuilder(AlipayContentBuilder builder, PayParam param) { builder.AuthCode(param.AuthCode); }
/// <summary> /// 初始化内容生成器 /// </summary> /// <param name="builder">内容参数生成器</param> /// <param name="param">支付参数</param> protected virtual void InitContentBuilder(AlipayContentBuilder builder, PayParam param) { }
/// <summary> /// 测试初始化 /// </summary> public AlipayContentBuilderTest() { _builder = new AlipayContentBuilder(); }
/// <summary> /// 初始化内容生成器 /// </summary> /// <param name="builder">内容参数生成器</param> /// <param name="param">支付参数</param> protected abstract void InitContentBuilder(AlipayContentBuilder builder, TPayParam param);
protected override void InitContentBuilder(AlipayContentBuilder builder, AlipayPagePayRequest param) { builder.OutTradeNo(param.OrderId).TotalAmount(param.Money).Subject(param.Subject) .Body(param.Body).PassbackParams(param.Attach).TimeoutExpress(param.Timeout) .ReturnUrl(param.ReturnUrl).NotifyUrl(param.NotifyUrl); }
/// <summary> /// 初始化内容生成器 /// </summary> /// <param name="builder">内容参数生成器</param> /// <param name="param">支付参数</param> protected override void InitContentBuilder(AlipayContentBuilder builder, PayParam param) { builder.ProductCode("QUICK_WAP_WAY"); }
/// <summary> /// 初始化内容生成器 /// </summary> /// <param name="builder">内容参数生成器</param> /// <param name="param">请求参数</param> protected override void InitContentBuilder(AlipayContentBuilder builder, AlipayCancelRequest param) { builder.OutTradeNo(param.OrderId).TradeNo(param.TradeId); }
protected override void InitContentBuilder(AlipayContentBuilder builder, AlipayWapPayRequest param) { }
/// <summary> /// 初始化内容生成器 /// </summary> /// <param name="builder">内容参数生成器</param> /// <param name="param">支付参数</param> protected override void InitContentBuilder(AlipayContentBuilder builder, PayParam param) { builder.ProductCode("FAST_INSTANT_TRADE_PAY"); }
/// <summary> /// 初始化内容生成器 /// </summary> /// <param name="builder">内容参数生成器</param> /// <param name="param">请求参数</param> protected virtual void InitContentBuilder(AlipayContentBuilder builder, TRequest param) { }
/// <summary> /// 初始化内容生成器 /// </summary> /// <param name="builder">内容参数生成器</param> /// <param name="param">请求参数</param> protected override void InitContentBuilder(AlipayContentBuilder builder, AlipayDownloadBillRequest param) { builder.Add("bill_type", param.BillType.Description()); builder.Add("bill_date", param.GetBillDate()); }