/// <summary> /// 预下单请求 /// </summary> /// <returns></returns> public static PrecreateResponseModel Prepay(PrecreateModel precreateModel) { AlipayTradePrecreateRequest payRequst = new AlipayTradePrecreateRequest(); if (precreateModel.extend_params == null) { precreateModel.extend_params = new ExtendParams(); } precreateModel.extend_params.sys_service_provider_id = Config.providerid; payRequst.BizContent = JsonConvert.SerializeObject(precreateModel); LogUtil.WriteAlipayLog("预下单请求", "请求参数", payRequst.BizContent); //需要异步通知的时候,需要是指接收异步通知的地址。 payRequst.SetNotifyUrl("http://10.5.21.14/notify_url.aspx"); Dictionary <string, string> paramsDict = (Dictionary <string, string>)payRequst.GetParameters(); AlipayTradePrecreateResponse payResponse = _client.Execute(payRequst); LogUtil.WriteAlipayLog("预下单响应", "响应原始参数", payResponse.Body); return(new PrecreateResponseModel { code = payResponse.Code, msg = payResponse.Msg, subcode = payResponse.SubCode, submsg = payResponse.SubMsg, out_trade_no = payResponse.OutTradeNo, qr_code = payResponse.QrCode }); }
public void Precreate() { using (SelfServiceEquipment _equipment = new SelfServiceEquipment()) { string _trade_no = Guid.NewGuid().ToString().Replace("-", ""); PrecreateModel precreateModel = new PrecreateModel() { out_trade_no = _trade_no, timeout_express = "5m", total_amount = "0.01", store_id = "TEST_001", subject = "支付测试", undiscountable_amount = "0.01", terminal_id = "t_0001", operator_id = "top_0001", body = "支付测试", goods_detail = new List <GoodsDetailModel> { new GoodsDetailModel() { alipay_goods_id = "001", body = "汽车票", quantity = "1", price = "0.01", goods_id = "1", goods_name = "天津-北京", goods_category = "" } } }; PrecreateResponseModel responseModel = _equipment.PreCreate(precreateModel); } }
/// <summary> /// 支付宝预下单请求 /// </summary> /// <param name="precreateModel">求情数据</param> /// <returns></returns> public PrecreateResponseModel PreCreate(PrecreateModel precreateModel) { PrecreateResponseModel response = ServiceUtil.AliPayClient.PreCreate(precreateModel); ServiceUtil.AliPayClient.Close(); return(response); }
public PrecreateResponseModel PreCreate(PrecreateModel precreateModel) { return(F2FPayUtil.Prepay(precreateModel)); }
public PrecreateResponseModel PreCreate(PrecreateModel precreateModel) { return(Channel.PreCreate(precreateModel)); }