diff --git a/bobpay/public/index.html b/bobpay/public/index.html index 62dfbad..f9b9d91 100755 --- a/bobpay/public/index.html +++ b/bobpay/public/index.html @@ -225,6 +225,14 @@

Install BobPay

AliPay

+
+
+

Setup FIDO / WebAuthn

+ + WebAuthn:      + Register       + Delete All + @@ -248,6 +256,10 @@

Install BobPay

+ + + + diff --git a/bobpay/public/pay/index.html b/bobpay/public/pay/index.html index 20148c4..b8bdc97 100644 --- a/bobpay/public/pay/index.html +++ b/bobpay/public/pay/index.html @@ -41,15 +41,26 @@

You are paying with BobPay

function pay() { if(!paymentRequestClient) return; - var paymentAppResponse = { - methodName: "https://emerald-eon.appspot.com/bobpay", - details: { - id: "123456" - } - }; - - paymentRequestClient.postMessage(paymentAppResponse); - window.close(); + var authn = new WebAuthnTransaction(); + + authn.authenticate() + .then(() => { + var paymentAppResponse = { + methodName: "https://emerald-eon.appspot.com/bobpay", + details: { + id: "123456" + } + }; + + paymentRequestClient.postMessage(paymentAppResponse); + window.close(); + }) + .catch((e) => { + // TODO: need to think about the error path here: retry? fail payment? + console.log ("Authentication failed"); + console.log (e); + throw e; + }); } function cancel() {