예제 #1
0
        /// <summary>
        /// 获取内容参数生成器
        /// </summary>
        /// <param name="param">支付参数</param>
        protected virtual AlipayContentBuilder GetContentBuilder(PayParam param)
        {
            var builder = new AlipayContentBuilder();

            builder.Load(param);
            return(builder);
        }
예제 #2
0
        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&timestamp=2000-10-10 10:10:10&version=1.0", _builder.ToString());
        }
예제 #3
0
 /// <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);
 }
예제 #4
0
 /// <summary>
 /// 初始化内容生成器
 /// </summary>
 /// <param name="builder">内容参数生成器</param>
 /// <param name="param">支付参数</param>
 protected override void InitContentBuilder(AlipayContentBuilder builder, PayParam param)
 {
     builder.AuthCode(param.AuthCode);
 }
예제 #5
0
 /// <summary>
 /// 初始化内容生成器
 /// </summary>
 /// <param name="builder">内容参数生成器</param>
 /// <param name="param">支付参数</param>
 protected virtual void InitContentBuilder(AlipayContentBuilder builder, PayParam param)
 {
 }
예제 #6
0
 /// <summary>
 /// 测试初始化
 /// </summary>
 public AlipayContentBuilderTest()
 {
     _builder = new AlipayContentBuilder();
 }
예제 #7
0
 /// <summary>
 /// 初始化内容生成器
 /// </summary>
 /// <param name="builder">内容参数生成器</param>
 /// <param name="param">支付参数</param>
 protected abstract void InitContentBuilder(AlipayContentBuilder builder, TPayParam param);
예제 #8
0
 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);
 }
예제 #9
0
 /// <summary>
 /// 初始化内容生成器
 /// </summary>
 /// <param name="builder">内容参数生成器</param>
 /// <param name="param">支付参数</param>
 protected override void InitContentBuilder(AlipayContentBuilder builder, PayParam param)
 {
     builder.ProductCode("QUICK_WAP_WAY");
 }
예제 #10
0
 /// <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);
 }
예제 #11
0
 protected override void InitContentBuilder(AlipayContentBuilder builder, AlipayWapPayRequest param)
 {
 }
예제 #12
0
 /// <summary>
 /// 初始化内容生成器
 /// </summary>
 /// <param name="builder">内容参数生成器</param>
 /// <param name="param">支付参数</param>
 protected override void InitContentBuilder(AlipayContentBuilder builder, PayParam param)
 {
     builder.ProductCode("FAST_INSTANT_TRADE_PAY");
 }
예제 #13
0
 /// <summary>
 /// 初始化内容生成器
 /// </summary>
 /// <param name="builder">内容参数生成器</param>
 /// <param name="param">请求参数</param>
 protected virtual void InitContentBuilder(AlipayContentBuilder builder, TRequest param)
 {
 }
예제 #14
0
 /// <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());
 }