Ejemplo n.º 1
0
        public MpesaApi(string consumerKey, string consumerSecret, MpesaApiOptions options, Func <HttpClient> httpClientFactory = null)
        {
            _httpClientFactory = httpClientFactory;

            _consumerKey    = consumerKey;
            _consumerSecret = consumerSecret;
            _options        = Options.From(options);
        }
Ejemplo n.º 2
0
 public static Options From(MpesaApiOptions options)
 {
     return(new Options
     {
         ShortCode = options.ShortCode,
         Initiator = options.Initiator,
         InitiatorPassword = options.InitiatorPassword,
         PassKey = options.PassKey,
         IsLive = options.IsLive,
         QueueTimeoutURL = options.QueueTimeoutURL,
         ResultURL = options.ResultURL
     });
 }