示例#1
0
        public void CreateIPizzaPaymentRequest_Verify_1011_Request_Parameters()
        {
            BankRequest bankRequest = _banklinkApi.CreateIPizzaPaymentRequest(new IPizzaPaymentRequestParams
            {
                ErrorReturnUrl         = "http://localhost:8080/project/6rGPnXJ7cvstStKx?payment_action=cancel",
                Amount                 = 150M,
                PaymentMessage         = "Torso Tiger",
                SuccessReturnUrl       = "http://localhost:8080/project/6rGPnXJ7cvstStKx?payment_action=success",
                RecipientAccountNumber = "EE871600161234567892",
                RecipientName          = "ÕIE MÄGER",
                Stamp    = "12345",
                Currency = "EUR",
                PaymentReferenceNumber = "1234561",
                Language             = "EST",
                RequestStartDateTime = DateTime.ParseExact("2015-04-04T22:58:16+0300", "yyyy-MM-ddTHH:mm:sszz00", CultureInfo.InvariantCulture),
                RequestEncoding      = "UTF-8",
                BankId = "GENIPIZZA"
            });

            Assert.That(bankRequest.RequestUrl, Is.EqualTo("http://localhost:8080/banklink/ipizzapayment"));

            bankRequest.AssertFieldValueEqualTo("VK_SERVICE", "1011");
            bankRequest.AssertFieldValueEqualTo("VK_VERSION", "008");
            bankRequest.AssertFieldValueEqualTo("VK_SND_ID", "uid100010");
            bankRequest.AssertFieldValueEqualTo("VK_STAMP", "12345");
            bankRequest.AssertFieldValueEqualTo("VK_AMOUNT", "150");
            bankRequest.AssertFieldValueEqualTo("VK_CURR", "EUR");
            bankRequest.AssertFieldValueEqualTo("VK_ACC", "EE871600161234567892");
            bankRequest.AssertFieldValueEqualTo("VK_NAME", "ÕIE MÄGER");
            bankRequest.AssertFieldValueEqualTo("VK_REF", "1234561");
            bankRequest.AssertFieldValueEqualTo("VK_MSG", "Torso Tiger");
            bankRequest.AssertFieldValueEqualTo("VK_RETURN", "http://localhost:8080/project/6rGPnXJ7cvstStKx?payment_action=success");
            bankRequest.AssertFieldValueEqualTo("VK_CANCEL", "http://localhost:8080/project/6rGPnXJ7cvstStKx?payment_action=cancel");
            bankRequest.AssertFieldValueEqualTo("VK_DATETIME", "2015-04-04T22:58:16+0300");
            bankRequest.AssertFieldValueEqualTo("VK_MAC", "N2aCtj20ynyMqirBV77bd/8JpG7yCH6G1W44yKFI7fHdnzgd0zUXZgkhNKOuZB+se0lmj5m+rzzvpkhuPjig3MI0gTE7SLcUAerck8QKr02dd+EQv14OKrw3wZSuuwPUZcH/PvySctKT3kOSO6FFI8ymdww7/CC1xdSAWAOes2wbv68Dtwhy4qQ1pc+jSqFNmNjwgK56BP1D2JBhikATUJxM4b0/GUA0utqkekekqrinElaQRQ8ddN8Jij7t+KPQme1w5xGU48DR4mI+A6nHKAVm+UinbEkRIuoc0sWba9vBvNBSdIAMYv1a3BVpg956Kx0uo1ZTc7veDDi7tFCb9w==");
            bankRequest.AssertFieldValueEqualTo("VK_ENCODING", "UTF-8");
            bankRequest.AssertFieldValueEqualTo("VK_LANG", "EST");
        }
示例#2
0
        public ActionResult BankPayment(string bankId)
        {
            BankRequest request = _banklinkApi.CreateIPizzaPaymentRequest(new IPizzaPaymentRequestParams
            {
                Amount           = 10.15M,
                BankId           = bankId,
                Stamp            = new Random((int)DateTime.Now.Ticks).Next(1234567).ToString(),
                ErrorReturnUrl   = Url.Action("AcceptPayment", "Home", new { }, this.Request.Url.Scheme),
                SuccessReturnUrl = Url.Action("AcceptPayment", "Home", new{}, this.Request.Url.Scheme),
                PaymentMessage   = "Shut up and take my $$$!",
            });

            return(View("BankRequest", request));
        }