Ejemplo n.º 1
0
        public string RegisterUrl(RegisterUrlRequest payload)
        {
            Dictionary <string, string> headers = new Dictionary <string, string>
            {
                { "Authorization", $"Bearer {accessToken().Trim()}" }
            };
            string          url     = BASE_URL + "consumer/v3/registerurl";
            ITelekomService service = new TelekomService <RegisterUrlRequest>(url, RestSharp.Method.POST, payload, headers);
            var             item    = service.ServiceRequest();

            return(item.Item1);
        }
Ejemplo n.º 2
0
        public async Task <string[]> RegisterUrlAsync(string consumerKey, string consumersecret, RegisterUrlRequest registerUrlRequest, bool isSandbox = true)
        {
            registerUrlRequest.ResponseType = "Completed";
            JObject jObject = JObject.FromObject(registerUrlRequest);

            string auth    = Authenticate(consumerKey, consumersecret, isSandbox);
            string baseUrl = getBaseUrl(isSandbox);

            return(await SendExpressRequestAsync(auth, baseUrl, "mpesa/c2b/v1/registerurl", jObject));
        }