Skip to content

Commit 8a39a23

Browse files
committed
chore: Update express_request getters to return string slices
1 parent ae97107 commit 8a39a23

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mpesa"
3-
version = "0.3.3"
3+
version = "0.3.4"
44
authors = ["Collins Muriuki <[email protected]>"]
55
edition = "2018"
66
description = "A wrapper around the M-PESA API in Rust."

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ An unofficial Rust wrapper around the [Safaricom API](https://developer.safarico
2525

2626
```md
2727
[dependencies]
28-
mpesa = "0.3.3"
28+
mpesa = "0.3.4"
2929
```
3030

3131
In your lib or binary crate:
@@ -45,7 +45,7 @@ read the docs [here](https://developer.safaricom.co.ke/docs?javascript#going-liv
4545

4646
_NOTE_:
4747

48-
- Only calling `unwrap` for demonstration purposes. Errors are handled appropriately in the lib via the `MpesaError` enum.
48+
- Only calling `unwrap` for demonstration purposes. Errors are handled appropriately in the lib via the `MpesaError` enum.
4949

5050
These are the following ways you can instantiate `Mpesa`:
5151

@@ -99,7 +99,7 @@ assert!(client.is_connected())
9999

100100
The following services are currently available from the `Mpesa` client as methods that return builders:
101101

102-
- B2C
102+
- B2C
103103

104104
```rust
105105
let response = client
@@ -113,7 +113,7 @@ let response = client
113113
assert!(response.is_ok())
114114
```
115115

116-
- B2B
116+
- B2B
117117

118118
```rust
119119
let response = client
@@ -128,7 +128,7 @@ let response = client
128128
assert!(response.is_ok())
129129
```
130130

131-
- C2B Register
131+
- C2B Register
132132

133133
```rust
134134
let response = client
@@ -140,7 +140,7 @@ let response = client
140140
assert!(response.is_ok())
141141
```
142142

143-
- C2B Simulate
143+
- C2B Simulate
144144

145145
```rust
146146

@@ -153,7 +153,7 @@ let response = client
153153
assert!(response.is_ok())
154154
```
155155

156-
- Account Balance
156+
- Account Balance
157157

158158
```rust
159159
let response = client
@@ -165,7 +165,7 @@ let response = client
165165
assert!(response.is_ok())
166166
```
167167

168-
- Mpesa Express Request / STK push / Lipa na M-PESA online
168+
- Mpesa Express Request / STK push / Lipa na M-PESA online
169169

170170
```rust
171171
let response = client
@@ -185,8 +185,8 @@ More will be added progressively, pull requests welcome
185185

186186
**Collins Muriuki**
187187

188-
- Twitter: [@collinsmuriuki\_](https://twitter.com/collinsmuriuki_)
189-
- Not affiliated with Safaricom.
188+
- Twitter: [@collinsmuriuki\_](https://twitter.com/collinsmuriuki_)
189+
- Not affiliated with Safaricom.
190190

191191
## Contributing
192192

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//!
88
//! ```md
99
//! [dependencies]
10-
//! mpesa = "0.3.0"
10+
//! mpesa = "0.3.4"
1111
//! ```
1212
//!
1313
//! In your lib or binary crate:

src/services/express_request.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ pub struct MpesaExpressRequestResponse {
3232

3333
#[allow(dead_code)]
3434
impl<'a> MpesaExpressRequestResponse {
35-
pub fn checkout_request_id(&'a self) -> &'a String {
35+
pub fn checkout_request_id(&'a self) -> &'a str {
3636
&self.CheckoutRequestID
3737
}
3838

39-
pub fn customer_message(&'a self) -> &'a String {
39+
pub fn customer_message(&'a self) -> &'a str {
4040
&self.CustomerMessage
4141
}
4242

43-
pub fn merchant_request_id(&'a self) -> &'a String {
43+
pub fn merchant_request_id(&'a self) -> &'a str {
4444
&self.MerchantRequestID
4545
}
4646

47-
pub fn response_code(&'a self) -> &'a String {
47+
pub fn response_code(&'a self) -> &'a str {
4848
&self.ResponseDescription
4949
}
5050
}

0 commit comments

Comments
 (0)