/// <summary> /// Makes a Business to Business payment request between Paybill numbers. /// </summary> /// <param name="businessToBusiness">B2B data transfer object.</param> /// <param name="accesstoken">Acccesstoken retrieved by the <c>GetAuthTokenAsync</c> method.</param> /// <param name="mpesaRequestEndpoint">Set to <c>MpesaRequestEndpoint.BusinessToBusiness</c></param> /// <param name="cancellationToken">Cancellation Token</param> /// <returns>A JSON string containing data from MPESA API reposnse.</returns> public async Task <MpesaResponse> MakeB2BPaymentAsync(BusinessToBusiness businessToBusiness, string accesstoken, string mpesaRequestEndpoint, CancellationToken cancellationToken = default) { return(await MpesaPostRequestAsync <MpesaResponse>(businessToBusiness, accesstoken, mpesaRequestEndpoint, cancellationToken)); }
/// <summary> /// Makes a Business to Business payment request between Paybill numbers. /// </summary> /// <param name="businessToBusiness">B2B data transfer object.</param> /// <param name="accesstoken">Acccesstoken retrieved by the <c>GetAuthTokenAsync</c> method.</param> /// <param name="mpesaRequestEndpoint">Set to <c>MpesaRequestEndpoint.BusinessToBusiness</c></param> /// <param name="cancellationToken">Cancellation Token</param> /// <returns>A JSON string containing data from MPESA API reposnse.</returns> public MpesaResponse MakeB2BPayment(BusinessToBusiness businessToBusiness, string accesstoken, string mpesaRequestEndpoint, CancellationToken cancellationToken = default) { return(MpesaPostRequestAsync <MpesaResponse>(businessToBusiness, accesstoken, mpesaRequestEndpoint, cancellationToken).GetAwaiter().GetResult()); }