Ejemplo n.º 1
0
        public void TestBCEPWrapperVerifyAPPROVEPayment()
        {
            var svc_url    = Environment.GetEnvironmentVariable("BCEP_SERVICE_URL");
            var svc_svcid  = Environment.GetEnvironmentVariable("BCEP_MERCHANT_ID");
            var svc_hashid = Environment.GetEnvironmentVariable("BCEP_HASH_KEY");
            var base_uri   = Environment.GetEnvironmentVariable("BASE_URI");
            var base_path  = Environment.GetEnvironmentVariable("BASE_PATH");
            var conf_url   = Environment.GetEnvironmentVariable("BCEP_CONF_PATH");

            var bcep = new BCEPWrapper(svc_url, svc_svcid, svc_hashid,
                                       base_uri + base_path + conf_url);

            bcep.setHashKeyForUnitTesting("APPROVE");
            var url = bcep.GetVerifyPaymentTransactionUrl(test_order, test_id);

            Assert.IsNotNull(url);
            Assert.AreEqual(actual_url2, url.Substring(0, actual_url2.Length));

            var validation_response = bcep.ProcessPaymentResponse(test_order, test_id).Result;

            Assert.IsNotNull(validation_response);
            Assert.IsTrue(validation_response.ContainsKey("query_url"));
            Assert.IsTrue(validation_response.ContainsKey("trnApproved"));

            Assert.AreEqual("1", validation_response["trnApproved"]);
        }
Ejemplo n.º 2
0
        public void TestGetBCEPWrapperPaymentValidationUrl()
        {
            var svc_url    = Environment.GetEnvironmentVariable("BCEP_SERVICE_URL");
            var svc_svcid  = Environment.GetEnvironmentVariable("BCEP_MERCHANT_ID");
            var svc_hashid = Environment.GetEnvironmentVariable("BCEP_HASH_KEY");
            var base_uri   = Environment.GetEnvironmentVariable("BASE_URI");
            var base_path  = Environment.GetEnvironmentVariable("BASE_PATH");
            var conf_url   = Environment.GetEnvironmentVariable("BCEP_CONF_PATH");

            var bcep = new BCEPWrapper(svc_url, svc_svcid, svc_hashid,
                                       base_uri + base_path + conf_url);
            var url = bcep.GetVerifyPaymentTransactionUrl(test_order, test_id);

            Assert.IsNotNull(url);
            Assert.AreEqual(actual_url2, url.Substring(0, actual_url2.Length));
        }
Ejemplo n.º 3
0
        public void TestGetBCEPWrapperPaymentRedirectUrl()
        {
            var svc_url    = Environment.GetEnvironmentVariable("BCEP_SERVICE_URL");
            var svc_svcid  = Environment.GetEnvironmentVariable("BCEP_MERCHANT_ID");
            var svc_hashid = Environment.GetEnvironmentVariable("BCEP_HASH_KEY");
            var base_uri   = Environment.GetEnvironmentVariable("BASE_URI");
            var base_path  = Environment.GetEnvironmentVariable("BASE_PATH");
            var conf_url   = Environment.GetEnvironmentVariable("BCEP_CONF_PATH");

            var bcep = new BCEPWrapper(svc_url, svc_svcid, svc_hashid,
                                       base_uri + base_path + conf_url);
            var url = bcep.GeneratePaymentRedirectUrl(test_order, test_id, test_amt).Result;

            Assert.IsNotNull(url);
            Assert.AreEqual(actual_url1, url.Substring(0, actual_url1.Length));
        }