public bool ProccessCreditCard() { CardPro = new CrediCardProscessing(); string param = ""; CardPro.FirstName = messages.firstname;// Request.Form["FirstName"]; CardPro.LastName = messages.lastname;// Request.Form["LastName"]; CardPro.Address = messages.address;// Request.Form["Address"]; CardPro.City = messages.city;// Request.Form["City"]; CardPro.State = messages.state;// Request.Form["State"]; CardPro.ZIP = messages.zipcode;// Request.Form["zipcode"]; CardPro.Country = "USA";// Request.Form["FirstName"]; CardPro.CardNumber = messages.cardnumber;// Request.Form["CardNumber"]; CardPro.Expiration = messages.expdate;// Request.Form["expdate"]; // CardPro.Expiration = this.ddlMonth.SelectedValue + "/" + this.ddlYear.SelectedValue; CardPro.CVV = messages.cvv; CardPro.CustomerIP = messages.CustomerIP; /// Request.UserHostAddress; // Trace.Write("Amount", Request.Form["FirstName"]); // CardPro.Amount = Double.Parse(Request.Form["amount"], System.Globalization.NumberStyles.Currency); CardPro.Amount = Double.Parse(messages.amount , System.Globalization.NumberStyles.Currency); Boolean ProsPassed = CardPro.SubmitPayment("Donation to Chabad"); if (CardPro.ErrorMessage != null) { if (CardPro.ErrorMessage.Substring(0, CardPro.ErrorMessage.LastIndexOf("(")) == "There was a problem with the transactionA valid amount is required.") { messages.err = CardPro.ErrorMessage; messages.script = "<script type='text/javascript' language='javascript'>show('" + param + "','" + messages.amount + "' );</script>"; /// ((HtmlContainerControl)this.FindControl("dvmsg")).InnerText = CardPro.ErrorMessage.ToString(); // dvmsg.vat = CardPro.ErrorMessage.ToString(); ProsPassed = false; //CardPro.ErrorMessage = ""; } if (ProsPassed == false) { messages.err = CardPro.ErrorMessage; //script = "<script type='text/javascript' language='javascript'>show('" + param + "','" + amount_ + "' );</script>"; //lrt.Text = script; } // TableDonate.Attributes.Add("onload", "show('" + param + "','" + amount_ + "' )"); else { messages.err = messages.firstname + " " + messages.lastname + " Thank you for your kind donation of " + messages.amount + " " + messages.honor + " for sponsoring our pesach Seder"; } } else { messages.err = messages.firstname + " " + messages.lastname + " Thank you for your kind donation of " + messages.amount + " " + messages.honor + " for sponsoring our pesach Seder"; } messages.pro = ProsPassed; // messages.err = ErrorMessage; // messages.script = script; return ProsPassed; }
protected void CreditCardProscessing(int credits) { Decimal tot = Convert.ToDecimal(credits * .60); string dblDonationAmount = tot.ToString(); //// lblmsg.Text = ""; CrediCardProscessing CardPro = new CrediCardProscessing(); CardPro.FirstName = "Eli";// this.tbFirstName.Text; CardPro.LastName = "Barber";// this.tbLastName.Text; CardPro.Address = "672 Crown St.";//this.tbAddress.Text; CardPro.City = "Bklyn";//txtbCity.Text; CardPro.State = "NY";// txtbState.Text; CardPro.ZIP = "11213";// this.tbPostalCode.Text; CardPro.Country = "US";//this.ddlCountry.SelectedValue; CardPro.CardNumber = this.txtCardNumber.Text; CardPro.Expiration = this.cmbCardExpMonth.SelectedValue + "/" + this.cmbCardExpYear.SelectedValue; CardPro.CVV = this.txtCardCVV2.Text; CardPro.CustomerIP = Request.UserHostAddress; Trace.Write("Amount", dblDonationAmount); CardPro.Amount = Double.Parse(dblDonationAmount, System.Globalization.NumberStyles.Currency); bool ProsPassed = CardPro.SubmitPayment("Donation to Friendshipcircle"); /// lblmsg.Text = CardPro.ErrorMessage; if (ProsPassed) { string bodytext = "Proscess Result Information\n--------------\n" + "Authorization Code: " + CardPro.AuthorizationCode + "\n" + "Transaction ID: " + CardPro.TransactionID + "\n"; string ltrlResults = "<div style=\"color:#1C405E;\">You Have Successfully Donated to The Friendship " + "Circle<br/>Authorization Code: " + CardPro.AuthorizationCode + "<br/>Transaction ID: " + CardPro.TransactionID + @"<h2>Thank You</h2>Thank you for your support in assisting the Friendship Circle to continue supporting children with special needs, giving them and volunteers alike, a meaningful experience at our Ferber-Kaufman LifeTown at the Meer Family Friendship Center. <div style=""font-size:smaller;"">Your contribution towards the Friendship Circle is tax deductible. Please print this page for your tax deductible receipt. </div></div>"; } }