From 42a0076f5951d303635b2e544aa66112cdb9abfe Mon Sep 17 00:00:00 2001
From: Florian Dold <florian.dold@gmail.com>
Date: Mon, 1 Feb 2016 15:10:20 +0100
Subject: new fulfillment protocol

---
 extension/pages/confirm-contract.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'extension/pages/confirm-contract.tsx')

diff --git a/extension/pages/confirm-contract.tsx b/extension/pages/confirm-contract.tsx
index fc5dfdece..35d050c19 100644
--- a/extension/pages/confirm-contract.tsx
+++ b/extension/pages/confirm-contract.tsx
@@ -33,6 +33,7 @@ export function main() {
   let offer = JSON.parse(query.offer);
   console.dir(offer);
   let contract = offer.contract;
+  let error = null;
 
   var Contract = {
     view(ctrl) {
@@ -47,7 +48,8 @@ export function main() {
           _.map(contract.products,
                 (p: any) => m("li",
                               `${p.description}: ${prettyAmount(p.price)}`))),
-        m("button", {onclick: doPayment}, i18n`Confirm Payment`)
+        m("button", {onclick: doPayment}, i18n`Confirm Payment`),
+        m("p", error ? error : []),
       ];
     }
   };
@@ -62,6 +64,8 @@ export function main() {
     chrome.runtime.sendMessage({type: 'confirm-pay', detail: d}, (resp) => {
       if (!resp.success) {
         console.log("confirm-pay error", JSON.stringify(resp));
+        error = resp.message;
+        m.redraw();
         return;
       }
       let c = d.offer.contract;
-- 
cgit v1.2.3

