public override bool OnSaveContent(bool bDialogIsClosing = true) { MyFinancialCommitmentsOptions2 options = new MyFinancialCommitmentsOptions2(); options.DemoMode = this.chkDemo.Checked; options.ThankYouMessage = this.txtMessage.Text; options.MerchantAccountID = Convert.ToInt16(ddlMerchantAccounts.SelectedValue); this.Content.SaveContent(options); return(true); }
public override void OnLoadContent() { if (!IsPostBack) { MyFinancialCommitmentsOptions2 options = (MyFinancialCommitmentsOptions2)this.Content.GetContent(typeof(MyFinancialCommitmentsOptions2)); if (options != null) { this.chkDemo.Checked = options.DemoMode; this.txtMessage.Text = options.ThankYouMessage; ddlMerchantAccounts.SelectedValue = options.MerchantAccountID.ToString(); } } }
private bool processPayment() { MyFinancialCommitmentsOptions2 options = (MyFinancialCommitmentsOptions2)this.Content.GetContent(typeof(MyFinancialCommitmentsOptions2)); BBPSPaymentInfo payment = new BBPSPaymentInfo(); payment.DemoMode = options.DemoMode; payment.MerchantAcctID = options.MerchantAccountID; payment.Bbpid = Utility.GetBbbid(options.MerchantAccountID, this.API.Transactions.MerchantAccounts); payment.SkipCardValidation = options.DemoMode; int designationId = Utility.GetBbncDesignationId(Convert.ToString(ViewState["GiftId"])); payment.AddDesignationInfo(Convert.ToDecimal(this.txtAmount.Text), "BBIS Child Sponsorship Transaction", designationId); payment.AppealID = 1; payment.Comments = ""; payment.PaymentMethod = BBNCExtensions.API.Transactions.PaymentArgs.ePaymentMethod.CreditCard; payment.CreditCardCSC = this.txtCcSecurityCode.Text; payment.CreditCardExpirationMonth = Convert.ToInt32(this.cmbCcExpMonth.SelectedValue); payment.CreditCardExpirationYear = Convert.ToInt32(this.cmbCcExpYear.SelectedValue); payment.CreditCardHolderName = this.txtCcName.Text; payment.CreditCardNumber = this.txtCcNumber.Text; //VIOLATION of PCI Compliance - as a developer we can by no means ever write code that consumes someones credit card number payment.CreditCardType = (BBNCExtensions.Interfaces.Services.CreditCardType)Enum.Parse(typeof(BBNCExtensions.Interfaces.Services.CreditCardType), this.cmbCcType.SelectedValue); payment.DonorStreetAddress = this.txtBillingAddress.Text; payment.DonorCity = this.txtBillingCity.Text; payment.DonorStateProvince = this.cmbBillingCountry.SelectedValue == "US" ? this.cmbBillingState.SelectedValue : this.txtBillingRegion.Text; payment.DonorZIP = this.txtBillingZip.Text; BBNCExtensions.API.Transactions.Donations.RecordDonationReply reply = this.API.Transactions.RecordDonation(payment.GeneratePaymentArgs()); this.lblSummary.Text = "Payment of " + Convert.ToDecimal(this.txtAmount.Text).ToString("c") + " accepted."; if (!payment.InterpretPaymentReply(reply).Success) { this.lblError.Visible = true; this.lblError.Text = payment.InterpretPaymentReply(reply).Message; return(false); } else { return(true); } }