From 2548664c2f420995955beda9c96a9204b94dbc1f Mon Sep 17 00:00:00 2001 From: lennyaiko Date: Thu, 27 Mar 2025 12:21:05 +0100 Subject: [PATCH] done with transaction verify --- app/routes/loan.py | 23 +++++++++++++++++++++++ app/routes/repayment.py | 0 openapi.yml | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) delete mode 100644 app/routes/repayment.py diff --git a/app/routes/loan.py b/app/routes/loan.py index 28178bc..b162cb0 100644 --- a/app/routes/loan.py +++ b/app/routes/loan.py @@ -202,3 +202,26 @@ def collect_loan(): } return jsonify(response), 200 + + +@loan_bp.route("/transaction-verify", methods=["POST"]) +def transaction_verify(): + data = request.json + api_url = f"{current_app.config['API_BASE_URL']}/TransactionVerify" + + # response = requests.post(api_url, json=data, headers=get_headers()) + # return jsonify(response.json()), response.status_code + response = { + "requestId": "R02802", + "countryCode": "NGR", + "transactionId": "Tr201712RK9232P115", + "transactionType": "Disbursement", + "customerId": "CN621868", + "accountId": "2017821799", + "providedAmount": 100, + "collectedAmount": 7.5, + "resultCode": "00", + "resultDescription": "Collect Status retrieved successfully.", + } + + return jsonify(response), 200 diff --git a/app/routes/repayment.py b/app/routes/repayment.py deleted file mode 100644 index e69de29..0000000 diff --git a/openapi.yml b/openapi.yml index a616719..e533950 100644 --- a/openapi.yml +++ b/openapi.yml @@ -357,3 +357,37 @@ paths: responses: 200: description: A successful response + /loans/transaction-verify: + post: + summary: Verify a transaction + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + requestId: + type: string + example: "R02802" + countryCode: + type: string + example: "NGR" + counter: + type: string + example: "2" + transactionId: + type: string + example: "Tr201712RK9232P115" + customerId: + type: string + example: "CN621868" + accountId: + type: string + example: "2017821799" + transactionType: + type: string + example: "Disbursement" + responses: + 200: + description: A successful response