pub struct MpesaConfig { /* private fields */ }
Expand description
Configuration for Mpesa API
Implementations§
Source§impl MpesaConfig
impl MpesaConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a client with default [MPESA_API_URL] and default API key from the MPESA_ACCESS_TOKEN env var
Sourcepub fn with_access_token<S: Into<String>>(self, access_token: S) -> Self
pub fn with_access_token<S: Into<String>>(self, access_token: S) -> Self
To use a different API key different from the default MPESA_ACCESS_TOKEN env var
Sourcepub fn with_api_url<S: Into<String>>(self, api_url: S) -> Self
pub fn with_api_url<S: Into<String>>(self, api_url: S) -> Self
To use an API_URL different from the default [MPESA_API_URL]
pub fn with_environment(self, environment: Environment) -> Self
Trait Implementations§
Source§impl Clone for MpesaConfig
impl Clone for MpesaConfig
Source§fn clone(&self) -> MpesaConfig
fn clone(&self) -> MpesaConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Config for MpesaConfig
impl Config for MpesaConfig
Source§impl Debug for MpesaConfig
impl Debug for MpesaConfig
Auto Trait Implementations§
impl Freeze for MpesaConfig
impl RefUnwindSafe for MpesaConfig
impl Send for MpesaConfig
impl Sync for MpesaConfig
impl Unpin for MpesaConfig
impl UnwindSafe for MpesaConfig
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