Skip to content

Commit

Permalink
feat: expose gen_security_credentials to public api
Browse files Browse the repository at this point in the history
  • Loading branch information
c12i committed Jan 28, 2024
1 parent 75e7eae commit 10a2097
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ impl Mpesa {
///
/// # Errors
/// Returns `EncryptionError` variant of `MpesaError`
pub(crate) fn gen_security_credentials(&self) -> MpesaResult<String> {
pub fn gen_security_credentials(&self) -> MpesaResult<String> {
let pem = self.certificate.as_bytes();
let cert = X509::from_pem(pem)?;
// getting the public and rsa keys
Expand Down
2 changes: 1 addition & 1 deletion tests/mpesa-rust/account_balance_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async fn account_balance_using_struct_initialization() {
queue_time_out_url: "https://testdomain.com/err".try_into().unwrap(),
remarks: "None",
result_url: "https://testdomain.com/ok".try_into().unwrap(),
security_credential: "dummy".to_owned()
security_credential: client.gen_security_credentials().unwrap()
};
let response = AccountBalance::from_request(&client, request).send().await.unwrap();
assert_eq!(response.originator_conversation_id, "29464-48063588-1");
Expand Down

0 comments on commit 10a2097

Please sign in to comment.