/// <summary> /// 添加网关 /// </summary> /// <param name="gateway">网关</param> /// <returns></returns> public bool Add(GatewayBase gateway) { if (gateway != null) { if (!Exist(gateway.Merchant.AppId)) { _list.Add(gateway); return(true); } else { throw new GatewayException("该商户数据已存在"); } } return(false); }
/// <summary> /// 接收并验证网关的支付通知 /// </summary> public void Received() { GatewayBase gateway = NotifyProcess.GetGateway(); if (gateway.GatewayType != GatewayType.None) { gateway.Merchant = GetMerchant(gateway.GatewayType); if (gateway.ValidateNotify()) { OnPaymentSucceed(new PaymentSucceedEventArgs(gateway)); gateway.WriteSucceedFlag(); } else { OnPaymentFailed(new PaymentFailedEventArgs(gateway)); } } else { OnUnknownGateway(new UnknownGatewayEventArgs(gateway)); } }
public PaymentSetting(GatewayType gatewayType) { gateway = CreateGateway(gatewayType); }
/// <summary> /// 初始化支付事件数据的基类 /// </summary> /// <param name="gateway">支付网关</param> public PaymentEventArgs(GatewayBase gateway) { this._gateway = gateway; _notifyServerHostAddress = System.Web.HttpContext.Current.Request.UserHostAddress; }
public PaymentSetting(GatewayBase gateway) { this.gateway = gateway; }
/// <summary> /// ��ʼ��֧���¼����ݵĻ��� /// </summary> /// <param name="gateway">֧������</param> public PaymentEventArgs(GatewayBase gateway) { this.gateway = gateway; notifyServerHostAddress = System.Web.HttpContext.Current.Request.UserHostAddress; }