pub struct DynamicQR<'mpesa, Env: ApiEnvironment> { /* private fields */ }
Expand description
Dynamic QR builder struct
Implementations§
source§impl<'mpesa, Env: ApiEnvironment> DynamicQR<'mpesa, Env>
impl<'mpesa, Env: ApiEnvironment> DynamicQR<'mpesa, Env>
sourcepub fn from_request(
client: &'mpesa Mpesa<Env>,
request: DynamicQRRequest<'mpesa>
) -> DynamicQR<'mpesa, Env>
pub fn from_request( client: &'mpesa Mpesa<Env>, request: DynamicQRRequest<'mpesa> ) -> DynamicQR<'mpesa, Env>
Build Dynamic QR
Returns a DynamicQR
which can be used to send a request
sourcepub async fn send(self) -> MpesaResult<DynamicQRResponse>
pub async fn send(self) -> MpesaResult<DynamicQRResponse>
Generate a Dynamic QR
This enables Safaricom M-PESA customers who have My Safaricom App or M-PESA app, to scan a QR (Quick Response) code, to capture till number and amount then authorize to pay for goods and services at select LIPA NA M-PESA (LNM) merchant outlets.
Response
A successful request returns a DynamicQRResponse
type
which contains the QR code
Errors
Returns a MpesaError
on failure
Trait Implementations§
source§impl<'mpesa, Env: ApiEnvironment> From<DynamicQR<'mpesa, Env>> for DynamicQRRequest<'mpesa>
impl<'mpesa, Env: ApiEnvironment> From<DynamicQR<'mpesa, Env>> for DynamicQRRequest<'mpesa>
source§fn from(express: DynamicQR<'mpesa, Env>) -> DynamicQRRequest<'mpesa>
fn from(express: DynamicQR<'mpesa, Env>) -> DynamicQRRequest<'mpesa>
Converts to this type from the input type.
Auto Trait Implementations§
impl<'mpesa, Env> !RefUnwindSafe for DynamicQR<'mpesa, Env>
impl<'mpesa, Env> !Send for DynamicQR<'mpesa, Env>
impl<'mpesa, Env> !Sync for DynamicQR<'mpesa, Env>
impl<'mpesa, Env> Unpin for DynamicQR<'mpesa, Env>
impl<'mpesa, Env> !UnwindSafe for DynamicQR<'mpesa, Env>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more