from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/webhook/credit-limit-update', methods=['POST'])
def handle_credit_limit_update():
try:
creditLimitUpdate = request.json
# Process the credit limit update data
process_credit_limit_update(creditLimitUpdate)
return jsonify({'status': 'success'}), 200
except Exception as e:
print(f'Error processing credit limit update: {str(e)}')
return jsonify({'status': 'error', 'message': str(e)}), 500
def process_credit_limit_update(creditLimitUpdate):
# Validate the transfer amount
print(f"Processing credit limit update: {creditLimitUpdate['id']}")
# Process each transaction
print(f"User ID: {creditLimitUpdate['userId']}")
print(f"External ID: {creditLimitUpdate['externalId']}")