NOTICE: All information contained herein is, and remains
the property of TechnoCore.
The intellectual and technical concepts contained
herein are proprietary to TechnoCore and dissemination of this information or reproduction of this material
is strictly forbidden unless prior written permission is obtained
from TechnoCore.
ObjTextEasypay is a Python module designed to generate and validate EasyPay numbers, which are commonly used for bill payments in South Africa. The module provides functionality to create EasyPay numbers based on a given input number and prefix, and includes methods for validating these numbers using the Luhn algorithm.
Check method to scan and update EasyPay numbers in a database.__init__(self, db_connection: DatabaseConnection = 0, page=0)Initializes the ObjTextEasypay object.
DatabaseConnection object for database operations.Luhn(self, card_number)Validates a number using the Luhn algorithm.
EasyPay(self, number, prefix="2280")Generates an EasyPay number.
Process(self, param_1="", ...)Processes a given parameter to generate an EasyPay number.
Check(self)Scans a database for contracts, generates EasyPay numbers, and updates the corresponding records. This method is intended for administrative or batch-processing tasks.
To generate an EasyPay number from a contract ID or account number, you can use the Process method:
import ObjTextEasypay
# Initialize the object (assuming a database connection is available)
easypay_processor = ObjTextEasypay.ObjProcessText(db_connection=db)
# Generate an EasyPay number
contract_id = "299010015"
easypay_number = easypay_processor.Process(contract_id)
print(f"The EasyPay number for {contract_id} is {easypay_number}")