diff --git a/src/client.rs b/src/client.rs index 0e7b7c37a..65c87ee7b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -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 = Result; diff --git a/src/services/c2b_register.rs b/src/services/c2b_register.rs index 82635bcdf..fe214e7e6 100644 --- a/src/services/c2b_register.rs +++ b/src/services/c2b_register.rs @@ -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, #[serde(rename(deserialize = "OriginatorConverstionID"))] pub originator_conversation_id: String, #[serde(rename(deserialize = "ResponseCode"))] diff --git a/tests/mpesa-rust/c2b_register_test.rs b/tests/mpesa-rust/c2b_register_test.rs index 030c5fb4c..c50815455 100644 --- a/tests/mpesa-rust/c2b_register_test.rs +++ b/tests/mpesa-rust/c2b_register_test.rs @@ -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] diff --git a/tests/mpesa-rust/helpers.rs b/tests/mpesa-rust/helpers.rs index 01dfcfaf5..a6f13cf60 100644 --- a/tests/mpesa-rust/helpers.rs +++ b/tests/mpesa-rust/helpers.rs @@ -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); - } }