Loan verified
This commit is contained in:
+4
-3
@@ -334,14 +334,14 @@ def salary_verifloan2():
|
||||
data = request.json
|
||||
if not data:
|
||||
return {
|
||||
"message": "Please provide pin",
|
||||
"message": "Please provide pin, bvn and loan_application_id",
|
||||
"data": None,
|
||||
"error": "Bad request"
|
||||
}, 400
|
||||
# validate input
|
||||
bvn = data["bvn"]
|
||||
pin = data["pin"]
|
||||
loan = data["loan"]
|
||||
loan_application_id = data["loan_application_id"]
|
||||
SELECT_ACC = "SELECT id, uid,pin,bvn FROM demo_bank_accounts WHERE bvn='" + bvn + "' AND pin = '" + pin + "' "
|
||||
with connection:
|
||||
with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
|
||||
@@ -353,13 +353,14 @@ def salary_verifloan2():
|
||||
if account_found == 1 :
|
||||
return {
|
||||
"status": "1",
|
||||
"message" : "Loan Verified",
|
||||
"data": account
|
||||
}, 201
|
||||
else:
|
||||
return {
|
||||
"status": "-1",
|
||||
"data": None,
|
||||
"message" : "Invalid Pin",
|
||||
"message" : "Invalid Loan",
|
||||
"error": "1"
|
||||
}, 404
|
||||
|
||||
|
||||
Reference in New Issue
Block a user