You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the `Environment` enum implements `FromStr` and `TryFrom` for `String` and `&str` types, you can call `Environment::from_str` or `Environment::try_from` to create an `Environment` type. This is ideal if the environment values are
68
68
stored in a `.env` or any other configuration file:
69
69
70
-
```rust,no_run
70
+
```rust,ignore
71
71
use mpesa::{Mpesa, Environment};
72
72
use std::str::FromStr;
73
73
use std::convert::TryFrom;
@@ -101,7 +101,7 @@ This trait allows you to create your own type to pass to the `environment` param
101
101
102
102
See the example below (and [here](./src/environment.rs) so see how the trait is implemented for the `Environment` enum):
103
103
104
-
```rust,no_run
104
+
```rust,ignore
105
105
use mpesa::{Mpesa, ApiEnvironment};
106
106
use std::str::FromStr;
107
107
use std::convert::TryFrom;
@@ -132,7 +132,7 @@ let client: Mpesa<MyCustomEnvironment> = Mpesa::new(
132
132
If you intend to use in production, you will need to call a the `set_initiator_password` method from `Mpesa` after initially
133
133
creating the client. Here you provide your initiator password, which overrides the default password used in sandbox `"Safcom496!"`:
134
134
135
-
```rust,no_run
135
+
```rust,ignore
136
136
use mpesa::Mpesa;
137
137
138
138
let client = Mpesa::new(
@@ -152,7 +152,7 @@ The following services are currently available from the `Mpesa` client as method
0 commit comments