Skip to content

cleanup #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ use serde_json::Value;
use std::cell::RefCell;

/// Source: [test credentials](https://developer.safaricom.co.ke/test_credentials)
static DEFAULT_INITIATOR_PASSWORD: &str = "Safcom496!";
const DEFAULT_INITIATOR_PASSWORD: &str = "Safcom496!";
/// Get current package version from metadata
static CARGO_PACKAGE_VERSION: &str = env!("CARGO_PKG_VERSION");
const CARGO_PACKAGE_VERSION: &str = env!("CARGO_PKG_VERSION");

/// `Result` enum type alias
pub type MpesaResult<T> = Result<T, MpesaError>;
Expand Down
5 changes: 0 additions & 5 deletions src/services/c2b_register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ struct C2bRegisterPayload<'mpesa> {

#[derive(Debug, Deserialize, Clone)]
pub struct C2bRegisterResponse {
#[serde(
rename(deserialize = "ConversationID"),
skip_serializing_if = "Option::is_none"
)]
pub conversation_id: Option<String>,
#[serde(rename(deserialize = "OriginatorConverstionID"))]
pub originator_conversation_id: String,
#[serde(rename(deserialize = "ResponseCode"))]
Expand Down
1 change: 0 additions & 1 deletion tests/mpesa-rust/c2b_register_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ async fn c2b_register_success() {
"Accept the service request successfully."
);
assert_eq!(response.response_code, "0");
assert_eq!(response.conversation_id, None);
}

#[tokio::test]
Expand Down
10 changes: 0 additions & 10 deletions tests/mpesa-rust/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,4 @@ mod tests {
);
assert!(!client.is_connected().await);
}

#[tokio::test]
async fn test_client_will_not_authenticate_with_sandbox_credentials_in_production() {
let client = get_mpesa_client!(
std::env::var("CLIENT_KEY").unwrap(),
std::env::var("CLIENT_SECRET").unwrap(),
Environment::from_str("production").unwrap()
);
assert!(!client.is_connected().await);
}
}