Ejemplo n.º 1
0
        public void GetPaymentUrl(string password1, int paymentId, decimal price, string description, string expectedUrl)
        {
            var securityParams = new RobokassaSecurityParams(LOGIN, password1, PASSWORD2);
            var robokassaApi   = new RobokassaApi(securityParams);

            string url = robokassaApi.GetPaymentUrl(paymentId, price, description);

            Assert.That(url, Is.EqualTo(expectedUrl));
        }
Ejemplo n.º 2
0
        public void RobokassaSecurityParams()
        {
            RobokassaSecurityParams securityParams = WebSettingsConfig.Instance.RobokassaSecurityParams;

            Assert.That(securityParams, Is.Not.Null);
            Assert.That(securityParams.Login, Is.EqualTo("login.to.robokassa"));
            Assert.That(securityParams.Password1, Is.EqualTo("PassW0rd1"));
            Assert.That(securityParams.Password2, Is.EqualTo("Pa$$W0rd2"));
        }
Ejemplo n.º 3
0
        public void ProcessResultNull(string password2, string paymentId, string price, string crc)
        {
            var securityParams       = new RobokassaSecurityParams(LOGIN, PASSWORD1, password2);
            var robokassaApi         = new RobokassaApi(securityParams);
            NameValueCollection pars = CreateNameValueCollection(paymentId, price, crc);

            RobokassaPaymentResult robokassaPaymentResult = robokassaApi.ProcessResult(pars);

            Assert.That(robokassaPaymentResult, Is.Null);
        }
Ejemplo n.º 4
0
        public void ProcessFail(string paymentId,
                                string price,
                                int expectedPaymentId,
                                decimal expectedPrice)
        {
            var securityParams       = new RobokassaSecurityParams(LOGIN, PASSWORD1, PASSWORD2);
            var robokassaApi         = new RobokassaApi(securityParams);
            NameValueCollection pars = CreateNameValueCollection(paymentId, price, null);

            RobokassaPaymentResult robokassaPaymentResult = robokassaApi.ProcessFail(pars);

            Assert.That(robokassaPaymentResult, Is.Not.Null);
            Assert.That(robokassaPaymentResult.PaymentId, Is.EqualTo(expectedPaymentId));
            Assert.That(robokassaPaymentResult.Price, Is.EqualTo(expectedPrice));
        }
Ejemplo n.º 5
0
 private void LoadSalesSettings(XElement root)
 {
     //Доступы к платежным системам
     RobokassaSecurityParams =
         new RobokassaSecurityParams(XmlParseHelper.Get <string>(root, "Payment", "Robokassa", "Login"),
                                     XmlParseHelper.Get <string>(root, "Payment", "Robokassa",
                                                                 "Password1"),
                                     XmlParseHelper.Get <string>(root, "Payment", "Robokassa",
                                                                 "Password2"));
     //секции на которых есть продажа материалов
     _salesSections =
         new HashSet <SectionId>(XmlParseHelper.GetList <SectionId>(root, "Payment", "SectionId"));
     _salesSettings = new Dictionary <SectionId, ISalesSettings>();
     foreach (SectionId salesSection in _salesSections)
     {
         AddSalesSettings(root, salesSection);
     }
 }