public void ProcessRequest(HttpContext context) { string id = context.Request["id"]; string websiteOwner = context.Request["websiteOwner"]; if (string.IsNullOrWhiteSpace(websiteOwner)) { websiteOwner = bllApp.WebsiteOwner; } BLLJIMP.Model.AppManage app = new BLLJIMP.Model.AppManage(); if (id == "0") { app = bllApp.GetByKey <BLLJIMP.Model.AppManage>("WebsiteOwner", websiteOwner); } else { app = bllApp.GetByKey <BLLJIMP.Model.AppManage>("AutoID", id, websiteOwner: websiteOwner); } if (app == null) { app = new BLLJIMP.Model.AppManage(); } apiResp.status = true; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsSuccess; apiResp.result = app; apiResp.msg = "查询完成"; bllApp.ContextResponse(context, apiResp); }
public void ProcessRequest(HttpContext context) { BLLJIMP.Model.AppManage app = bllApp.ConvertRequestToModel <BLLJIMP.Model.AppManage>(new BLLJIMP.Model.AppManage()); if (string.IsNullOrWhiteSpace(app.WebsiteOwner)) { app.WebsiteOwner = bllApp.WebsiteOwner; } if (string.IsNullOrWhiteSpace(app.AppId)) { apiResp.code = (int)APIErrCode.IsSuccess; apiResp.msg = "请输入应用Id"; bllApp.ContextResponse(context, apiResp); return; } if (string.IsNullOrWhiteSpace(app.AppName)) { apiResp.code = (int)APIErrCode.IsSuccess; apiResp.msg = "请输入应用名称"; bllApp.ContextResponse(context, apiResp); return; } BLLJIMP.Model.AppManage oApp = new BLLJIMP.Model.AppManage(); if (app.AutoID == 0) { oApp = bllApp.GetApp(app.WebsiteOwner, app.AppId); } else { oApp = bllApp.GetByKey <BLLJIMP.Model.AppManage>("AutoID", app.AutoID.ToString(), websiteOwner: app.WebsiteOwner); } if (oApp == null) { apiResp.status = bllApp.Add(app); } else { oApp.AppName = app.AppName; oApp.AppInfo = app.AppInfo; oApp.AppId = app.AppId; oApp.StartAdHref = app.StartAdHref; //oApp.IosAppId = app.IosAppId; //oApp.IosAppPrivate = app.IosAppPrivate; //oApp.IosAppPrivateFile = app.IosAppPrivateFile; //oApp.IosAppProfile = app.IosAppProfile; //oApp.AndroidAppId = app.AndroidAppId; //oApp.AndroidAppPrivate = app.AndroidAppPrivate; //oApp.AndroidAppCertificateName = app.AndroidAppCertificateName; //oApp.AndroidAppCertificateFile = app.AndroidAppCertificateFile; apiResp.status = bllApp.Update(oApp); } apiResp.code = apiResp.status ? (int)BLLJIMP.Enums.APIErrCode.IsSuccess : (int)BLLJIMP.Enums.APIErrCode.OperateFail; apiResp.msg = apiResp.status ? "提交完成" : "提交失败"; bllApp.ContextResponse(context, apiResp); }
/// <summary> /// 支付宝App支付 /// </summary> /// <param name="context"></param> /// <returns></returns> private string BuildAlipayAppRequest(HttpContext context) { string orderId = context.Request["order_id"]; string appId = context.Request["app_id"]; string websiteOwner = bllPay.WebsiteOwner; if (string.IsNullOrEmpty(orderId)) { resp.errcode = 1; resp.errmsg = "order_id 必传"; return(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); } var orderInfo = bllMall.GetOrderInfo(orderId); if (orderInfo == null) { resp.errcode = 1; resp.errmsg = "订单号不存在"; return(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); } if (orderInfo.OrderUserID != currentUserInfo.UserID) { resp.errcode = 1; resp.errmsg = "订单号无效"; return(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); } if (orderInfo.PaymentStatus == 1) { resp.errcode = 1; resp.errmsg = "订单已经支付,不需重复支付"; return(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); } BLLJIMP.Model.AppManage app = bllApp.GetApp(websiteOwner, appId); if (!bllApp.IsAppAlipay(app)) { resp.errcode = 1; resp.errmsg = "未配置App支付宝支付"; return(ZentCloud.Common.JSONHelper.ObjectToJson(resp)); } //更改支付方式 //bllMall.Update(orderInfo, " PaymentType=1 ", string.Format(" (OrderID = '{0}' Or ParentOrderId='{0}') ", orderInfo.OrderID)); string notifyUrl = baseUrl + "/Alipay/MallAppNotifyUrlV2.aspx"; var payForm = bllPay.GetAliPayRequestApp(orderInfo.OrderID, (double)orderInfo.TotalAmount, app.AlipayAppId, app.AlipayPrivatekey, app.AlipayPublickey, app.AlipaySignType, notifyUrl); return(ZentCloud.Common.JSONHelper.ObjectToJson(new { errcode = 0, pay_req = payForm })); }
public void ProcessRequest(HttpContext context) { BLLJIMP.Model.AppManage app = bllApp.ConvertRequestToModel <BLLJIMP.Model.AppManage>(new BLLJIMP.Model.AppManage()); BLLJIMP.Model.AppManage oApp = bllApp.GetByKey <BLLJIMP.Model.AppManage>("AutoID", app.AutoID.ToString(), websiteOwner: app.WebsiteOwner); oApp.AlipayAppId = app.AlipayAppId; oApp.AlipayPrivatekey = app.AlipayPrivatekey; oApp.AlipayPublickey = app.AlipayPublickey; oApp.AlipaySignType = app.AlipaySignType; oApp.WxAppId = app.WxAppId; oApp.WxAppSecret = app.WxAppSecret; apiResp.status = bllApp.Update(oApp); apiResp.code = apiResp.status ? (int)BLLJIMP.Enums.APIErrCode.IsSuccess : (int)BLLJIMP.Enums.APIErrCode.OperateFail; apiResp.msg = apiResp.status ? "提交完成" : "提交失败"; bllApp.ContextResponse(context, apiResp); }
public void ProcessRequest(HttpContext context) { string appid = context.Request["appid"]; string websiteOwner = bllApp.WebsiteOwner; BLLJIMP.Model.AppManage app = bllApp.GetApp(websiteOwner, appid); apiResp.status = (app != null); apiResp.code = apiResp.status ? (int)APIErrCode.IsSuccess : (int)APIErrCode.OperateFail; apiResp.result = !apiResp.status ? null : new { has_alipay_app_set = bllApp.IsAppAlipay(app), has_weixin_app_set = bllApp.IsAppWeixin(app), start_ad_href = app.StartAdHref }; apiResp.msg = "查询完成"; bllApp.ContextResponse(context, apiResp); }