From 5bba3395bc0bb84dcd24a7ade0c855a6beb6dbef Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 12 Nov 2012 22:43:39 -0800 Subject: Save transactions in redis --- public/js/calculator.coffee | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'public') diff --git a/public/js/calculator.coffee b/public/js/calculator.coffee index 6861bb16..01523d9a 100644 --- a/public/js/calculator.coffee +++ b/public/js/calculator.coffee @@ -7,7 +7,7 @@ g = exports ? this $(-> g.websocket = null - g.client = $('#client').val() + g.user = $('#user').val() g.title = get('title') g.address = get('address') g.commission = get('commission') @@ -18,8 +18,8 @@ $(-> setupQR() setupSocket() - if client? and client - $.getJSON('client/' + client, (data) -> + if user? and user + $.getJSON(user + '.json', (data) -> g.title = data.name g.address = data.address g.commission = data.commission @@ -124,11 +124,11 @@ setupSocket = -> $('#payment').hide() $('#received').fadeIn('slow') - $.get('record_transaction.php', - address: from_address, - date: moment().format("YYYY-MM-DD HH:mm:ss"), - received: received, - exchange: g.exchange + $.post("/#{g.user}/transactions", + address: from_address, + date: moment().format("YYYY-MM-DD HH:mm:ss"), + received: received, + exchange: g.exchange ) get = (name) -> -- cgit v1.2.3