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)); }
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")); }
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); }
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)); }
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); } }