protected void btnContinue_Click(object sender, EventArgs e) { bool valid = true; string cardType = (ddlCardType.SelectedValue.Contains("x")) ? "x" : "i"; name = txtCardholderName.Text; Int32.TryParse(ddlCardType.SelectedValue.Replace(cardType, string.Empty), out cardCode); Int32.TryParse(txtAmount.Text, out amount); Int32.TryParse(ddlInstallments.SelectedValue, out installments); Int32.TryParse(ddlBCPoint.SelectedValue, out BCPoints); valid = amount <= (ShoppingCart.Totals as OrderTotals_V01).AmountDue; if (valid) { var info = new KSAuthInfo(amount, cardCode, installments, BCPoints, name); Session[KSAuthInfo.Key] = info; if (cardType == "x") { sourceUrl = "Controls/Payments/KsNet/MPIAuth.aspx"; } else { sourceUrl = "Controls/Payments/KsNet/ISPAuth.aspx"; } theFrame.Text = "<iframe runat=\"server\" id=\"AuthFrame\" name=\"AuthFrame\" style=\"display: none\" src=\"" + sourceUrl + "\"></iframe>"; } }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); bool proceed = false; string Proceed = (string.IsNullOrEmpty(Request["proceed"])) ? string.Empty : Request["proceed"]; if (bool.TryParse(Proceed, out proceed)) { KSAuthInfo info = Session[KSAuthInfo.Key] as KSAuthInfo; Session[KSAuthInfo.Key] = null; if (null == info) { ECI.Value = (string.IsNullOrEmpty(Request["eci"])) ? string.Empty : Request["eci"]; CAVV.Value = (string.IsNullOrEmpty(Request["cavv"])) ? string.Empty : Request["cavv"]; XID.Value = (string.IsNullOrEmpty(Request["xid"])) ? string.Empty : Request["xid"]; CardNumber.Value = (string.IsNullOrEmpty(Request["cardno"])) ? string.Empty : Request["cardno"]; SessionKey.Value = string.Empty; EncryptedData.Value = string.Empty; OnAuthorizeAttempt(this, new EventArgs()); //ActionCode.Text = SubmitResponseScript.Replace("xid", Xid).Replace("eci", Eci).Replace("cavv", Cavv).Replace("cardnumber", CardNumber); } } }