Exemple #1
0
 /// <summary>
 /// Makes an STK Push payment request to MPESA API Server.
 /// </summary>
 /// <param name="lipaNaMpesaOnlineDto">
 /// Data transfer object containing properties for the Lipa Na Mpesa Online API endpoint.
 /// </param>
 /// <param name="accesstoken">Acccesstoken retrieved by the <c>GetAuthTokenAsync</c> method.</param>
 /// <param name="requestEndPoint">Set to <c>RequestEndPoint.LipaNaMpesaOnline</c></param>
 /// <param name="cancellationToken">Cancellation Token</param>
 /// <returns>A JSON string containing LNMO response data from MPESA API Server</returns>
 public async Task <string> MakeLipaNaMpesaOnlinePaymentAsync(LipaNaMpesaOnlineDto lipaNaMpesaOnlineDto, string accesstoken, string requestEndPoint, CancellationToken cancellationToken = default)
 {
     return(await MpesaHttpRequest(lipaNaMpesaOnlineDto, accesstoken, requestEndPoint, cancellationToken));
 }
Exemple #2
0
 /// <summary>
 /// Makes a STK Push payment request to MPESA API Server.
 /// </summary>
 /// <param name="lipaNaMpesaOnlineDto">
 /// Data trnasfer object containing properties for the Lipa Na Mpesa Online API endpoint.
 /// </param>
 /// <param name="accesstoken">Acccesstoken retrieved by the <c>GetAuthTokenAsync</c> method.</param>
 /// <param name="requestEndPoint">Set to <c>RequestEndPoint.LipaNaMpesaOnline</c></param>
 /// <param name="cancellationToken">Cancellation Token</param>
 /// <returns>A JSON string containing LNMO response data from MPESA API Server</returns>
 public string MakeLipaNaMpesaOnlinePayment(LipaNaMpesaOnlineDto lipaNaMpesaOnlineDto, string accesstoken, string requestEndPoint, CancellationToken cancellationToken = default)
 {
     return(MpesaHttpRequest(lipaNaMpesaOnlineDto, accesstoken, requestEndPoint, cancellationToken).GetAwaiter().GetResult());
 }