֧�����صij������
コード例 #1
0
ファイル: Gateways.cs プロジェクト: orientswift/icanpay.donet
        /// <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);
        }
コード例 #2
0
ファイル: PaymentNotify.cs プロジェクト: zhhqiang9198/ICanPay
        /// <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));
            }
        }
コード例 #3
0
 public PaymentSetting(GatewayType gatewayType)
 {
     gateway = CreateGateway(gatewayType);
 }
コード例 #4
0
 /// <summary>
 /// 初始化支付事件数据的基类
 /// </summary>
 /// <param name="gateway">支付网关</param>
 public PaymentEventArgs(GatewayBase gateway)
 {
     this._gateway            = gateway;
     _notifyServerHostAddress = System.Web.HttpContext.Current.Request.UserHostAddress;
 }
コード例 #5
0
 public PaymentSetting(GatewayBase gateway)
 {
     this.gateway = gateway;
 }
コード例 #6
0
ファイル: PaymentSetting.cs プロジェクト: hiihellox10/ICanPay
 public PaymentSetting(GatewayType gatewayType)
 {
     gateway = CreateGateway(gatewayType);
 }
コード例 #7
0
 /// <summary>
 /// ��ʼ��֧���¼����ݵĻ���
 /// </summary>
 /// <param name="gateway">֧������</param>
 public PaymentEventArgs(GatewayBase gateway)
 {
     this.gateway = gateway;
     notifyServerHostAddress = System.Web.HttpContext.Current.Request.UserHostAddress;
 }