@@ -28,7 +28,6 @@ def __init__(self, http_client: HttpClient, token_manager: TokenManager) -> None
2828 def push (
2929 self ,
3030 business_short_code : int ,
31- passkey : str ,
3231 transaction_type : str ,
3332 amount : float ,
3433 party_a : str ,
@@ -37,13 +36,15 @@ def push(
3736 callback_url : str ,
3837 account_reference : str ,
3938 transaction_desc : str ,
39+ passkey : str | None = None ,
40+ timestamp : str | None = None ,
41+ password : str | None = None ,
4042 ** kwargs ,
4143 ) -> StkPushSimulateResponse :
4244 """Initiate an M-Pesa STK Push transaction.
4345
4446 Args:
4547 business_short_code: M-Pesa business shortcode.
46- passkey: M-Pesa passkey.
4748 transaction_type: Transaction type (e.g., 'CustomerPayBillOnline').
4849 amount: Transaction amount.
4950 party_a: MSISDN sending the funds.
@@ -52,14 +53,16 @@ def push(
5253 callback_url: URL for receiving the callback.
5354 account_reference: Reference for the transaction.
5455 transaction_desc: Description of the transaction.
56+ passkey: M-Pesa passkey.
57+ timestamp: Timestamp for the transaction.
58+ password: Password for the transaction.
5559 **kwargs: Additional fields for StkPushSimulateRequest.
5660
5761 Returns:
5862 StkPushSimulateResponse: Response from M-Pesa API.
5963 """
6064 request = StkPushSimulateRequest (
6165 BusinessShortCode = business_short_code ,
62- Passkey = passkey ,
6366 TransactionType = transaction_type ,
6467 Amount = amount ,
6568 PartyA = party_a ,
@@ -68,6 +71,9 @@ def push(
6871 CallBackURL = callback_url ,
6972 AccountReference = account_reference ,
7073 TransactionDesc = transaction_desc ,
74+ Passkey = passkey ,
75+ Timestamp = timestamp ,
76+ Password = password ,
7177 ** {
7278 k : v
7379 for k , v in kwargs .items ()
0 commit comments