private void button1_Click(object sender, EventArgs e) { double amount = double.Parse(this.textBox1.Text); String refernceId = this.textBox2.Text; String mobileNumber = this.textBox3.Text; Customer cust = new Customer(); cust.setMobileNumber(mobileNumber); OptionalParams op = new OptionalParams(); op.setCustomer(cust); // ref.se // op.setReference(ref); EzeResult result = EzeAPI.create().cashTransaction(amount, op); if (result.getStatus() == Status.SUCCESS) { Form3 f = new Form3(this, result.getResult().getTransactionDetails().getTxnId(), cust, parent); f.Show(); } else { MessageBox.Show(result.getError().getMessage(), "", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, false); } }
private void button3_Click(object sender, EventArgs e) { OptionalParams p = new OptionalParams(); String mobileNumber = this.textBox4.Text; if (mobileNumber != null) { Customer cust = new Customer(); cust.setMobileNumber(mobileNumber); p.setCustomer(cust); } EzeResult res = EzeAPI.create().cardTransaction(20.0, PaymentMode.SALE, p); Console.WriteLine("666666.... " + res.getStatus()); if (res.getStatus() == Status.SUCCESS) { // f3 = new Form3(parent, "23"); if (res.getResult() != null) { com.eze.api.TransactionDetails td = res.getResult().getTransactionDetails(); Form3 f3 = new Form3(parent, td.getTxnId(), p.getCustomer(), parent); f3.Show(); } } else { MessageBox.Show(res.getError().getMessage(), "", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, false); } }
internal string Usage(string commandName, bool inCLI, bool onlyCommandline = false) { List <Parameter> RequiredParams; List <Parameter> OptionalParams; StringBuilder Expression = new StringBuilder(UsageExpression.Prefix); if (!inCLI) { Expression.Append($"{Constants.AssemblyFile} "); } Expression.Append(commandName); if (!IsDefault) { Expression.Append($" {Name}"); } //Required Parameters RequiredParams = Parameters.Where(p => p.DefinitionRequired).ToList(); if (RequiredParams.Count() > 0) { RequiredParams.ForEach(p => Expression.Append(p.CliSyntax())); } //Optional Parameters OptionalParams = Parameters.Where(p => !p.DefinitionRequired).ToList(); if (OptionalParams.Count() > 0) { Expression.Append(" "); StringBuilder tmp = new StringBuilder(string.Empty); OptionalParams.ForEach(p => tmp.Append(p.CliSyntax())); tmp.Append(" "); Expression.Append(tmp.ToString().InBraces()); } if (onlyCommandline) { return(Expression.ToString()); } if (Parameters.Count > 0) { int padding = Parameters.Select(p => p.Name).GetPadding(); Expression.Append($"\r\n{UsageExpression.RequiredParameters}"); RequiredParams.ForEach(p => Expression.Append(p.DetailedUsage(padding))); if (OptionalParams.Count > 0) { Expression.Append(UsageExpression.OptionalParameters); OptionalParams.ForEach(p => Expression.Append(p.DetailedUsage(padding))); } } return(Expression.ToString()); }
private void button1_Click(object sender, EventArgs e) { String mobileNumber = this.textBox5.Text; String emailId = this.textBox6.Text; Customer customer = new Customer(); customer.setEmailId(emailId); customer.setMobileNumber(mobileNumber); String referenceId = this.textBox4.Text; // String chequeBankName = this.textBox2.Text; String chequeBankCode = this.textBox3.Text; String chequeDate = this.textBox4.Text; Cheque che = new Cheque(); che.setBankName(chequeBankName); che.setBankCode(chequeBankCode); che.setChequeDate(chequeDate); che.setChequeNumber("100"); Reference refe = new Reference(); refe.setReference1(referenceId); OptionalParams op = new OptionalParams(); op.setCustomer(customer); op.setReference(refe); double amount = double.Parse(this.textBox1.Text); EzeResult result = EzeAPI.create().chequeTransaction(amount, che, op); if (result.getStatus() == Status.SUCCESS) { if (result.getResult() != null) { com.eze.api.TransactionDetails td = result.getResult().getTransactionDetails(); Form3 f3 = new Form3(parent, td.getTxnId(), op.getCustomer(), parent); f3.Show(); } } else { MessageBox.Show(result.getError().getMessage(), "", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, false); } }