(20241213) Started accepting payment gateway auth details.

This commit is contained in:
2024-12-13 20:41:45 +05:30
parent 40cd59dd28
commit 3a03dd4a61
4 changed files with 39 additions and 34 deletions
+13 -13
View File
@@ -75,25 +75,25 @@ REGEX_SESSION_TOKEN = r"^[a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[89ab][a-f0-9]
# *****************************************************************************************************************
class TheCAOfficeAIAuth(BaseModel):
class SafaricomMPesaExpressAuth(BaseModel):
authorizeSoftware: bool = Field(
description = "god knows; don't ask",
consumerKey: str = Field(
description = "the app's consumer key given by safaricom; found in 'my apps'",
frozen = True
)
authorizeMailMessaging: bool = Field(
description = "god knows; don't ask",
consumerSecret: str = Field(
description = "the app's consumer secret given by safaricom; found in 'my apps'",
frozen = True
)
authorizeCompliancePortal: bool = Field(
description = "god knows; don't ask",
businessShortCode: str = Field(
description = "your app's business short code; found in 'my apps'",
frozen = True
)
authorizeFinancialInstitution: bool = Field(
description = "god knows; don't ask",
appPasskey: str = Field(
description = "your app's passkey; taken from human representative",
frozen = True
)
@@ -109,7 +109,7 @@ class TheCAOfficeAIAuth(BaseModel):
# ---------------------------------------------------------------------------------------------------------------------
class SoftwareAuthRequestHeaders(BaseModel):
class PGAuthRequestHeaders(BaseModel):
sessionToken: str = Field(
description = "the session token of the user who is requesting the service",
@@ -133,10 +133,10 @@ class SoftwareAuthRequestHeaders(BaseModel):
# ---------------------------------------------------------------------------------------------------------------------
class SoftwareAuthRequestData(BaseModel):
class PGAuthRequestData(BaseModel):
softwareClient: Literal["theCaOfficeAi"] = Field(alias = "client")
auth: Union[TheCAOfficeAIAuth]
client: Literal["safaricomMPesaExpress"] = Field(alias = "client")
auth: Union[SafaricomMPesaExpressAuth]
# ┏┓ ┏•
# ┃ ┏┓┏┓╋┓┏┓
+2 -2
View File
@@ -89,7 +89,7 @@ class CoreAuthTokenModel(BaseModel):
alias = "_id"
)
serviceType: Literal["software", "email", "sms", "chat"] = Field(
serviceType: Literal["software", "email", "sms", "chat", "paymentGateway"] = Field(
description = "the kind of service this message was sent/received from",
frozen = True
)
@@ -99,7 +99,7 @@ class CoreAuthTokenModel(BaseModel):
"telegram", "whatsapp", # .................. Chat Clients
"nimbusSmsIndia", "savvyBulkSmsKenya", # ... SMS Clients
"razorpay", "safaricomMPesaExpress", # ..... Payment Gateways
"theCaOfficeAi" # .......................... God knows, don't ask.
"theCaOfficeAi" # .......................... Software
] = Field(
description = "the third-part client that was used",
frozen = True