(20241217) M-Pesa Express phone. no cleaning being handled.
This commit is contained in:
@@ -40,6 +40,7 @@ from quart import current_app
|
||||
|
||||
# My async utils:
|
||||
from utils_v2.string import json
|
||||
from utils_v2.string import regex
|
||||
from utils_v2.date_time import date_time
|
||||
from utils_v2.database.async_mysql_v2 import AsyncMySQL
|
||||
from utils_v2.database.async_mongo_v2 import AsyncMongo, AsyncMongoStorage
|
||||
@@ -216,12 +217,20 @@ class PaymentController:
|
||||
# Make the payment request:
|
||||
client_response = await client.request_payment(
|
||||
amount = payment_request.amount,
|
||||
party_a = payment_request.customerNo,
|
||||
party_a = regex.replace(
|
||||
text = payment_request.customerNo,
|
||||
pattern = r"[^0-9]",
|
||||
substitute_text = ""
|
||||
) if isinstance(payment_request.customerNo, str) else payment_request.customerNo,
|
||||
type = "CustomerPayBillOnline",
|
||||
reference = payment_request.reference,
|
||||
description = payment_request.description,
|
||||
callback_url = callback_url,
|
||||
payer_no = payment_request.payerNo,
|
||||
payer_no = regex.replace(
|
||||
text = payment_request.payerNo,
|
||||
pattern = r"[^0-9]",
|
||||
substitute_text = ""
|
||||
) if isinstance(payment_request.payerNo, str) else payment_request.payerNo,
|
||||
party_b = auth_token.auth["businessShortCode"]
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user