Created
February 14, 2019 12:41
-
-
Save lennykioko/b61aa0487bf9070110161966500dea1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pprint import pprint as pp | |
from flask import Flask, request, jsonify | |
app = Flask(__name__) | |
@app.route('/mpesaHook', methods=['POST']) | |
def mpesa_hook(): | |
print('\n\n--- Received M-Pesa webhook ---\n\n') | |
content = request.json | |
pp(content) | |
print('\n\n--- End ---\n\n') | |
return jsonify({"statusCode": 200, "status": "success"}) | |
if __name__ == '__main__': | |
app.run(host='0.0.0.0', debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment