/// <summary> /// 请添加支付成功后的处理 /// </summary> private void DoSuccessProcess(AlipayF2FPayResult payResult) { //请添加支付成功后的处理 //System.Console.WriteLine("支付成功"); //result = payResult.response.Body; MessageBox.Show("支付成功!"); PayInfo obj = new PayInfo(); obj.Id = Guid.NewGuid().ToString(); obj.CreateTime = DateTime.Now; obj.UpdateTime = DateTime.Now; obj.PayAmount = WIDtotal_fee.Text.Trim(); obj.orderId = this.OrderNumber; obj.salesmanId = LoginUserInfo.id; obj.payDate = DateTime.Now; obj.PayMode = BranchPay.ZFBPay; //obj.MemberId = memberCardId; obj.BranchId = LoginUserInfo.branchId; //BranchPayInfoService service = new BranchPayInfoService(); //service.AddPayInfo(obj); ////上传支付信息 //PayInfoService masterPayInfoService = new PayInfoService(); //masterPayInfoService.AddPayInfo(obj); this.payForm.AddPayInfo(obj); payForm.AddPaidAmount(obj.PayAmount); this.Close(); }
/// <summary> /// 确定支付 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { if (textBox4.Text.Equals("")) { textBox4.Text = "0"; } if (textBox4.Text.StartsWith(".")) { textBox4.Text = "0" + textBox4.Text; } if (textBox4.Text.EndsWith(".")) { textBox4.Text = textBox4.Text + "0"; } PayInfo obj = new PayInfo(); obj.Id = Guid.NewGuid().ToString(); obj.CreateTime = DateTime.Now; obj.UpdateTime = DateTime.Now; obj.PayAmount = textBox4.Text; obj.orderId = orderId; obj.salesmanId = LoginUserInfo.id; obj.payDate = DateTime.Now; obj.PayMode = BranchPay.card; obj.MemberId = memberCardId; obj.BranchId = LoginUserInfo.branchId; //BranchPayInfoService service = new BranchPayInfoService(); //service.AddPayInfo(obj); ////上传支付信息 //PayInfoService masterPayInfoService = new PayInfoService(); //masterPayInfoService.AddPayInfo(obj); this.payForm.AddPayInfo(obj); payForm.AddPaidAmount(textBox4.Text); clFlag = true; this.Close(); }
private void WxPay() { string amount = actualTextbox.Text.Trim(); if (string.IsNullOrEmpty(amount)) { return; } else if (float.Parse(amount) == 0) { return; } else { amount = float.Parse(amount).ToString("0.00").Replace(".", ""); } ///商品描述, 总金额 , 二维码, 订单号 WxPayData result = MicroPay.Run(GoodsDetails, amount, codeTextbox.Text.Trim(), this.OrderNumber + "4"); if ("SUCCESS".Equals(result.GetValue("result_code")) && "SUCCESS".Equals(result.GetValue("return_code"))) { MessageBox.Show("微信支付成功!"); PayInfo obj = new PayInfo(); obj.Id = Guid.NewGuid().ToString(); obj.CreateTime = DateTime.Now; obj.UpdateTime = DateTime.Now; obj.PayAmount = actualTextbox.Text.Trim(); obj.orderId = this.OrderNumber; obj.salesmanId = LoginUserInfo.id; obj.payDate = DateTime.Now; obj.PayMode = BranchPay.WxPay; //obj.MemberId = memberCardId; obj.BranchId = LoginUserInfo.branchId; //BranchPayInfoService service = new BranchPayInfoService(); //service.AddPayInfo(obj); ////上传支付信息 //PayInfoService masterPayInfoService = new PayInfoService(); //masterPayInfoService.AddPayInfo(obj); this.payForm.AddPayInfo(obj); payForm.AddPaidAmount(obj.PayAmount); clFlag = true; this.Close(); } else if ("SUCCESS".Equals(result.GetValue("return_code"))) { if (result.IsSet("err_code_des")) { MessageBox.Show(result.GetValue("err_code_des").ToString()); return; } else { MessageBox.Show("微信支付发生未知错误!"); return; } } else { MessageBox.Show("微信支付通信失败,请检查网络!"); return; } }