made changes on the api to match bank api
This commit was merged in pull request #6.
This commit is contained in:
+4
-9
@@ -13,25 +13,20 @@ def create_app():
|
||||
# Load configuration
|
||||
app.config.from_object(Config)
|
||||
|
||||
|
||||
CORS(app)
|
||||
CORS(app)
|
||||
|
||||
# Swagger Doc
|
||||
SWAGGER_URL = app.config.get("SWAGGER_URL")
|
||||
API_URL = app.config.get("API_URL")
|
||||
|
||||
|
||||
# Register blueprints
|
||||
app.register_blueprint(api)
|
||||
# Register blueprints with /api prefix for the main API routes
|
||||
app.register_blueprint(api, url_prefix='/api')
|
||||
|
||||
swagger_ui_blueprint = get_swaggerui_blueprint(SWAGGER_URL, API_URL)
|
||||
app.register_blueprint(swagger_ui_blueprint, url_prefix=SWAGGER_URL)
|
||||
|
||||
|
||||
|
||||
# Error Handlers
|
||||
register_error_handlers(app)
|
||||
|
||||
|
||||
|
||||
|
||||
return app
|
||||
|
||||
+43
-24
@@ -40,14 +40,17 @@ def serve_paths(filename):
|
||||
return send_from_directory(swagger_dir, filename)
|
||||
|
||||
# RACCheck Endpoint
|
||||
@api.route('/RACCheck', methods=['POST'])
|
||||
@api.route('/rac-check', methods=['POST'])
|
||||
@require_api_key
|
||||
@require_app_id
|
||||
def rac_check():
|
||||
data = request.get_json()
|
||||
# logger.info(f"RACCheck request received: {data}")
|
||||
response = RACCheckService.process_request(data)
|
||||
return response
|
||||
try:
|
||||
data = request.get_json()
|
||||
response = RACCheckService.process_request(data)
|
||||
return response
|
||||
except Exception as e:
|
||||
logger.exception("Unhandled exception in /RACCheck route")
|
||||
return jsonify({"message": "Unhandled server error"}), 500
|
||||
|
||||
# CompleteRACcheck Endpoint
|
||||
@api.route('/CompleteRACcheck', methods=['POST'])
|
||||
@@ -60,45 +63,61 @@ def complete_rac_check():
|
||||
return response
|
||||
|
||||
# Disbursement Endpoint
|
||||
@api.route('/Disbursement', methods=['POST'])
|
||||
@api.route('/DisburseLoan', methods=['POST'])
|
||||
@require_api_key
|
||||
@require_app_id
|
||||
def disbursement():
|
||||
|
||||
data = request.get_json()
|
||||
# logger.info(f"Disbursement request received: {data}")
|
||||
response = DisbursementService.process_request(data)
|
||||
return response
|
||||
try:
|
||||
data = request.get_json()
|
||||
# logger.info(f"Disbursement request received: {data}")
|
||||
response = DisbursementService.process_request(data)
|
||||
return response
|
||||
except Exception as e:
|
||||
logger.exception("Unhandled exception in /Disbursement route")
|
||||
return jsonify({"message": "Unhandled server error"}), 500
|
||||
|
||||
# CollectLoan Endpoint
|
||||
@api.route('/CollectLoan', methods=['POST'])
|
||||
@require_api_key
|
||||
@require_app_id
|
||||
def collect_loan():
|
||||
data = request.get_json()
|
||||
# logger.info(f"CollectLoan request received: {data}")
|
||||
response = CollectLoanService.process_request(data)
|
||||
return response
|
||||
try:
|
||||
data = request.get_json()
|
||||
# logger.info(f"CollectLoan request received: {data}")
|
||||
response = CollectLoanService.process_request(data)
|
||||
return response
|
||||
except Exception as e:
|
||||
logger.exception("Unhandled exception in /CollectLoan route")
|
||||
return jsonify({"message": "Unhandled server error"}), 500
|
||||
|
||||
# TransactionVerify Endpoint
|
||||
@api.route('/TransactionVerify', methods=['POST'])
|
||||
@require_api_key
|
||||
@require_app_id
|
||||
def transaction_verify():
|
||||
data = request.get_json()
|
||||
# logger.info(f"TransactionVerify request received: {data}")
|
||||
response = TransactionVerifyService.process_request(data)
|
||||
return response
|
||||
try:
|
||||
data = request.get_json()
|
||||
# logger.info(f"TransactionVerify request received: {data}")
|
||||
response = TransactionVerifyService.process_request(data)
|
||||
return response
|
||||
except Exception as e:
|
||||
logger.exception("Unhandled exception in /TransactionVerify route")
|
||||
return jsonify({"message": "Unhandled server error"}), 500
|
||||
|
||||
# PenalCharge Endpoint
|
||||
@api.route('/PenalCharge', methods=['POST'])
|
||||
@api.route('/CollectPenalFee', methods=['POST'])
|
||||
@require_api_key
|
||||
@require_app_id
|
||||
def penal_charge():
|
||||
data = request.get_json()
|
||||
# logger.info(f"PenalCharge request received: {data}")
|
||||
response = PenalChargeService.process_request(data)
|
||||
return response
|
||||
try:
|
||||
data = request.get_json()
|
||||
# logger.info(f"PenalCharge request received: {data}")
|
||||
response = PenalChargeService.process_request(data)
|
||||
return response
|
||||
except Exception as e:
|
||||
logger.exception("Unhandled exception in /PenalCharge route")
|
||||
return jsonify({"message": "Unhandled server error"}), 500
|
||||
|
||||
|
||||
# RevokeEnableConsent Endpoint
|
||||
@api.route('/RevokeEnableConsent', methods=['POST'])
|
||||
|
||||
@@ -1,16 +1,30 @@
|
||||
from marshmallow import Schema, fields
|
||||
|
||||
# Collect Loan Schema
|
||||
class CollectLoanSchema(Schema):
|
||||
transactionId = fields.Str(required=True)
|
||||
fbnTransactionId = fields.Str(required=True)
|
||||
debtId = fields.Str(required=True)
|
||||
customerId = fields.Str(required=True)
|
||||
accountId = fields.Str(required=True)
|
||||
productId = fields.Str(required=True)
|
||||
collectAmount = fields.Float(required=True)
|
||||
penalCharge = fields.Float(required=False) # Optional
|
||||
collectionMethod = fields.Int(required=True)
|
||||
lienAmount = fields.Float(required=True)
|
||||
countryId = fields.Str(required=True)
|
||||
comment = fields.Str(required=False) # Optional
|
||||
channel = fields.Str(allow_none=True)
|
||||
transactionId = fields.Str(allow_none=True)
|
||||
fbnTransactionId = fields.Str(allow_none=True)
|
||||
debtId = fields.Str(allow_none=True)
|
||||
accountId = fields.Str(allow_none=True)
|
||||
customerId = fields.Str(allow_none=True)
|
||||
productId = fields.Str(allow_none=True)
|
||||
collectAmount = fields.Float(required=True)
|
||||
penalCharge = fields.Float(required=True)
|
||||
collectionMethod = fields.Str(allow_none=True)
|
||||
lienAmount = fields.Float(required=True)
|
||||
countryId = fields.Str(allow_none=True)
|
||||
comment = fields.Str(allow_none=True)
|
||||
|
||||
class CollectLoanResponseSchema(Schema):
|
||||
responseCode = fields.Str(allow_none=True)
|
||||
responseDescr = fields.Str(allow_none=True)
|
||||
fullDescription = fields.Str(allow_none=True)
|
||||
transactionId = fields.Str(allow_none=True)
|
||||
debtId = fields.Str(allow_none=True)
|
||||
customerId = fields.Str(allow_none=True)
|
||||
accountId = fields.Str(allow_none=True)
|
||||
productId = fields.Str(allow_none=True)
|
||||
amountCollected = fields.Float(required=True)
|
||||
countryId = fields.Str(allow_none=True)
|
||||
comment = fields.Str(allow_none=True)
|
||||
responseMessage = fields.Str(allow_none=True)
|
||||
|
||||
@@ -1,17 +1,35 @@
|
||||
from marshmallow import Schema, fields
|
||||
|
||||
# Disbursement Schema
|
||||
class DisbursementSchema(Schema):
|
||||
requestId = fields.Str(required=True)
|
||||
debtId = fields.Str(required=True)
|
||||
transactionId = fields.Str(required=True)
|
||||
customerId = fields.Str(required=True)
|
||||
accountId = fields.Str(required=True)
|
||||
productId = fields.Str(required=True)
|
||||
transactionId = fields.Str(required=False, allow_none=True)
|
||||
fbnTransactionId = fields.Str(required=False, allow_none=True)
|
||||
debtId = fields.Str(required=False, allow_none=True)
|
||||
customerId = fields.Str(required=False, allow_none=True)
|
||||
accountId = fields.Str(required=False, allow_none=True)
|
||||
productId = fields.Str(required=False, allow_none=True)
|
||||
provideAmount = fields.Float(required=True)
|
||||
collectAmountInterest = fields.Float(required=False) # Optional
|
||||
collectAmountInterest = fields.Float(required=True)
|
||||
collectAmountMgtFee = fields.Float(required=True)
|
||||
collectAmountInsurance = fields.Float(required=True)
|
||||
collectAmountVAT = fields.Float(required=True)
|
||||
countryId = fields.Str(required=True)
|
||||
comment = fields.Str(required=False) # Optional
|
||||
countryId = fields.Str(required=False, allow_none=True)
|
||||
comment = fields.Str(required=False, allow_none=True)
|
||||
|
||||
|
||||
class DisburseLoanResponseSchema(Schema):
|
||||
transactionId = fields.Str(allow_none=True)
|
||||
fbnTransactionId = fields.Str(allow_none=True)
|
||||
debtId = fields.Str(allow_none=True)
|
||||
customerId = fields.Str(allow_none=True)
|
||||
accountId = fields.Str(allow_none=True)
|
||||
productId = fields.Str(allow_none=True)
|
||||
provideAmount = fields.Float(required=True)
|
||||
collectAmountInterest = fields.Float(required=True)
|
||||
collectAmountMgtFee = fields.Float(required=True)
|
||||
collectAmountInsurance = fields.Float(required=True)
|
||||
collectAmountVAT = fields.Float(required=True)
|
||||
countryId = fields.Str(allow_none=True)
|
||||
responseCode = fields.Str(allow_none=True)
|
||||
responseMessage = fields.Str(allow_none=True)
|
||||
|
||||
|
||||
@@ -1,14 +1,25 @@
|
||||
from marshmallow import Schema, fields
|
||||
|
||||
|
||||
# Penal Charge Schema
|
||||
# This file contains the schema for penal charge operations
|
||||
class PenalChargeSchema(Schema):
|
||||
transactionId = fields.Str(required=True)
|
||||
fbnTransactionId = fields.Str(required=True)
|
||||
debtId = fields.Str(required=True)
|
||||
customerId = fields.Str(required=True)
|
||||
accountId = fields.Str(required=True)
|
||||
penalCharge = fields.Decimal(required=True)
|
||||
lienAmount = fields.Decimal(required=True)
|
||||
countryId = fields.Str(required=True)
|
||||
comment = fields.Str(required=False)
|
||||
channel = fields.Str(allow_none=True)
|
||||
transactionId = fields.Str(allow_none=True)
|
||||
fbnTransactionId = fields.Str(allow_none=True)
|
||||
debtId = fields.Str(allow_none=True)
|
||||
accountId = fields.Str(allow_none=True)
|
||||
penalCharge = fields.Float(required=True)
|
||||
customerId = fields.Str(allow_none=True)
|
||||
lienAmount = fields.Float(required=True)
|
||||
comment = fields.Str(allow_none=True)
|
||||
countryId = fields.Str(allow_none=True)
|
||||
|
||||
#represents the response schema for penal charge
|
||||
class CollectPenalFeeResponseSchema(Schema):
|
||||
customerId = fields.Str(allow_none=True)
|
||||
transactionId = fields.Str(allow_none=True)
|
||||
amountCollected = fields.Float(required=True)
|
||||
accountId = fields.Str(allow_none=True)
|
||||
responseCode = fields.Str(allow_none=True)
|
||||
responseMessage = fields.Str(allow_none=True)
|
||||
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
from marshmallow import Schema, fields
|
||||
|
||||
class RACItemSchema(Schema):
|
||||
salaryAccount = fields.Bool(required=True)
|
||||
bvn = fields.Str(required=True)
|
||||
crc = fields.Bool(required=True)
|
||||
crms = fields.Bool(required=True)
|
||||
accountStatus = fields.Str(required=True)
|
||||
lien = fields.Bool(required=True)
|
||||
hasSalaryAccount = fields.Bool(required=True)
|
||||
bvnValidated = fields.Bool(required=True)
|
||||
creditBureauCheck = fields.Bool(required=True)
|
||||
crmsCheck = fields.Bool(required=True)
|
||||
accountStatus = fields.Bool(required=True)
|
||||
hasLien = fields.Bool(required=True)
|
||||
noBouncedCheck = fields.Bool(required=True)
|
||||
existingLoan = fields.Bool(required=True)
|
||||
whitelist = fields.Bool(required=True)
|
||||
noPastDueSalaryLoan = fields.Bool(required=True)
|
||||
noPastDueOtherLoans = fields.Bool(required=True)
|
||||
|
||||
isWhitelisted = fields.Bool(required=True)
|
||||
hasPastDueLoan = fields.Bool(required=True)
|
||||
|
||||
# RAC Check Schema
|
||||
class RACCheckSchema(Schema):
|
||||
@@ -20,4 +17,12 @@ class RACCheckSchema(Schema):
|
||||
fbnTransactionId = fields.Str(required=True)
|
||||
customerId = fields.Str(required=True)
|
||||
accountId = fields.Str(required=True)
|
||||
RAC_Array = fields.List(fields.Nested(RACItemSchema), required=True)
|
||||
channel = fields.Str(required=True)
|
||||
countryCode = fields.Str(required=True)
|
||||
|
||||
|
||||
class RACCheckResponseSchema(Schema):
|
||||
transactionId = fields.Str(required=True)
|
||||
customerId = fields.Str(required=True)
|
||||
accountId = fields.Str(required=True)
|
||||
racResponse = fields.Nested(RACItemSchema, required=True)
|
||||
@@ -1,12 +1,21 @@
|
||||
from marshmallow import Schema, fields
|
||||
|
||||
|
||||
# Transaction Verify Schema
|
||||
class TransactionVerifySchema(Schema):
|
||||
counter = fields.Str(required=True)
|
||||
transactionId = fields.Str(required=True)
|
||||
requestID = fields.Str(required=True)
|
||||
customerId = fields.Str(required=True)
|
||||
accountId = fields.Str(required=True)
|
||||
countryId = fields.Str(required=True) # Static value “01”
|
||||
transactionType = fields.Str(required=True)
|
||||
channel = fields.Str(allow_none=True)
|
||||
accountId = fields.Str(allow_none=True)
|
||||
customerId = fields.Str(allow_none=True)
|
||||
transactionId = fields.Str(allow_none=True)
|
||||
transactionType = fields.Str(allow_none=True)
|
||||
countryId = fields.Str(allow_none=True)
|
||||
requestId = fields.Str(allow_none=True)
|
||||
|
||||
class TransactionVerifyResponseSchema(Schema):
|
||||
responseCode = fields.Str(allow_none=True)
|
||||
responseDescr = fields.Str(allow_none=True)
|
||||
fullDescription = fields.Str(allow_none=True)
|
||||
customerId = fields.Str(allow_none=True)
|
||||
accountId = fields.Str(allow_none=True)
|
||||
providedAmount = fields.Float(required=True)
|
||||
collectedAmount = fields.Float(required=True)
|
||||
transactionId = fields.Str(allow_none=True)
|
||||
transactionType = fields.Str(allow_none=True)
|
||||
@@ -2,7 +2,7 @@ from flask import request, jsonify
|
||||
from marshmallow import ValidationError
|
||||
from app.utils.logger import logger
|
||||
from app.api.helpers.response_helper import ResponseHelper
|
||||
from app.api.schemas.collect_loan import CollectLoanSchema
|
||||
from app.api.schemas.collect_loan import CollectLoanSchema, CollectLoanResponseSchema
|
||||
|
||||
class CollectLoanService:
|
||||
@staticmethod
|
||||
@@ -14,7 +14,7 @@ class CollectLoanService:
|
||||
data (dict): The request data.
|
||||
|
||||
Returns:
|
||||
dict: A standardized response.
|
||||
tuple: JSON response and status code.
|
||||
"""
|
||||
try:
|
||||
logger.info("Processing CollectLoan request")
|
||||
@@ -25,35 +25,33 @@ class CollectLoanService:
|
||||
|
||||
# Simulated processing logic
|
||||
response_data = {
|
||||
"transactionId": "T002",
|
||||
"debtId": "273194670",
|
||||
"customerId": "CN621868",
|
||||
"accountId": "2017821799",
|
||||
"productId": "101",
|
||||
"collectAmount": 60000.00,
|
||||
"penalCharge": 0,
|
||||
"lienAmount": 20000,
|
||||
"countryId": "01",
|
||||
"comment": "Testing CollectionLoanRequest",
|
||||
"resultCode": "00",
|
||||
"resultDescription": "Loan Collection Successful"
|
||||
"transactionId": validated_data.get("transactionId", "T002"),
|
||||
"debtId": validated_data.get("debtId", "273194670"),
|
||||
"customerId": validated_data.get("customerId", "CN621868"),
|
||||
"accountId": validated_data.get("accountId", "2017821799"),
|
||||
"productId": validated_data.get("productId", "101"),
|
||||
"amountCollected": validated_data.get("collectAmount", 60000.00),
|
||||
"countryId": validated_data.get("countryId", "01"),
|
||||
"comment": validated_data.get("comment", "Testing CollectionLoanRequest"),
|
||||
"responseCode": "00",
|
||||
"responseDescr": "Loan Collection Successful",
|
||||
"fullDescription": "Loan collection completed successfully",
|
||||
"responseMessage": "Loan collection completed successfully"
|
||||
}
|
||||
|
||||
# Validate and serialize the response data
|
||||
response_schema = CollectLoanResponseSchema()
|
||||
result = response_schema.dump(response_data)
|
||||
|
||||
# return ResponseHelper.success(
|
||||
# data=response_data,
|
||||
# message="Loan collection completed successfully"
|
||||
# )
|
||||
|
||||
return response_data
|
||||
return jsonify(result), 200
|
||||
|
||||
except ValidationError as err:
|
||||
logger.error(f"Validation Error: {err.messages}")
|
||||
return jsonify({
|
||||
"message": "Validation exception"
|
||||
"message": "Validation exception",
|
||||
"errors": err.messages
|
||||
}) , 422
|
||||
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"An error occurred: {str(e)}", exc_info=True)
|
||||
return jsonify({
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
from flask import request, jsonify
|
||||
from marshmallow import ValidationError
|
||||
from app.utils.logger import logger
|
||||
from app.api.helpers.response_helper import ResponseHelper
|
||||
from app.api.schemas.disbursement import DisbursementSchema
|
||||
from app.api.schemas.disbursement import DisbursementSchema, DisburseLoanResponseSchema
|
||||
|
||||
class DisbursementService:
|
||||
@staticmethod
|
||||
@@ -14,7 +13,7 @@ class DisbursementService:
|
||||
data (dict): The request data.
|
||||
|
||||
Returns:
|
||||
dict: A standardized response.
|
||||
tuple: JSON response and HTTP status code.
|
||||
"""
|
||||
try:
|
||||
logger.info("Processing Disbursement request")
|
||||
@@ -23,40 +22,40 @@ class DisbursementService:
|
||||
schema = DisbursementSchema()
|
||||
validated_data = schema.load(data) # Raises ValidationError if invalid
|
||||
|
||||
# Simulated processing logic
|
||||
|
||||
# For demo purposes, we simulate a response using the validated data
|
||||
response_data = {
|
||||
"transactionId": "T001",
|
||||
"TransactionId": "Tr201712RK9232P115",
|
||||
"debtId": "273194670",
|
||||
"customerId": "CN621868",
|
||||
"accountId": "2017821799",
|
||||
"productId": "101",
|
||||
"provideAmount": 100000.0,
|
||||
"collectAmountInterest": 5000,
|
||||
"collectAmountMgtFee": 1000,
|
||||
"collectAmountInsurance": 1000,
|
||||
"collectAmountVAT": 75,
|
||||
"countryId": "01",
|
||||
"resultCode": "00",
|
||||
"resultDescription": "Loan Request Completed Successfully!"
|
||||
"transactionId": validated_data.get("transactionId"),
|
||||
"fbnTransactionId": "Tr201712RK9232P115", # Example or generated value
|
||||
"debtId": validated_data.get("debtId"),
|
||||
"customerId": validated_data.get("customerId"),
|
||||
"accountId": validated_data.get("accountId"),
|
||||
"productId": validated_data.get("productId"),
|
||||
"provideAmount": validated_data.get("provideAmount"),
|
||||
"collectAmountInterest": validated_data.get("collectAmountInterest"),
|
||||
"collectAmountMgtFee": validated_data.get("collectAmountMgtFee"),
|
||||
"collectAmountInsurance": validated_data.get("collectAmountInsurance"),
|
||||
"collectAmountVAT": validated_data.get("collectAmountVAT"),
|
||||
"countryId": validated_data.get("countryId"),
|
||||
"responseCode": "00", # success code example
|
||||
"responseMessage": "Loan Request Completed Successfully!"
|
||||
}
|
||||
|
||||
# Serialize response
|
||||
response_schema = DisburseLoanResponseSchema()
|
||||
result = response_schema.dump(response_data)
|
||||
|
||||
# return ResponseHelper.success(
|
||||
# data=response_data,
|
||||
# message="Disbursement completed successfully"
|
||||
# )
|
||||
|
||||
return response_data
|
||||
return jsonify(result), 200
|
||||
|
||||
except ValidationError as err:
|
||||
logger.error(f"Validation Error: {err.messages}")
|
||||
return jsonify({
|
||||
"message": "Validation exception"
|
||||
}) , 422
|
||||
"message": "Validation exception",
|
||||
"errors": err.messages
|
||||
}), 422
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"An error occurred: {str(e)}", exc_info=True)
|
||||
return jsonify({
|
||||
"message": "Internal Server Error"
|
||||
}) , 500
|
||||
}), 500
|
||||
|
||||
@@ -2,7 +2,7 @@ from flask import request, jsonify
|
||||
from marshmallow import ValidationError
|
||||
from app.utils.logger import logger
|
||||
from app.api.helpers.response_helper import ResponseHelper
|
||||
from app.api.schemas.penal_charge import PenalChargeSchema
|
||||
from app.api.schemas.penal_charge import PenalChargeSchema, CollectPenalFeeResponseSchema
|
||||
|
||||
|
||||
class PenalChargeService:
|
||||
@@ -22,30 +22,33 @@ class PenalChargeService:
|
||||
|
||||
# Validate input data using PenalChargeSchema
|
||||
schema = PenalChargeSchema()
|
||||
validated_data = schema.load(data) # Raises ValidationError if invalid
|
||||
validated_data = schema.load(data)
|
||||
|
||||
# Simulated processing logic
|
||||
response_data = {
|
||||
"resultCode": "00",
|
||||
"resultDescription": "Penal charge debited successfully"
|
||||
"customerId": validated_data.get("customerId"),
|
||||
"transactionId": validated_data.get("transactionId"),
|
||||
"amountCollected": validated_data.get("penalCharge", 0.0),
|
||||
"accountId": validated_data.get("accountId"),
|
||||
"responseCode": "00",
|
||||
"responseMessage": "Penal charge debited successfully"
|
||||
}
|
||||
|
||||
# Optionally validate/serialize response using schema
|
||||
response_schema = CollectPenalFeeResponseSchema()
|
||||
result = response_schema.dump(response_data)
|
||||
|
||||
# return ResponseHelper.success(
|
||||
# data=response_data,
|
||||
# message="Penal charge applied successfully"
|
||||
# )
|
||||
|
||||
return response_data
|
||||
return result
|
||||
|
||||
except ValidationError as err:
|
||||
logger.error(f"Validation Error: {err.messages}")
|
||||
return jsonify({
|
||||
"message": "Validation exception"
|
||||
}) , 422
|
||||
"message": "Validation exception",
|
||||
"errors": err.messages
|
||||
}), 422
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"An error occurred: {str(e)}", exc_info=True)
|
||||
return jsonify({
|
||||
"message": "Internal Server Error"
|
||||
}) , 500
|
||||
}), 500
|
||||
|
||||
@@ -2,7 +2,7 @@ from flask import request, jsonify
|
||||
from marshmallow import ValidationError
|
||||
from app.utils.logger import logger
|
||||
from app.api.helpers.response_helper import ResponseHelper
|
||||
from app.api.schemas.rac_check import RACCheckSchema
|
||||
from app.api.schemas.rac_check import RACCheckSchema, RACCheckResponseSchema
|
||||
|
||||
class RACCheckService:
|
||||
@staticmethod
|
||||
@@ -14,50 +14,49 @@ class RACCheckService:
|
||||
data (dict): The request data.
|
||||
|
||||
Returns:
|
||||
dict: A standardized response.
|
||||
tuple: JSON response and status code.
|
||||
"""
|
||||
try:
|
||||
logger.info("Processing RACCheck request")
|
||||
|
||||
# Validate input data using RACCheckSchema
|
||||
# Validate input data
|
||||
schema = RACCheckSchema()
|
||||
validated_data = schema.load(data) # Raises ValidationError if invalid
|
||||
validated_data = schema.load(data)
|
||||
|
||||
# Simulated processing logic
|
||||
response_data = {
|
||||
"resultCode": "00",
|
||||
"RACResponse": {
|
||||
"SalaryAccount": "1",
|
||||
"BVN": "1",
|
||||
"BVNAttachedToAccount": "1",
|
||||
"CRMS": "1",
|
||||
"CRC": "1",
|
||||
"AccountStatus": "1",
|
||||
"Lien": "1",
|
||||
"NoBouncedCheck": "1",
|
||||
"Whitelist": "1",
|
||||
"NoPastDueSalaryLoan": "1",
|
||||
"NoPastDueOtherLoan": "1"
|
||||
},
|
||||
"resultDescription": "RAC Check Successful"
|
||||
# Simulated RAC check logic — create racResponse manually or via logic
|
||||
rac_response = {
|
||||
"hasSalaryAccount": True,
|
||||
"bvnValidated": True,
|
||||
"creditBureauCheck": False,
|
||||
"crmsCheck": True,
|
||||
"accountStatus": True,
|
||||
"hasLien": False,
|
||||
"noBouncedCheck": True,
|
||||
"isWhitelisted": True,
|
||||
"hasPastDueLoan": False
|
||||
}
|
||||
|
||||
full_response = {
|
||||
"transactionId": validated_data["transactionId"],
|
||||
"customerId": validated_data["customerId"],
|
||||
"accountId": validated_data["accountId"],
|
||||
"racResponse": rac_response
|
||||
}
|
||||
|
||||
# return ResponseHelper.success(
|
||||
# data=response_data,
|
||||
# message="RAC check completed successfully"
|
||||
# )
|
||||
response_schema = RACCheckResponseSchema()
|
||||
result = response_schema.dump(full_response)
|
||||
|
||||
return response_data
|
||||
return jsonify(result), 200
|
||||
|
||||
except ValidationError as err:
|
||||
logger.error(f"Validation Error: {err.messages}")
|
||||
return jsonify({
|
||||
"message": "Validation exception"
|
||||
}) , 422
|
||||
"message": "Validation exception",
|
||||
"errors": err.messages
|
||||
}), 422
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"An error occurred: {str(e)}", exc_info=True)
|
||||
return jsonify({
|
||||
"message": "Internal Server Error"
|
||||
}) , 500
|
||||
}), 500
|
||||
|
||||
@@ -2,7 +2,10 @@ from flask import request, jsonify
|
||||
from marshmallow import ValidationError
|
||||
from app.utils.logger import logger
|
||||
from app.api.helpers.response_helper import ResponseHelper
|
||||
from app.api.schemas.transaction_verify import TransactionVerifySchema
|
||||
from app.api.schemas.transaction_verify import (
|
||||
TransactionVerifySchema,
|
||||
TransactionVerifyResponseSchema
|
||||
)
|
||||
|
||||
|
||||
class TransactionVerifyService:
|
||||
@@ -26,32 +29,32 @@ class TransactionVerifyService:
|
||||
|
||||
# Simulated processing logic
|
||||
response_data = {
|
||||
"type": "TransactionCheckResponse",
|
||||
"nativeId": "FBN20191031104405CN621868",
|
||||
"customerId": "CN621868",
|
||||
"accountId": "2017821799",
|
||||
"responseCode": "00",
|
||||
"responseDescr": "Success",
|
||||
"fullDescription": "Collect Status retrieved successfully.",
|
||||
"customerId": validated_data.get("customerId"),
|
||||
"accountId": validated_data.get("accountId"),
|
||||
"providedAmount": 0.0,
|
||||
"collectedAmount": 7.50,
|
||||
"resultCode": "00",
|
||||
"resultDescription": "Collect Status retrieved successfully."
|
||||
"transactionId": validated_data.get("transactionId"),
|
||||
"transactionType": validated_data.get("transactionType")
|
||||
}
|
||||
|
||||
# Validate and serialize response with TransactionVerifyResponseSchema
|
||||
response_schema = TransactionVerifyResponseSchema()
|
||||
serialized_response = response_schema.dump(response_data)
|
||||
|
||||
# return ResponseHelper.success(
|
||||
# data=response_data,
|
||||
# message="Transaction verification completed successfully"
|
||||
# )
|
||||
|
||||
return response_data
|
||||
return jsonify(serialized_response), 200
|
||||
|
||||
except ValidationError as err:
|
||||
logger.error(f"Validation Error: {err.messages}")
|
||||
return jsonify({
|
||||
"message": "Validation exception"
|
||||
}) , 422
|
||||
"message": "Validation exception",
|
||||
"errors": err.messages
|
||||
}), 422
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"An error occurred: {str(e)}", exc_info=True)
|
||||
return jsonify({
|
||||
"message": "Internal Server Error"
|
||||
}) , 500
|
||||
}), 500
|
||||
|
||||
+6
-3
@@ -1,10 +1,11 @@
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
class Config:
|
||||
"""Base configuration for Flask app"""
|
||||
|
||||
SWAGGER_URL = os.getenv("SWAGGER_URL", "/documentation")
|
||||
API_URL = os.getenv("API_URL", "/swagger.json")
|
||||
load_dotenv()
|
||||
SWAGGER_URL = os.getenv("SWAGGER_URL")
|
||||
API_URL = '/api/swagger.json'
|
||||
|
||||
DEBUG = True
|
||||
VALID_APP_ID = os.getenv("VALID_APP_ID", "app1")
|
||||
@@ -15,3 +16,5 @@ class Config:
|
||||
# SECRET_KEY = os.environ.get("SECRET_KEY", "your_secret_key")
|
||||
|
||||
DEBUG = True
|
||||
def configure():
|
||||
load_dotenv()
|
||||
@@ -16,6 +16,9 @@
|
||||
"servers": [
|
||||
{
|
||||
"url": "http://localhost:6337"
|
||||
},
|
||||
{
|
||||
"url": "http://localhost:5000"
|
||||
},
|
||||
{
|
||||
"url": "http://10.10.11.17:6337"
|
||||
@@ -107,35 +110,32 @@
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"/RACCheck": {
|
||||
"$ref": "./paths/RACCheck.json"
|
||||
"/api/rac-check": {
|
||||
"$ref": "swagger/paths/RACCheck.json"
|
||||
},
|
||||
"/CompleteRACcheck": {
|
||||
"$ref": "./paths/CompleteRACcheck.json"
|
||||
"/api/DisburseLoan": {
|
||||
"$ref": "swagger/paths/Disbursement.json"
|
||||
},
|
||||
"/Disbursement": {
|
||||
"$ref": "./paths/Disbursement.json"
|
||||
"/api/CollectLoan": {
|
||||
"$ref": "swagger/paths/CollectLoan.json"
|
||||
},
|
||||
"/CollectLoan": {
|
||||
"$ref": "./paths/CollectLoan.json"
|
||||
"/api/TransactionVerify": {
|
||||
"$ref": "swagger/paths/TransactionVerify.json"
|
||||
},
|
||||
"/TransactionVerify": {
|
||||
"$ref": "./paths/TransactionVerify.json"
|
||||
"/api/CollectPenalFee": {
|
||||
"$ref": "swagger/paths/PenalCharge.json"
|
||||
},
|
||||
"/PenalCharge": {
|
||||
"$ref": "./paths/PenalCharge.json"
|
||||
"/api/RevokeEnableConsent": {
|
||||
"$ref": "swagger/paths/RevokeEnableConsent.json"
|
||||
},
|
||||
"/RevokeEnableConsent": {
|
||||
"$ref": "./paths/RevokeEnableConsent.json"
|
||||
"/api/TokenValidation": {
|
||||
"$ref": "swagger/paths/TokenValidation.json"
|
||||
},
|
||||
"/TokenValidation": {
|
||||
"$ref": "./paths/TokenValidation.json"
|
||||
"/api/LienCheck": {
|
||||
"$ref": "swagger/paths/LienCheck.json"
|
||||
},
|
||||
"/LienCheck": {
|
||||
"$ref": "./paths/LienCheck.json"
|
||||
},
|
||||
"/NewTransactionCheck": {
|
||||
"$ref": "./paths/NewTransactionCheck.json"
|
||||
"/api/NewTransactionCheck": {
|
||||
"$ref": "swagger/paths/NewTransactionCheck.json"
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
|
||||
@@ -1,70 +1,67 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"example": "T002"
|
||||
},
|
||||
"fbnTransactionId": {
|
||||
"type": "string",
|
||||
"example": "FBN20231123"
|
||||
},
|
||||
"debtId": {
|
||||
"type": "string",
|
||||
"example": "273194670"
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799"
|
||||
},
|
||||
"productId": {
|
||||
"type": "string",
|
||||
"example": "101"
|
||||
},
|
||||
"collectAmount": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 80000.0
|
||||
},
|
||||
"penalCharge": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 0.0
|
||||
},
|
||||
"collectionMethod": {
|
||||
"type": "integer",
|
||||
"example": 1
|
||||
},
|
||||
"lienAmount": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 80000.0
|
||||
},
|
||||
"countryId": {
|
||||
"type": "string",
|
||||
"example": "01"
|
||||
},
|
||||
"comment": {
|
||||
"type": "string",
|
||||
"example": "Testing CollectionLoanRequest"
|
||||
}
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"example": "T002"
|
||||
},
|
||||
"required": [
|
||||
"transactionId",
|
||||
"fbnTransactionId",
|
||||
"debtId",
|
||||
"customerId",
|
||||
"accountId",
|
||||
"productId",
|
||||
"collectAmount",
|
||||
"penalCharge",
|
||||
"collectionMethod",
|
||||
"lienAmount",
|
||||
"countryId",
|
||||
"comment"
|
||||
]
|
||||
}
|
||||
"fbnTransactionId": {
|
||||
"type": "string",
|
||||
"example": "FBN20231123"
|
||||
},
|
||||
"debtId": {
|
||||
"type": "string",
|
||||
"example": "273194670"
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799"
|
||||
},
|
||||
"productId": {
|
||||
"type": "string",
|
||||
"example": "101"
|
||||
},
|
||||
"collectAmount": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 80000.0
|
||||
},
|
||||
"penalCharge": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 0.0
|
||||
},
|
||||
"collectionMethod": {
|
||||
"type": "string",
|
||||
"example": "string"
|
||||
},
|
||||
"lienAmount": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 80000.0
|
||||
},
|
||||
"countryId": {
|
||||
"type": "string",
|
||||
"example": "01"
|
||||
},
|
||||
"comment": {
|
||||
"type": "string",
|
||||
"example": "Testing CollectionLoanRequest"
|
||||
},
|
||||
"channel": {
|
||||
"type": "string",
|
||||
"example": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"collectAmount",
|
||||
"penalCharge",
|
||||
"lienAmount"
|
||||
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
|
||||
@@ -1,70 +1,69 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"example": "T002"
|
||||
},
|
||||
"debtId": {
|
||||
"type": "string",
|
||||
"example": "273194670"
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799"
|
||||
},
|
||||
"productId": {
|
||||
"type": "string",
|
||||
"example": "101"
|
||||
},
|
||||
"collectAmount": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 60000.0
|
||||
},
|
||||
"penalCharge": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 0.0
|
||||
},
|
||||
"lienAmount": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 20000.0
|
||||
},
|
||||
"countryId": {
|
||||
"type": "string",
|
||||
"example": "01"
|
||||
},
|
||||
"comment": {
|
||||
"type": "string",
|
||||
"example": "Testing CollectionLoanRequest"
|
||||
},
|
||||
"resultCode": {
|
||||
"type": "string",
|
||||
"example": "00"
|
||||
},
|
||||
"resultDescription": {
|
||||
"type": "string",
|
||||
"example": "Loan Collection Successful"
|
||||
}
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"responseCode": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "00"
|
||||
},
|
||||
"required": [
|
||||
"transactionId",
|
||||
"debtId",
|
||||
"customerId",
|
||||
"accountId",
|
||||
"productId",
|
||||
"collectAmount",
|
||||
"penalCharge",
|
||||
"lienAmount",
|
||||
"countryId",
|
||||
"comment",
|
||||
"resultCode",
|
||||
"resultDescription"
|
||||
]
|
||||
}
|
||||
"responseDescr": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "Success"
|
||||
},
|
||||
"fullDescription": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "Loan Collection Successful"
|
||||
},
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "T002"
|
||||
},
|
||||
"debtId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "273194670"
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "2017821799"
|
||||
},
|
||||
"productId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "101"
|
||||
},
|
||||
"amountCollected": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 60000.0
|
||||
},
|
||||
"countryId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "01"
|
||||
},
|
||||
"comment": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "Testing CollectionLoanRequest"
|
||||
},
|
||||
"responseMessage": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "Loan processed successfully"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"amountCollected"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
|
||||
@@ -1,77 +1,78 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"requestId": {
|
||||
"type": "string",
|
||||
"example": "7876786"
|
||||
},
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"example": "T001"
|
||||
},
|
||||
"debtId": {
|
||||
"type": "string",
|
||||
"example": "273194670"
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799"
|
||||
},
|
||||
"productId": {
|
||||
"type": "string",
|
||||
"example": "101"
|
||||
},
|
||||
"provideAmount": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 100000.0
|
||||
},
|
||||
"collectAmountInterest": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 5000.0
|
||||
},
|
||||
"collectAmountMgtFee": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 1000.0
|
||||
},
|
||||
"collectAmountInsurance": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 1000.0
|
||||
},
|
||||
"collectAmountVAT": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 75.0
|
||||
},
|
||||
"countryId": {
|
||||
"type": "string",
|
||||
"example": "01"
|
||||
},
|
||||
"comment": {
|
||||
"type": "string",
|
||||
"example": "Testing LoanRequest"
|
||||
}
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"example": "T001",
|
||||
"nullable": true
|
||||
},
|
||||
"required": [
|
||||
"requestId",
|
||||
"transactionId",
|
||||
"debtId",
|
||||
"customerId",
|
||||
"accountId",
|
||||
"productId",
|
||||
"provideAmount",
|
||||
"collectAmountInterest",
|
||||
"collectAmountMgtFee",
|
||||
"collectAmountInsurance",
|
||||
"collectAmountVAT",
|
||||
"countryId",
|
||||
"comment"
|
||||
]
|
||||
}
|
||||
"fbnTransactionId": {
|
||||
"type": "string",
|
||||
"example": "Tr201712RK9232P115",
|
||||
"nullable": true
|
||||
},
|
||||
"debtId": {
|
||||
"type": "string",
|
||||
"example": "273194670",
|
||||
"nullable": true
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868",
|
||||
"nullable": true
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799",
|
||||
"nullable": true
|
||||
},
|
||||
"productId": {
|
||||
"type": "string",
|
||||
"example": "101",
|
||||
"nullable": true
|
||||
},
|
||||
"provideAmount": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 100000.0
|
||||
},
|
||||
"collectAmountInterest": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 5000.0
|
||||
},
|
||||
"collectAmountMgtFee": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 1000.0
|
||||
},
|
||||
"collectAmountInsurance": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 1000.0
|
||||
},
|
||||
"collectAmountVAT": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 75.0
|
||||
},
|
||||
"countryId": {
|
||||
"type": "string",
|
||||
"example": "01",
|
||||
"nullable": true
|
||||
},
|
||||
"comment": {
|
||||
"type": "string",
|
||||
"example": "Testing LoanRequest",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"provideAmount",
|
||||
"collectAmountInterest",
|
||||
"collectAmountMgtFee",
|
||||
"collectAmountInsurance",
|
||||
"collectAmountVAT"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
|
||||
@@ -1,82 +1,82 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"example": "T001"
|
||||
},
|
||||
"TransactionId": {
|
||||
"type": "string",
|
||||
"example": "Tr201712RK9232P115"
|
||||
},
|
||||
"debtId": {
|
||||
"type": "string",
|
||||
"example": "273194670"
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799"
|
||||
},
|
||||
"productId": {
|
||||
"type": "string",
|
||||
"example": "101"
|
||||
},
|
||||
"provideAmount": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 100000.0
|
||||
},
|
||||
"collectAmountInterest": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 5000.0
|
||||
},
|
||||
"collectAmountMgtFee": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 1000.0
|
||||
},
|
||||
"collectAmountInsurance": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 1000.0
|
||||
},
|
||||
"collectAmountVAT": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 75.0
|
||||
},
|
||||
"countryId": {
|
||||
"type": "string",
|
||||
"example": "01"
|
||||
},
|
||||
"resultCode": {
|
||||
"type": "string",
|
||||
"example": "00"
|
||||
},
|
||||
"resultDescription": {
|
||||
"type": "string",
|
||||
"example": "Loan Request Completed Successfully!"
|
||||
}
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"example": "T001",
|
||||
"nullable": true
|
||||
},
|
||||
"required": [
|
||||
"transactionId",
|
||||
"TransactionId",
|
||||
"debtId",
|
||||
"customerId",
|
||||
"accountId",
|
||||
"productId",
|
||||
"provideAmount",
|
||||
"collectAmountInterest",
|
||||
"collectAmountMgtFee",
|
||||
"collectAmountInsurance",
|
||||
"collectAmountVAT",
|
||||
"countryId",
|
||||
"resultCode",
|
||||
"resultDescription"
|
||||
]
|
||||
}
|
||||
"fbnTransactionId": {
|
||||
"type": "string",
|
||||
"example": "Tr201712RK9232P115",
|
||||
"nullable": true
|
||||
},
|
||||
"debtId": {
|
||||
"type": "string",
|
||||
"example": "273194670",
|
||||
"nullable": true
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868",
|
||||
"nullable": true
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799",
|
||||
"nullable": true
|
||||
},
|
||||
"productId": {
|
||||
"type": "string",
|
||||
"example": "101",
|
||||
"nullable": true
|
||||
},
|
||||
"provideAmount": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 100000.0
|
||||
},
|
||||
"collectAmountInterest": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 5000.0
|
||||
},
|
||||
"collectAmountMgtFee": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 1000.0
|
||||
},
|
||||
"collectAmountInsurance": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 1000.0
|
||||
},
|
||||
"collectAmountVAT": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 75.0
|
||||
},
|
||||
"countryId": {
|
||||
"type": "string",
|
||||
"example": "01",
|
||||
"nullable": true
|
||||
},
|
||||
"responseCode": {
|
||||
"type": "string",
|
||||
"example": "00",
|
||||
"nullable": true
|
||||
},
|
||||
"responseMessage": {
|
||||
"type": "string",
|
||||
"example": "Loan Request Completed Successfully!",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"provideAmount",
|
||||
"collectAmountInterest",
|
||||
"collectAmountMgtFee",
|
||||
"collectAmountInsurance",
|
||||
"collectAmountVAT"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,41 +1,59 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"example": "T004"
|
||||
},
|
||||
"fbnTransactionId": {
|
||||
"type": "string",
|
||||
"example": "Tr201712RK9232P115"
|
||||
},
|
||||
"debtId": {
|
||||
"type": "string",
|
||||
"example": "273194670"
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799"
|
||||
},
|
||||
"penalCharge": {
|
||||
"type": "number",
|
||||
"example": 1.2
|
||||
},
|
||||
"lienAmount": {
|
||||
"type": "number",
|
||||
"example": 101.2
|
||||
},
|
||||
"countryId": {
|
||||
"type": "string",
|
||||
"example": "01"
|
||||
},
|
||||
"comment": {
|
||||
"type": "string",
|
||||
"example": "Testing PenalChargeRequest"
|
||||
}
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"channel": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "T004"
|
||||
},
|
||||
"fbnTransactionId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "Tr201712RK9232P115"
|
||||
},
|
||||
"debtId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "273194670"
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "2017821799"
|
||||
},
|
||||
"penalCharge": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 1.2
|
||||
},
|
||||
"lienAmount": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 101.2
|
||||
},
|
||||
"countryId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "01"
|
||||
},
|
||||
"comment": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "Testing PenalChargeRequest"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"penalCharge",
|
||||
"lienAmount"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
|
||||
@@ -1,13 +1,37 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"resultCode": {
|
||||
"type": "string",
|
||||
"example": "00"
|
||||
},
|
||||
"resultDescription": {
|
||||
"type": "string",
|
||||
"example": "Penal charge debited successfully"
|
||||
}
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "CN621868"
|
||||
},
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "T004"
|
||||
},
|
||||
"amountCollected": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 101.2
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "2017821799"
|
||||
},
|
||||
"responseCode": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "00"
|
||||
},
|
||||
"responseMessage": {
|
||||
"type": "string",
|
||||
"nullable": true,
|
||||
"example": "Penal charge debited successfully"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["amountCollected"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
|
||||
@@ -1,91 +1,40 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"example": "T001"
|
||||
},
|
||||
"fbnTransactionId": {
|
||||
"type": "string",
|
||||
"example": "Tr201712RK9232P115"
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799"
|
||||
},
|
||||
"RAC_Array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"salaryAccount": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
},
|
||||
"bvn": {
|
||||
"type": "string",
|
||||
"example": "12345678901"
|
||||
},
|
||||
"crc": {
|
||||
"type": "boolean",
|
||||
"example": false
|
||||
},
|
||||
"crms": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
},
|
||||
"accountStatus": {
|
||||
"type": "string",
|
||||
"example": "active"
|
||||
},
|
||||
"lien": {
|
||||
"type": "boolean",
|
||||
"example": false
|
||||
},
|
||||
"noBouncedCheck": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
},
|
||||
"existingLoan": {
|
||||
"type": "boolean",
|
||||
"example": false
|
||||
},
|
||||
"whitelist": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
},
|
||||
"noPastDueSalaryLoan": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
},
|
||||
"noPastDueOtherLoans": {
|
||||
"type": "boolean",
|
||||
"example": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"example": [
|
||||
{
|
||||
"salaryAccount": true,
|
||||
"bvn": "12345678901",
|
||||
"crc": false,
|
||||
"crms": true,
|
||||
"accountStatus": "active",
|
||||
"lien": false,
|
||||
"noBouncedCheck": true,
|
||||
"existingLoan": false,
|
||||
"whitelist": true,
|
||||
"noPastDueSalaryLoan": true,
|
||||
"noPastDueOtherLoans": false
|
||||
}
|
||||
]
|
||||
}
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"example": "T001"
|
||||
},
|
||||
"xml": {
|
||||
"name": "RACCheckRequest"
|
||||
"fbnTransactionId": {
|
||||
"type": "string",
|
||||
"example": "Tr201712RK9232P115"
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799"
|
||||
},
|
||||
"channel": {
|
||||
"type": "string",
|
||||
"example": "USSD"
|
||||
},
|
||||
"countryCode": {
|
||||
"type": "string",
|
||||
"example": "NG"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"transactionId",
|
||||
"fbnTransactionId",
|
||||
"customerId",
|
||||
"accountId",
|
||||
"channel",
|
||||
"countryCode"
|
||||
],
|
||||
"xml": {
|
||||
"name": "RACCheckRequest"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,65 +1,67 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"resultCode": {
|
||||
"type": "string",
|
||||
"example": "00"
|
||||
},
|
||||
"RACResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Salary account": {
|
||||
"type": "string",
|
||||
"example": "1"
|
||||
},
|
||||
"BVN": {
|
||||
"type": "string",
|
||||
"example": "1"
|
||||
},
|
||||
"BVNAttachedtoAccount": {
|
||||
"type": "string",
|
||||
"example": "1"
|
||||
},
|
||||
"CRMS": {
|
||||
"type": "string",
|
||||
"example": "1"
|
||||
},
|
||||
"CRC": {
|
||||
"type": "string",
|
||||
"example": "1"
|
||||
},
|
||||
"AccountStatus": {
|
||||
"type": "string",
|
||||
"example": "1"
|
||||
},
|
||||
"Lien": {
|
||||
"type": "string",
|
||||
"example": "1"
|
||||
},
|
||||
"NoBouncedCheck": {
|
||||
"type": "string",
|
||||
"example": "1"
|
||||
},
|
||||
"Whitelist": {
|
||||
"type": "string",
|
||||
"example": "1"
|
||||
},
|
||||
"NoPastDueSalaryLoan": {
|
||||
"type": "string",
|
||||
"example": "1"
|
||||
},
|
||||
"NoPastDueOtherLoan": {
|
||||
"type": "string",
|
||||
"example": "1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"resultDescription": {
|
||||
"type": "string",
|
||||
"example": "RAC Check Successful"
|
||||
}
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"example": "T001"
|
||||
},
|
||||
"xml": {
|
||||
"name": "RACCheckResponse"
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799"
|
||||
},
|
||||
"racResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"hasSalaryAccount": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
},
|
||||
"bvnValidated": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
},
|
||||
"creditBureauCheck": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
},
|
||||
"crmsCheck": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
},
|
||||
"accountStatus": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
},
|
||||
"hasLien": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
},
|
||||
"noBouncedCheck": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
},
|
||||
"isWhitelisted": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
},
|
||||
"hasPastDueLoan": {
|
||||
"type": "boolean",
|
||||
"example": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"transactionId",
|
||||
"customerId",
|
||||
"accountId",
|
||||
"racResponse"
|
||||
],
|
||||
"xml": {
|
||||
"name": "RACCheckResponse"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +1,34 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"counter": {
|
||||
"type": "string",
|
||||
"example": "2"
|
||||
},
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"example": "T002"
|
||||
},
|
||||
"requestID": {
|
||||
"type": "string",
|
||||
"example": "R02802"
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799"
|
||||
},
|
||||
"countryId": {
|
||||
"type": "string",
|
||||
"example": "01"
|
||||
},
|
||||
"transactionType": {
|
||||
"type": "string",
|
||||
"example": "Disbursement"
|
||||
}
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"channel": {
|
||||
"type": "string",
|
||||
"example": "MOBILE"
|
||||
},
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"example": "T002"
|
||||
},
|
||||
"requestId": {
|
||||
"type": "string",
|
||||
"example": "R02802"
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799"
|
||||
},
|
||||
"countryId": {
|
||||
"type": "string",
|
||||
"example": "01"
|
||||
},
|
||||
"transactionType": {
|
||||
"type": "string",
|
||||
"example": "Disbursement"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
|
||||
@@ -1,37 +1,48 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"$type": {
|
||||
"type": "string",
|
||||
"example": "TransactionCheckResponse"
|
||||
},
|
||||
"nativeId": {
|
||||
"type": "string",
|
||||
"example": "FBN20191031104405CN621868"
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799"
|
||||
},
|
||||
"providedAmount": {
|
||||
"type": "number",
|
||||
"example": 0.0
|
||||
},
|
||||
"collectedAmount": {
|
||||
"type": "number",
|
||||
"example": 7.50
|
||||
},
|
||||
"resultCode": {
|
||||
"type": "string",
|
||||
"example": "00"
|
||||
},
|
||||
"resultDescription": {
|
||||
"type": "string",
|
||||
"example": "Collect Status retrieved successfully."
|
||||
}
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"responseCode": {
|
||||
"type": "string",
|
||||
"example": "00"
|
||||
},
|
||||
"responseDescr": {
|
||||
"type": "string",
|
||||
"example": "Collect Status retrieved successfully."
|
||||
},
|
||||
"fullDescription": {
|
||||
"type": "string",
|
||||
"example": "Disbursement was verified and collection completed."
|
||||
},
|
||||
"customerId": {
|
||||
"type": "string",
|
||||
"example": "CN621868"
|
||||
},
|
||||
"accountId": {
|
||||
"type": "string",
|
||||
"example": "2017821799"
|
||||
},
|
||||
"providedAmount": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 0.0
|
||||
},
|
||||
"collectedAmount": {
|
||||
"type": "number",
|
||||
"format": "double",
|
||||
"example": 7.50
|
||||
},
|
||||
"transactionId": {
|
||||
"type": "string",
|
||||
"example": "T002"
|
||||
},
|
||||
"transactionType": {
|
||||
"type": "string",
|
||||
"example": "Disbursement"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"providedAmount",
|
||||
"collectedAmount"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user