Exemplo n.º 1
0
        public void ParseIPizzaPaymentResponse_Verify_1111_Response_Parameters()
        {
            IPizzaPaymentResponse paymentResponse = _banklinkApi.ParseIPizzaPaymentResponse(new NameValueCollection
            {
                { "VK_SERVICE", "1111" },
                { "VK_VERSION", "008" },
                { "VK_SND_ID", "GENIPIZZA" },

                { "VK_REC_ID", "uid100010" },
                { "VK_STAMP", "74525" },
                { "VK_T_NO", "10010" },

                { "VK_AMOUNT", "10.15" },
                { "VK_CURR", "EUR" },
                { "VK_REC_ACC", "" },

                { "VK_REC_NAME", "" },
                { "VK_SND_ACC", "EE871600161234567892" },
                { "VK_SND_NAME", "Tõõger Leõpäöld" },

                { "VK_REF", "" },
                { "VK_MSG", "Shut up and take my $$$!" },
                { "VK_T_DATETIME", "2015-04-04T23:17:35+0300" },

                { "VK_ENCODING", "UTF-8" },
                { "VK_LANG", "EST" },
                { "VK_MAC", "U99SSoDkqZXN6zE5ht8ORLKs4xghXwGcTbi5QU97qF/7sg8T2yN/HIBNuIi/ww0oQr0ZcCrseDYGc58QE+UMejNBnc1cH2TYxmWGBPyAoAfUoGyHtgJqdPtXf5oa22OxhDk0hhMCyMEzbLClsYZ3L3nUIc3LI6Lf/JFOLQuRYm20NErOx6oXtn03bfLYBV4iQGFn91HwD3z4w8VDHJmBC+KlVHLTmSCTXzB1KDIXT2iE6eLe/6cUT0laUtU/EB5a03Eds6TM/17iwdk1wIA9m/JCSvsE4VAacwiOdOv4oua0DQhVTMNevVA5Sx/IA0BiENM7m6FnTs++XKOkqboU5Q==" },

                { "VK_AUTO", "N" },
            });

            Assert.That(paymentResponse.BankId, Is.EqualTo("GENIPIZZA"));
            Assert.That(paymentResponse.Amount, Is.EqualTo(10.15M));
            Assert.That(paymentResponse.Currency, Is.EqualTo("EUR"));

            Assert.That(paymentResponse.IsAutomaticResponse, Is.False);
            Assert.That(paymentResponse.IsPaymentSuccessful, Is.True);

            Assert.That(paymentResponse.PaymentMessage, Is.EqualTo("Shut up and take my $$$!"));
            Assert.That(paymentResponse.PaymentOrderNumber, Is.EqualTo("10010"));
            Assert.That(paymentResponse.PaymentOrderReferenceNumber, Is.Empty);

            Assert.That(paymentResponse.PaymentReceiverAccount, Is.Empty);
            Assert.That(paymentResponse.PaymentReceiverName, Is.Empty);
            Assert.That(paymentResponse.PaymentSenderAccount, Is.EqualTo("EE871600161234567892"));

            Assert.That(paymentResponse.PaymentSenderName, Is.EqualTo("Tõõger Leõpäöld"));
            Assert.That(paymentResponse.RequestEncoding, Is.EqualTo("UTF-8"));
            Assert.That(paymentResponse.RequestStartDateTime,
                        Is.EqualTo(DateTime.ParseExact("2015-04-04T23:17:35+0300", "yyyy-MM-ddTHH:mm:sszz00", CultureInfo.InvariantCulture)));

            Assert.That(paymentResponse.Language, Is.EqualTo("EST"));
            Assert.That(paymentResponse.Stamp, Is.EqualTo("74525"));
        }
Exemplo n.º 2
0
        public ActionResult AcceptPayment()
        {
            NameValueCollection   parameters = System.Web.HttpContext.Current.Request.Params;
            IPizzaPaymentResponse result     = _banklinkApi.ParseIPizzaPaymentResponse(parameters);

            TempData["blablabla"] = result;
            return(RedirectToAction("BankResponse"));
        }