(20250115) Allowing internal IPs to send SMS messages.

This commit is contained in:
2025-01-15 14:00:40 +05:30
parent 3c7ce68200
commit 9e80fda596
3 changed files with 20 additions and 7 deletions
@@ -189,8 +189,9 @@ class SafaricomMPesaExpressPaymentsController(PaymentsController):
# Start by assuming failure:
result = PaymentRequestOneResult()
# Initialize the payment request by creating a placeholder record in the database:
payment_id = await self.init_payment(
# Either use the id from a separately queued payment request, or
# initialize (queue) the payment request by creating a placeholder record in the database:
payment_id = payment_request.paymentId or await self.init_payment(
mongo_data_conn = mongo_data_conn,
auth_token = auth_token,
user_info = user_info,
@@ -214,6 +215,8 @@ class SafaricomMPesaExpressPaymentsController(PaymentsController):
http_client = self._http_client
)
# # If the token was refreshed successfully,
# # store the updated value(s):
# if token_refreshed:
# auth_token.token = client_auth.model_dump()
# await self.set_token(