From 42a0076f5951d303635b2e544aa66112cdb9abfe Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 1 Feb 2016 15:10:20 +0100 Subject: new fulfillment protocol --- extension/pages/confirm-contract.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'extension/pages/confirm-contract.js') diff --git a/extension/pages/confirm-contract.js b/extension/pages/confirm-contract.js index ec6985805..70ecff399 100644 --- a/extension/pages/confirm-contract.js +++ b/extension/pages/confirm-contract.js @@ -27,13 +27,15 @@ System.register(["../lib/web-common"], function(exports_1) { var offer = JSON.parse(query.offer); console.dir(offer); var contract = offer.contract; + var error = null; var Contract = { view: function (ctrl) { return [ m("p", (_a = ["Hello, this is the wallet. The merchant \"", "\"\n wants to enter a contract over ", "\n with you."], _a.raw = ["Hello, this is the wallet. The merchant \"", "\"\n wants to enter a contract over ", "\n with you."], i18n(_a, contract.merchant.name, prettyAmount(contract.amount)))), m("p", (_b = ["The contract contains the following products:"], _b.raw = ["The contract contains the following products:"], i18n(_b))), m('ul', _.map(contract.products, function (p) { return m("li", p.description + ": " + prettyAmount(p.price)); })), - m("button", { onclick: doPayment }, (_c = ["Confirm Payment"], _c.raw = ["Confirm Payment"], i18n(_c))) + m("button", { onclick: doPayment }, (_c = ["Confirm Payment"], _c.raw = ["Confirm Payment"], i18n(_c))), + m("p", error ? error : []), ]; var _a, _b, _c; } @@ -46,6 +48,8 @@ System.register(["../lib/web-common"], function(exports_1) { chrome.runtime.sendMessage({ type: 'confirm-pay', detail: d }, function (resp) { if (!resp.success) { console.log("confirm-pay error", JSON.stringify(resp)); + error = resp.message; + m.redraw(); return; } var c = d.offer.contract; -- cgit v1.2.3