main: Initial stripe test
All checks were successful
Build Docker / Build Bot (push) Successful in 22s
Build Docker / Build Master (push) Successful in 26s

This commit is contained in:
Nathan Woodburn 2023-08-24 16:13:24 +10:00
parent 71a5dd8b45
commit 937620e86c
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -232,6 +232,26 @@ def tlsa():
return resp.json() 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(): def get_sites_count():
# If file doesn't exist, create it # If file doesn't exist, create it
try: try: