From 937620e86ca2f5e4d1ca632d61a1bd4b5315d796 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Thu, 24 Aug 2023 16:13:24 +1000 Subject: [PATCH] main: Initial stripe test --- master/main.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/master/main.py b/master/main.py index edbca2b..8072c5b 100644 --- a/master/main.py +++ b/master/main.py @@ -232,6 +232,26 @@ def tlsa(): return resp.json() + +@app.route('stripe', methods=['POST']) +def stripe(): + # Get API header + api_key = request.headers.get('key') + if api_key == None: + return jsonify({'error': 'Invalid API key', 'success': 'false'}) + if api_key != os.getenv('STRIPE_KEY'): + return jsonify({'error': 'Invalid API key', 'success': 'false'}) + + # Log all requests + print(request.json) + # Log for docker + print(request.json, flush=True) + + return jsonify({'success': 'true'}) + + + + def get_sites_count(): # If file doesn't exist, create it try: