- Install the requirements using pip
pip install -r requirements.txt
- Create a new file "variables.py" and create variables as mentioned below:
mobile = "ENTER PHONE NUMBER HERE"
beneficiary_id = "ENTER BENEFICIARY ID"
filename = "certificate_{}".format(beneficiary_id)
- Run "script.py"
python script.py
There are a total of four functions in thr script
- requestOTP(mobile) - returns a txnId
- confirmOTP(txnId, OTP) - At this point, the shell asks you to enter the OTP received; returns the bearer token.
- SHA_hash(OTP) - hashes the OTP with SHA256 algorithm.
- generateCertificate(token) - Generates the certificate in .pdf format in the same folder.