Skip to content

Commit

Permalink
Customer backend
Browse files Browse the repository at this point in the history
  • Loading branch information
zdina committed Sep 16, 2017
1 parent 1aa0f30 commit 8549cc8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(self, sender, receipient, reference, amount, currency):
self.amount = amount
self.currency = currency
self.date = datetime.datetime()
self.customer = None

@app.route('/transaction', methods=['GET', 'POST'])
def transaction():
Expand All @@ -46,6 +47,18 @@ def transaction():
def hello_world():
return 'Hello, World!'

@app.route('/customer', methods=['GET', 'POST'])
def customer():
print(request)
if request.method == 'POST':
data = request.get_json()
print(data)
self.customer = data['name']
response = "Got Customer"
return jsonify({ "speech": response, "displayText": response})
elif request.method == 'GET':
return jsonify({ "name": "Daniel" })

if __name__ == "__main__":
context = (cer, key)
app.run(host='0.0.0.0', debug=True, ssl_context=context)

0 comments on commit 8549cc8

Please sign in to comment.