public IPaymentProvider Create(BankNames bankName) { switch (bankName) { case BankNames.AkBank: case BankNames.IsBankasi: case BankNames.HalkBank: case BankNames.ZiraatBankasi: case BankNames.TurkEkonomiBankasi: case BankNames.IngBank: case BankNames.TurkiyeFinans: case BankNames.AnadoluBank: case BankNames.HSBC: case BankNames.SekerBank: { //NestPay(AkBank, IsBankasi, HalkBank, ZiraatBankasi, TurkEkonomiBankasi, IngBank, TurkiyeFinans, AnadoluBank, HSBC, SekerBank) return(ActivatorUtilities.CreateInstance <NestPayPaymentProvider>(_serviceProvider)); } case BankNames.DenizBank: { //Denizbank(InterVpos) return(ActivatorUtilities.CreateInstance <DenizbankPaymentProvider>(_serviceProvider)); } case BankNames.FinansBank: { //Finansbank(PayFor) return(ActivatorUtilities.CreateInstance <FinansbankPaymentProvider>(_serviceProvider)); } case BankNames.Garanti: { //Garanti(GVP) return(ActivatorUtilities.CreateInstance <GarantiPaymentProvider>(_serviceProvider)); } case BankNames.KuveytTurk: { //KuveytTurk return(ActivatorUtilities.CreateInstance <KuveytTurkPaymentProvider>(_serviceProvider)); } case BankNames.VakifBank: { //Vakıfbank(GET 7/24) return(ActivatorUtilities.CreateInstance <VakifbankPaymentProvider>(_serviceProvider)); } case BankNames.Yapikredi: case BankNames.Albaraka: { //POSNET(Yapıkredi, AlbarakaTurk) return(ActivatorUtilities.CreateInstance <PosnetPaymentProvider>(_serviceProvider)); } } throw new NotSupportedException("Bank not supported"); }
public IPaymentProvider Create(BankNames bankName) { if (!_providerTypes.ContainsKey(bankName)) { throw new NotSupportedException("Bank not supported"); } Type type = _providerTypes[bankName]; return(ActivatorUtilities.CreateInstance(_serviceProvider, type) as IPaymentProvider); }
public CreditCard GetCreditCard(BankNames bankNames) { switch (bankNames) { case BankNames.HNB: return(new HNBCreditCard()); case BankNames.Sampth: return(new SampathCreditCard()); case BankNames.NSB: return(new NSBCreditCard()); default: throw new NotImplementedException(); } }
private static void InitialiseBankNames(QuickLoanDbContext context) { var BankNames = new BankNames[] { new BankNames { BankId = 10, NationalIdentifier = "ABC", BankName = "OBC1" }, new BankNames { BankId = 10, NationalIdentifier = "ABC", BankName = "OBC1" } }; }
public static IPaymentStrategy GetInstance(BankNames predict) { switch (predict) { case BankNames.ZarinPal: return(new ZarinPalStrategy()); case BankNames.Pay: return(new PayStrategy()); case BankNames.Melli: return(new SadadStrategy()); case BankNames.Pasargad: return(new PasargadStrategy()); } return(new ZarinPalStrategy()); }
public TransactionResponse GetTransactionById(int bankId, int accountId, int viewId, int transactionId) { TransactionResponse response = new TransactionResponse(); List <TransactionList> transactions = new List <TransactionList>(); List <Transactions> trans = new List <Transactions>(); trans = _context.Transactions.OrderByDescending(item => item.Id).Where(item => item.AccountsId == accountId).ToList(); var transactionRecords = from t in trans orderby t.Id descending select t; foreach (Transactions tr in trans) { var account = _context.Accounts.Select(item => item).Where(item => item.Id == accountId).SingleOrDefault(); var otherAccount = _context.Accounts.Select(item => item).Where(item => item.Id == tr.AccountsId).SingleOrDefault(); List <AccountDetails> accountDetails = _context.AccountDetails.Select(item => item).Where(item => item.AccountsId == accountId).ToList <AccountDetails>(); List <AccountDetails> otherAccountDetails = _context.AccountDetails.Select(item => item).Where(item => item.AccountsId == tr.OtherAccountId).ToList <AccountDetails>(); List <Members> memberDetails = _context.Members.Select(item => item).Where(item => item.Id == accountDetails[0].MembersId).ToList <Members>(); List <Members> otherMemberDetails = _context.Members.Select(item => item).Where(item => item.Id == otherAccountDetails[0].MembersId).ToList <Members>(); BankNames bankDetails = _context.BankNames.Select(item => item).Where(item => item.BankId == account.bankId).ToList <BankNames>()[0]; BankNames otherBankDetails = _context.BankNames.Select(item => item).Where(item => item.BankId == account.bankId).ToList <BankNames>()[0]; response.this_account = new ThisAccount(); response.this_account.IBAN = account.IBAN; response.this_account.swift_bic = account.swift_bic; response.this_account.number = account.AccountNumber; response.this_account.holders = new List <Holder>(); response.this_account.holders.Add(new Holder() { name = memberDetails[0].MemberName, is_alias = true }); response.this_account.bank = new Bank() { name = bankDetails.BankName, national_identifier = bankDetails.NationalIdentifier }; response.this_account.kind = "AC"; /*other account details */ response.other_account = new OtherAccount(); response.other_account.number = otherAccount.AccountNumber; response.other_account.IBAN = otherAccount.IBAN; response.other_account.swift_bic = otherAccount.swift_bic; response.other_account.bank = new Bank2() { name = otherBankDetails.BankName, national_identifier = otherBankDetails.NationalIdentifier }; response.other_account.kind = "AC"; response.other_account.holder = new Holder2() { name = otherMemberDetails[0].MemberName, is_alias = true }; /* metadata */ response.other_account.metadata = new Metadata(); /* metadata*/ response.details = new Details(); response.details.type = "AC"; response.details.completed = Convert.ToDateTime(tr.Completed); response.details.posted = Convert.ToDateTime(tr.Postdate); response.details.description = tr.Description; response.details.new_balance = new NewBalance() { currency = "EUR", amount = "10" }; response.details.value = new Value() { currency = "EUR", amount = "10" }; } return(response); }