diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-02-01 15:10:20 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-02-01 15:10:20 +0100 |
commit | 42a0076f5951d303635b2e544aa66112cdb9abfe (patch) | |
tree | 432874ec0e7dbe6c831992f70a468bc1b6719901 /extension/pages/confirm-contract.js | |
parent | b150470eb60017b4ccdf56351428f9452a207fc8 (diff) |
new fulfillment protocol
Diffstat (limited to 'extension/pages/confirm-contract.js')
-rw-r--r-- | extension/pages/confirm-contract.js | 6 |
1 files changed, 5 insertions, 1 deletions
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; |