Example #1
0
        public IActionResult PaymentGatewayCallback(SSLCommerzValidatorResponse response)
        {
            if (!string.IsNullOrEmpty(response.status) && response.status == "VALID")
            {
                var        userId = _userManager.GetUserId(User);
                SSLCommerz sslcz  = new SSLCommerz(storeID, storePassword, true);

                if (sslcz.OrderValidate(response.tran_id, response.amount, response.currency, Request))
                {
                    return(View("Success"));
                }
            }

            if (!string.IsNullOrEmpty(response.status) && response.status == "FAILED")
            {
                return(View("Fail"));
            }

            if (!string.IsNullOrEmpty(response.status) && response.status == "CANCELLED")
            {
                return(View("Cancel"));
            }

            return(View("Error"));
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(Request.Form["status"]) && Request.Form["status"] == "VALID")
        {
            string TrxID = Request.Form["tran_id"];
            // AMOUNT and Currency FROM DB FOR THIS TRANSACTION
            string amount   = "15";
            string currency = "BDT";

            SSLCommerz sslcz = new SSLCommerz("testbox", "qwerty", true);
            Response.Write("Validation Response: " + sslcz.OrderValidate(TrxID, amount, currency, Request));
        }
        else
        {
            Response.Write("not found");
        }
    }
Example #3
0
        public IActionResult PaymentGatewayCallback(SSLCommerzValidatorResponse response)
        {
            if (!string.IsNullOrEmpty(response.status) && response.status == "VALID")
            {
                SSLCommerz sslcz = new SSLCommerz(storeID, storePassword, true);

                if (sslcz.OrderValidate(response.tran_id, totalAmount, "BDT", Request))
                {
                    return(View("Success", GetProperties(response)));
                }
            }

            if (!string.IsNullOrEmpty(response.status) && response.status == "FAILED")
            {
                return(View("Fail", GetProperties(response)));
            }

            if (!string.IsNullOrEmpty(response.status) && response.status == "CANCELLED")
            {
                return(View("Cancel", GetProperties(response)));
            }

            return(View("Error", GetProperties(response)));
        }