Ejemplo n.º 1
0
 public GarantiBankOdeme(GarantiBankasiParameterBuidler param)
 {
     this._param = param;
     this._param.SecurityData          = SerializeProccess.GetSHA1(param.strProvisionPassword + param._strTerminalID).ToUpper();
     this._param.HashData              = SerializeProccess.GetSHA1(param.strTerminalID + param.strOrderID + param.strAmount + param.strSuccessURL + param.strErrorURL + param.strType + param.strInstallmentCount + param.strStoreKey + param.SecurityData).ToUpper();
     this._param.strInstallmentCount   = "";
     this._param.cardnumber            = "4355084355084358";
     this._param.cardexpiredatemonth   = "01";
     this._param.cardexpiredateyear    = "16";
     this._param.cardcvv2              = "123";
     this._param.secure3dsecuritylevel = "3D";
 }
        public GarantiBankasiResponse GarnatiBankOdemeYap(EravsePaymentParameters eravseParameter)
        {
            GarantiBankasiResponse _response = null;

            if (eravseParameter.Bank != PaymentEnums.Banks.DefaultBank)
            {
                if (eravseParameter.Bank == PaymentEnums.Banks.GarantiBank)
                {
                    _response = new GarantiBankasiResponse();
                }


                using (Datasets.GatewayContextDataContext db = new Datasets.GatewayContextDataContext())
                {
                    var User = db.PaymentCustomers.Where(r => r.UserGuid == eravseParameter.CompanyCode && r.Password == eravseParameter.Password);
                    //  if (User.Count() > 0)
                    //{



                    #region + + +  GRANTİ BANKASI + + +

                    if (eravseParameter.Bank == PaymentEnums.Banks.GarantiBank)
                    {
                        GarantiBankasiParameterBuidler _builder = new GarantiBankasiParameterBuidler();
                        _response                        = new GarantiBankasiResponse();
                        _builder.strMode                 = "PROD";
                        _builder.strApiVersion           = "v0.01";
                        _builder.strTerminalProvUserID   = "PROVAUT";
                        _builder.strType                 = "sales";
                        _builder.strAmount               = "100"; //İşlem Tutarı 1.00 TL için 100 gönderilmeli
                        _builder.strCurrencyCode         = "949";
                        _builder.strInstallmentCount     = "";    //Taksit Sayısı. Boş gönderilirse taksit yapılmaz
                        _builder.strTerminalUserID       = "";
                        _builder.strOrderID              = "deneme";
                        _builder.strCustomeripaddress    = ""; // Request.UserHostAddress; //Kullanıcının IP adresini alır
                        _builder.strcustomeremailaddress = "*****@*****.**";
                        _builder.strTerminalID           = ""; //8 Haneli TerminalID yazılmalı.
                        _builder._strTerminalID          = ""; // + strTerminalID;
                        _builder.strTerminalMerchantID   = ""; //Üye İşyeri Numarası
                        _builder.strStoreKey             = ""; //3D Secure şifresi
                        _builder.strProvisionPassword    = ""; //TerminalProvUserID şifresi
                        _builder.strSuccessURL           = "~/Garanti3dResponse.aspx";
                        _builder.strErrorURL             = "~/Garanti3dResponse.aspx";


                        using (GarantiBankOdeme Odeme = new GarantiBankOdeme(_builder))
                        {
                            _response = Odeme.GarantiOdemeYap();
                        }
                    }

                    #endregion

                    else if (eravseParameter.Bank == PaymentEnums.Banks.IsBank)
                    {
                    }



                    // }

                    //else
                    //{

                    //    _response = new EravseResponse
                    //    {
                    //        ResponseCode = PaymentEnums.EravseReturnCode.UserDoesNotExist,
                    //        ResponseMessage = GetEravseResponseMessageFromReturnCode(PaymentEnums.EravseReturnCode.UserDoesNotExist)
                    //    };


                    //}
                }
            }
            else
            {
                _response = new GarantiBankasiResponse
                {
                    Kod     = (int)PaymentEnums.EravseReturnCode.BankKodeNotValid,
                    message = GetEravseResponseMessageFromReturnCode(PaymentEnums.EravseReturnCode.BankKodeNotValid)
                };
            }



            return(_response);
        }