コード例 #1
0
        private MessageClass UpdateFalseTransLog(string raveTransValue)
        {
            var          bc               = new MessageClass();
            const string failmsg          = "Declined";
            const string failcode         = "-1";
            var          raveTransId      = raveTransValue;
            var          commandToExecute = new SqlCommand("Barsh.UpdateFalse_LogTransaction")
            {
                CommandType = CommandType.StoredProcedure
            };

            commandToExecute.Parameters.AddWithValue("@TransRefNo", raveTransId);
            commandToExecute.Parameters.AddWithValue("@TransStatusMsg", failmsg);
            commandToExecute.Parameters.AddWithValue("@TransStatusCode", failcode);
            var recCount = DataBaseHandler.ExecuteSqlCommand(commandToExecute);

            bc.StatusId = recCount > 0 ? 1 : 0;
            if (recCount > 0)
            {
                bc.StatusId = 1;
                SendFailTransDetailsEmail(raveTransId);
            }
            else
            {
                bc.StatusMessage = "Unable to update declined payment";
                bc.StatusId      = -1;
            }
            return(bc);
        }
コード例 #2
0
        private MessageClass LogPayaNewPayInfor()
        {
            var bc = new MessageClass();

            if (!string.IsNullOrEmpty(Convert.ToString(Session["InstitutionCode"])))
            {
                var xpresspaytransId = HashPasswordHelper.GetUniqueKey(6);
                var newTransRefNo    = "PAYREF" + xpresspaytransId;
                Session["newTransRefNo"] = newTransRefNo;

                var instutud         = Convert.ToString(Session["InstitutionCode"]);
                var commandToExecute = new SqlCommand("Barsh.LogTransaction_InsertOrUpdate")
                {
                    CommandType = CommandType.StoredProcedure
                };
                commandToExecute.Parameters.AddWithValue("@TransRefNo", newTransRefNo);
                commandToExecute.Parameters.AddWithValue("@Surname", Session["dbSurname"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@OtherNames", Session["dbOtherNames"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@Address", Session["dbAddress"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@Email", Session["dbEmail"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@PhoneNo", Session["dbPhoneNo"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@RevenueName", Session["dbRevenueName"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@RevenueCode", Session["dbRevenueCode"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@AgencyName", Session["dbAgencyName"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@AgencyCode", Session["dbAgencyCode"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@AmountPaid", Convert.ToDecimal(Session["transDbAmount"].ObjectToString()));
                commandToExecute.Parameters.AddWithValue("@PayGateWay", Session["dbPayGateWay"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@institutionCode", instutud);
                commandToExecute.Parameters.AddWithValue("@CountryName", Session["dbCountryName"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@StateName", Session["dbStateName"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@LGA", Session["dbLGA"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@City", Session["dbCity"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@Area", Session["dbArea"].ObjectToString());

                var recCount = DataBaseHandler.ExecuteSqlCommand(commandToExecute);
                bc.StatusId = recCount > 0 ? 1 : 0;
                if (recCount > 0)
                {
                    bc          = Selectgateway(newTransRefNo);
                    bc.StatusId = 1;
                }
                else
                {
                    bc.StatusMessage = "Unable to fetch all logged transaction";
                    bc.StatusId      = -1;
                }
            }
            else
            {
                bc.StatusMessage = "Invalid Merchant Code";
                bc.StatusId      = -1;
            }
            return(bc);
        }
コード例 #3
0
        private MessageClass UpdateTrueTransLog(string raveTransValue)
        {
            var          bc                = new MessageClass();
            const string gudmsg            = "Successful";
            const string gudcode           = "01";
            var          raveTransId       = raveTransValue;
            var          merchantCode      = Session["StateCode"].ObjectToString();
            var          currentDate       = DateTime.Today.ToString("ddMMyyyy");
            var          generatedNo       = Hash512Helper.GetDigitRandomNumbers();
            const string providername      = "JAMZ";
            const string platformname      = "WEB";
            var          formedPaymentRef  = merchantCode + "|" + providername + "|" + platformname + "|" + currentDate + "|" + generatedNo;
            const string receiptPrefix     = "372";
            var          formatedReceiptNo = receiptPrefix + string.Join(string.Empty, generatedNo.Skip(2));

            var commandToExecute = new SqlCommand("Barsh.UpdateTrue_LogTransaction")
            {
                CommandType = CommandType.StoredProcedure
            };

            commandToExecute.Parameters.AddWithValue("@TransRefNo", raveTransId);
            commandToExecute.Parameters.AddWithValue("@TransStatusMsg", gudmsg);
            commandToExecute.Parameters.AddWithValue("@TransStatusCode", gudcode);
            commandToExecute.Parameters.AddWithValue("@PaymentReference", formedPaymentRef);
            commandToExecute.Parameters.AddWithValue("@ReceiptNo", formatedReceiptNo);
            var recCount = DataBaseHandler.ExecuteSqlCommand(commandToExecute);

            bc.StatusId = recCount > 0 ? 1 : 0;
            if (recCount > 0)
            {
                SendGudTransDetailsEmail(raveTransId);
            }
            else
            {
                bc.StatusMessage = "Unable to update successful payment";
            }

            return(bc);
        }
コード例 #4
0
        private MessageClass LogPayaPayInfor()
        {
            var bc         = new MessageClass();
            var amountpaid = $"{Convert.ToDecimal(txtpayeamt.Text):n2}";

            var countryId = int.Parse(ddlCountries.SelectedItem.Value);

            if (countryId != 161)
            {
                var statename = txtOtherState.Value;
                Session["statename"] = statename;
                var lga = txtlga.Value;
                Session["lga"] = lga;
            }
            else
            {
                Session["statename"] = HfSelectedStateItem.Value;
                Session["lga"]       = HfSelectedLgaItem.Value;
            }

            HiddenFieldAgencyName.Value = Session["agencyName"].ObjectToString();
            LblAgencyNameShow.Text      = Session["agencyName"].ObjectToString();
            HiddenFieldAgencycode.Value = Session["agencyID"].ObjectToString();
            if (!string.IsNullOrEmpty(Convert.ToString(Session["InstitutionCode"])))
            {
                var instutud         = Convert.ToString(Session["InstitutionCode"]);
                var commandToExecute = new SqlCommand("Barsh.LogTransaction_InsertOrUpdate")
                {
                    CommandType = CommandType.StoredProcedure
                };
                commandToExecute.Parameters.AddWithValue("@TransRefNo", Lbltransref.Text);
                commandToExecute.Parameters.AddWithValue("@Surname", Lblpayersurname.Value);
                commandToExecute.Parameters.AddWithValue("@OtherNames", LblpayerOtherNames.Value);
                commandToExecute.Parameters.AddWithValue("@Address", txtStrtNo.Value);
                commandToExecute.Parameters.AddWithValue("@Email", txtEmail.Value);
                commandToExecute.Parameters.AddWithValue("@PhoneNo", Txbphone.Value);
                commandToExecute.Parameters.AddWithValue("@RevenueName", LblRevenueName.Text);
                commandToExecute.Parameters.AddWithValue("@RevenueCode", HiddenFieldRevenueCode.Value);
                commandToExecute.Parameters.AddWithValue("@AgencyName", HiddenFieldAgencyName.Value);
                commandToExecute.Parameters.AddWithValue("@AgencyCode", HiddenFieldAgencycode.Value);
                commandToExecute.Parameters.AddWithValue("@AmountPaid", Convert.ToDecimal(txtpayeamt.Text));
                commandToExecute.Parameters.AddWithValue("@PayGateWay", LblStateName.Text);
                commandToExecute.Parameters.AddWithValue("@institutionCode", instutud);
                commandToExecute.Parameters.AddWithValue("@CountryName", ddlCountries.SelectedItem.Text);
                commandToExecute.Parameters.AddWithValue("@StateName", Session["statename"].ToString());
                commandToExecute.Parameters.AddWithValue("@LGA", Session["lga"].ObjectToString());
                commandToExecute.Parameters.AddWithValue("@City", txtCityName.Value);
                commandToExecute.Parameters.AddWithValue("@Area", LblpayerArea.Value);
                commandToExecute.Parameters.AddWithValue("@payerpayperiod", lblpayperiod.Value);

                var recCount = DataBaseHandler.ExecuteSqlCommand(commandToExecute);
                bc.StatusId = recCount > 0 ? 1 : 0;
                if (recCount > 0)
                {
                    bc          = AccessPayGate();
                    bc.StatusId = 1;
                }
                else
                {
                    bc.StatusMessage = "Unable to fetch all logged transaction";
                    bc.StatusId      = -1;
                }
            }
            else
            {
                bc.StatusMessage = "No valid route found";
                bc.StatusId      = -1;
            }

            var transRefNo = Lbltransref.Text.Trim();

            SendGudTransDetailsEmail(transRefNo);
            return(bc);
        }