//------------------------------------------------------------------------------------------- private Billpayment SendPaymentViaBillPay(Accounting_Checks check) { using (WeavverEntityContainer data = new WeavverEntityContainer()) { var financialAccount = (from x in data.Accounting_Accounts where x.Id == AccountId select x).First(); Logistics_Addresses address = null; Billpayment billPayment = new Billpayment(); billPayment.FIUrl = Url; billPayment.FIId = FinancialInstitutionId.ToString(); billPayment.FIOrganization = FinancialInstitutionName; billPayment.OFXUser = Username; billPayment.OFXPassword = Password; billPayment.Payment.FromBankId = BankId; billPayment.Payment.FromAccountId = financialAccount.AccountNumber; billPayment.Payment.FromAccountType = ConvertWeavverLedgerTypeToEbankingAccountType((LedgerType) Enum.Parse(typeof(LedgerType), financialAccount.LedgerType)); billPayment.Payment.Memo = check.Memo; billPayment.Payment.Amount = check.Amount.ToString(); billPayment.Payment.DateDue = check.PostAt.ToString("MM/dd/yy"); billPayment.Payee.Account = check.Payee.ToString(); billPayment.Payee.State = address.State; billPayment.Payee.Addr1 = address.Line1; billPayment.PayBill(); // response stuff //lblCurrency.Text = billpayment1.Payment.CurrencyCode; //lblPaymentId.Text = billpayment1.Payment.Id; //lblPaymentDate.Text = billpayment1.Payment.DateProcessed; //lblStatus.Text = billpayment1.Payment.Status; //lblCheckNumber.Text = billpayment1.Payment.CheckNumber; return billPayment; } // , "Bill payment completed successfully! If payment was a scheduled transaction (not immediate), make a note of the Payment ID if want to modify or cancel this payment at a later time.", "Bill Payment Acknowledgment", MessageBoxButtons.OK, MessageBoxIcon.Information); }
//------------------------------------------------------------------------------------------- private Billpayment GetOFXBillPaymentObject() { using (WeavverEntityContainer data = new WeavverEntityContainer()) { Accounting_Accounts account = GetAccount(); Billpayment billPaymentData = new Billpayment(); billPaymentData.OFXAppId = "QWIN"; billPaymentData.OFXAppVersion = "1700"; billPaymentData.FIUrl = Url; billPaymentData.FIId = FinancialInstitutionId.ToString(); billPaymentData.FIOrganization = FinancialInstitutionName; billPaymentData.OFXUser = Username; billPaymentData.OFXPassword = Password; billPaymentData.Payment.FromBankId = BankId; billPaymentData.Payment.FromAccountId = account.AccountNumber; LedgerType lType = (LedgerType)Enum.Parse(typeof(LedgerType), account.LedgerType); billPaymentData.Payment.FromAccountType = Accounting_OFXSettings.ConvertWeavverLedgerTypeToEbankingAccountType(lType); return billPaymentData; } }