예제 #1
0
        public static ApiResponse <object> Send(GetInstitutionsRequest request)
        {
            Dictionary <string, object> body          = new Dictionary <string, object>();
            Dictionary <string, object> searchFilters = new Dictionary <string, object>();

            searchFilters.Add("institution_name", request.InstitutionName);
            searchFilters.Add("institution_name", request.RoutingNumber);
            searchFilters.Add("institution_name", request.Page);
            searchFilters.Add("institution_name", request.PerPage);
            body.Add("header", new Header
            {
                Created   = EpochUtils.getEpoch(),
                AppHandle = AppHandle
            });
            body.Add("search_filters", searchFilters);

            string serializedBody = SerializationUtil.Serialize(body);

            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers = HeaderUtils.SetAuthSignature(headers, serializedBody);

            IRestResponse response = (IRestResponse)ApiClient.CallApi(endpoint, RestSharp.Method.POST, serializedBody, headers, "application/json");

            return(ResponseUtils.PrepareResponse <GetInstitutionsResponse>(response));
        }
예제 #2
0
        public static ApiResponse <object> Send(CheckPartnerKycRequest request)
        {
            Dictionary <string, object> body = new Dictionary <string, object>();

            body.Add("header", new Header
            {
                Created   = EpochUtils.getEpoch(),
                AppHandle = AppHandle,
                Crypto    = "ETH",
                Reference = UuidUtils.GetUuid(),
                Version   = "0.2"
            });
            body.Add("query_app_handle", request.QueryAppHandle);
            body.Add("query_user_handle", request.QueryUserHandle);

            string serializedBody = SerializationUtil.Serialize(body);

            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers = HeaderUtils.SetAuthSignature(headers, serializedBody);

            IRestResponse response = (IRestResponse)ApiClient.CallApi(endpoint, RestSharp.Method.POST, serializedBody, headers, "application/json");

            return(ResponseUtils.PrepareResponse <CheckPartnerKycResponse>(response));
        }
예제 #3
0
        public static ApiResponse <object> Send(GetTransactionsRequest request)
        {
            Dictionary <string, object> body = new Dictionary <string, object>();

            body.Add("header", new Header
            {
                Created    = EpochUtils.getEpoch(),
                AppHandle  = AppHandle,
                UserHandle = request.UserHandle,
                Crypto     = "ETH",
                Reference  = UuidUtils.GetUuid(),
                Version    = "0.2"
            });
            body.Add("message", "get_transactions_msg");
            body.Add("search_filters", request.SearchFilters);

            string serializedBody = SerializationUtil.Serialize(body);

            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers = HeaderUtils.SetAuthSignature(headers, serializedBody);

            IRestResponse response = (IRestResponse)ApiClient.CallApi(endpoint, RestSharp.Method.POST, serializedBody, headers, "application/json");

            return(ResponseUtils.PrepareResponse <GetTransactionsResponse>(response));
        }
예제 #4
0
        public static ApiResponse <object> Send(LinkAccountRequest request)
        {
            Dictionary <string, object> body = new Dictionary <string, object>();

            body.Add("header", new Header
            {
                Created    = EpochUtils.getEpoch(),
                AppHandle  = AppHandle,
                UserHandle = request.UserHandle,
                Crypto     = "ETH",
                Reference  = UuidUtils.GetUuid(),
                Version    = "0.2"
            });
            body.Add("account_name", request.AccountName);
            body.Add("account_number", request.AccountNumber);
            body.Add("routing_number", request.RoutingNumber);
            body.Add("account_type", request.AccountType);
            body.Add("plaid_token", request.PlaidToken);
            body.Add("selected_account_id", request.SelectedAccountId);
            body.Add("plaid_token_type", request.PlaidTokenType);

            string serializedBody = SerializationUtil.Serialize(body);

            Console.WriteLine(serializedBody);

            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers = HeaderUtils.SetAuthSignature(headers, serializedBody);
            headers = HeaderUtils.SetUserSignature(headers, serializedBody, request.UserPrivateKey);

            IRestResponse response = (IRestResponse)ApiClient.CallApi(endpoint, RestSharp.Method.POST, serializedBody, headers, "application/json");

            return(ResponseUtils.PrepareResponse <LinkAccountResponse>(response));
        }
예제 #5
0
        public static ApiResponse <object> Send(RegisterRequest request)
        {
            Dictionary <string, object> body = new Dictionary <string, object>();

            body.Add("header", new Header
            {
                Created    = EpochUtils.getEpoch(),
                AppHandle  = AppHandle,
                Crypto     = "ETH",
                Reference  = UuidUtils.GetUuid(),
                UserHandle = request.UserHandle,
                Version    = "0.2"
            });
            body.Add("message", "entity_msg");
            body.Add("address", request.Address);
            body.Add("identity", request.Identity);
            body.Add("contact", request.Contact);
            body.Add("crypto_entry", request.CryptoEntry);
            body.Add("entity", request.Entity);
            body.Add("device", request.Device);

            string serializedBody = SerializationUtil.Serialize(body);

            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers = HeaderUtils.SetAuthSignature(headers, serializedBody);

            IRestResponse response = (IRestResponse)ApiClient.CallApi(endpoint, RestSharp.Method.POST, serializedBody, headers, "application/json");

            return(ResponseUtils.PrepareResponse <RegisterResponse>(response));
        }
예제 #6
0
        public static ApiResponse <object> Send(UpdateAccountRequest request)
        {
            Dictionary <string, object> body = new Dictionary <string, object>();

            body.Add("header", new Header
            {
                Created    = EpochUtils.getEpoch(),
                AppHandle  = AppHandle,
                UserHandle = request.UserHandle,
                Crypto     = "ETH",
                Reference  = UuidUtils.GetUuid(),
                Version    = "0.2"
            });
            body.Add("account_name", request.AccountName);
            body.Add("new_account_name", request.NewAccountName);

            string serializedBody = SerializationUtil.Serialize(body);

            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers = HeaderUtils.SetAuthSignature(headers, serializedBody);
            headers = HeaderUtils.SetUserSignature(headers, serializedBody, request.UserPrivateKey);

            IRestResponse response = (IRestResponse)ApiClient.CallApi(endpoint, RestSharp.Method.POST, serializedBody, headers, "application/json");

            return(ResponseUtils.PrepareResponse <UpdateAccountResponse>(response));
        }
        public static ApiResponse <object> Send(PlaidUpdateLinkTokenRequest request)
        {
            Dictionary <string, object> body = new Dictionary <string, object>();

            body.Add("header", new Header
            {
                Created    = EpochUtils.getEpoch(),
                AppHandle  = AppHandle,
                UserHandle = request.UserHandle
            });
            body.Add("account_name", request.AccountName);

            string serializedBody = SerializationUtil.Serialize(body);

            Console.WriteLine(serializedBody);

            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers = HeaderUtils.SetAuthSignature(headers, serializedBody);

            IRestResponse response = (IRestResponse)ApiClient.CallApi(endpoint, RestSharp.Method.POST, serializedBody, headers, "application/json");

            return(ResponseUtils.PrepareResponse <PlaidUpdateLinkTokenResponse>(response));
        }