public void WechatPay(string payBarCode) { if (string.IsNullOrEmpty(payBarCode)) { return; } try { var payAmount = CurrentOrder.PayAmount; decimal.TryParse(txtPayAmount.Text, out payAmount); CurrentOrder.PayAmount = payAmount; var onlinePayAmount = 0m; decimal.TryParse(txtOnlinePayAmount.Text, out onlinePayAmount); CurrentOrder.OnlinePayAmount = onlinePayAmount; _orderService.WechatPay(CurrentOrder.OrderId, payBarCode, CurrentOrder.PayAmount); PosForm.ClearItems(); ClosePayForm(); MessageBox.Show("支付成功!", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (AppException aex) { MessageBox.Show(aex.Message, "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Warning); } catch (Exception ex) { _log.Error(ex); MessageBox.Show(ex.Message, "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }