async_mpesa/
expressquery.rs1use crate::{
2 client::Client,
3 config::Config,
4 error::MpesaError,
5 types::{ExpressQueryRequest, ExpressQueryResponse}
6};
7
8pub struct ExpressQuery<'m, C: Config> {
10 client: &'m Client<C>,
11}
12
13impl <'m, C: Config> ExpressQuery<'m, C> {
14 pub fn new(client: &'m Client<C>) -> Self {
15 Self { client }
16 }
17
18 pub async fn create(
20 &self,
21 request: ExpressQueryRequest,
22 ) -> Result<ExpressQueryResponse, MpesaError> {
23 self.client.post("/mpesa/stkpushquery/v1/query", request).await
24 }
25}