Beispiel #1
0
        public GetAccountByIdFullResponse GetAccountByIdFull(string bankId, string accountId, string viewId)
        {
            var url = TokenStringFormat.Format(
                URL_GET_ACCOUNT_BY_ID_FULL,
                new { BankId = bankId, AccountId = accountId, ViewId = viewId });

            return(this.DoGet <GetAccountByIdFullResponse>(url));
        }
Beispiel #2
0
        public GetAccountByIdCoreResponse GetAccountByIdCore(string bankId, string accountId)
        {
            var url = TokenStringFormat.Format(
                URL_GET_ACCOUNT_BY_ID_CORE,
                new { BankId = bankId, AccountId = accountId });

            return(this.DoGet <GetAccountByIdCoreResponse>(url));
        }
        public void Consume(SampleMessage message)
        {
            this.apiClient.SaveSampleMessage(message);

            this.Log.Info(
                TokenStringFormat.Format(
                    "SampleMessage: {Id}, {Timestamp}, {Data}.",
                    message));
        }
Beispiel #4
0
        public IEnumerable <AccountInfo> GetAccountsAtBank(string bankId)
        {
            var url = TokenStringFormat.Format(
                URL_GET_ACCOUNTS_AT_BANK,
                new { BankId = bankId });

            var accounts = this.DoGet <List <AccountInfo> >(url);

            return(accounts);
        }
Beispiel #5
0
        public GetTransactionTypesOfferedByBankResponse GetTransactionTypesOfferedByBankResponse(string bankId)
        {
            var url = TokenStringFormat.Format(
                URL_GET_TRANSACTION_TYPES_OFFERED_BY_BANK,
                new
            {
                BankId = bankId
            });

            return(this.DoGet <GetTransactionTypesOfferedByBankResponse>(url));
        }
Beispiel #6
0
        private string FormatRootDirectory(string zappDir)
        {
            var args = new
            {
                zappDir = zappDir
            };

            var baseFormat = configStore.Value.Fuse.RootDirectory;

            return(TokenStringFormat.Format(baseFormat, args));
        }
Beispiel #7
0
        public GetTransactionsForAccountCoreResponse GetTransactionsForAccountCore(string bankId, string accountId)
        {
            var url = TokenStringFormat.Format(
                URL_GET_TRANSACTIONS_FOR_ACCOUNT_CORE,
                new
            {
                BankId    = bankId,
                AccountId = accountId
            });

            return(this.DoGet <GetTransactionsForAccountCoreResponse>(url));
        }
Beispiel #8
0
        private string FormatFusionDirectory(string fusionId, string epoch)
        {
            var args = new
            {
                fusionId = fusionId,
                epoch    = epoch
            };

            var baseFormat = configStore.Value.Fuse.FusionDirectoryPattern;

            return(TokenStringFormat.Format(baseFormat, args));
        }
 /// <summary>
 /// When RavenDb is running in "embedded" mode, the hosting web application acts as the container.  This means that until the web app is loaded,
 /// a connection can't be established to RavenDB.  This method hits the web application to ensure that it, and by extension RavenDB, are loaded
 /// </summary>
 private void LoadWebApp()
 {
     using (var client = new WebClient())
     {
         client.DownloadData((string)TokenStringFormat.Format(ApplicationUrlTemplate,
                                                              new
         {
             ServerConfiguration.WebApplication.Port,
             ApplicationName = ServerConfiguration.WebApplication.Name
         }));
     }
 }
Beispiel #10
0
        public IEnumerable <TransactionRequestType> GetTransactionRequestTypesForAccount(string bankId, string accountId, string viewId)
        {
            var url = TokenStringFormat.Format(
                URL_GET_TRANSACTION_REQUEST_TYPES_FOR_ACCOUNT,
                new
            {
                BankId    = bankId,
                AccountId = accountId,
                ViewId    = viewId
            });

            return(this.DoGet <List <TransactionRequestType> >(url));
        }
Beispiel #11
0
        public GetTransactionRequestsResponse GetTransactionRequests(string bankId, string accountId, string viewId)
        {
            var url = TokenStringFormat.Format(
                URL_GET_TRANSACTION_REQUESTS,
                new
            {
                BankId    = bankId,
                AccountId = accountId,
                ViewId    = viewId
            });

            return(this.DoGet <GetTransactionRequestsResponse>(url));
        }
Beispiel #12
0
 public void AnswerTransactionRequestChallenge(string bankId, string accountId, string viewId, string transactionRequestType, string transactionRequestId, AnswerTransactionRequestChallenge request)
 {
     var url = TokenStringFormat.Format(
         URL_CREATE_TRANSACTION_REQUEST,
         new
     {
         BankId    = bankId,
         AccountId = accountId,
         ViewId    = viewId,
         TransactionRequestType = transactionRequestType
     });
     //    return this.DoPost<TransactionRequest>(url, content: request);
 }
Beispiel #13
0
        public Transaction GetTransactionById(string bankId, string accountId, string viewId, string transactionId)
        {
            var url = TokenStringFormat.Format(
                URL_GET_TRANSACTION_BY_ID,
                new
            {
                BankId        = bankId,
                AccountId     = accountId,
                ViewId        = viewId,
                TransactionId = transactionId
            });

            return(this.DoGet <Transaction>(url));
        }
Beispiel #14
0
        public void Login(string username, string password, string consumerKey)
        {
            var authorizationValue = TokenStringFormat.Format(
                HEADER_AUTHORIZATION,
                new { Username = username, Password = password, ConsumerKey = consumerKey });

            var headers = new Dictionary <string, string> {
                { "Authorization", authorizationValue }
            };

            var response = this.DoPost <LoginResponse>(URL_LOGINS_DIRECT, headers: headers);

            this.token = response.Token;
        }
Beispiel #15
0
        public void Consume(GetSampleMessagesList message)
        {
            var sampleMessages = this.ApiClient.GetSampleMessages(message.StartIndex, message.NumberOfItems);

            this.ServiceBus.Publish(new GetSampleMessagesListResult
            {
                CorrelationId = message.CorrelationId,
                StartIndex    = message.StartIndex,
                NumberOfItems = message.NumberOfItems,
                Result        = sampleMessages
            });

            this.Log.Info(
                TokenStringFormat.Format(
                    "GetSampleMessagesList: {CorrelationId}.",
                    message));
        }
        public static string Render(string format, Dictionary <string, object> dictionary)
        {
            // получили лист всех имеющихся в формате подстановок
            IEnumerable <string> tokens;

            TokenStringFormat.TokenizeString(format, out tokens);
            var list = (List <string>)tokens;

            // все, что требуется, но не содержится в словаре
            var required = list.Where(x => !dictionary.ContainsKey(x)).Select(x => x).ToList();

            // добавили в словарь то, что требуется, но чего нет
            foreach (var r in required)
            {
                dictionary.Add(r, null);
            }

            return(TokenStringFormat.Format(format, dictionary));
        }
Beispiel #17
0
        public TransactionRequest CreateTransactionRequest(
            string bankId,
            string accountId,
            string viewId,
            string transactionRequestType,
            CreateTransactionRequestRequest request)
        {
            var url = TokenStringFormat.Format(
                URL_CREATE_TRANSACTION_REQUEST,
                new
            {
                BankId    = bankId,
                AccountId = accountId,
                ViewId    = viewId,
                TransactionRequestType = transactionRequestType
            });

            return(this.DoPost <TransactionRequest>(url, content: request));
        }
Beispiel #18
0
 public static string FormatWith(this string format, object values)
 {
     return(TokenStringFormat.Format(format, values));
 }