OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <title>Payment App: Test for invoking payment app</title> |
| 3 <script src="./result_queue.js"></script> |
| 4 <script> |
| 5 |
| 6 function registerPaymentApp() { |
| 7 navigator.serviceWorker.register('payment_app.js', { scope: './' }) |
| 8 .then(() => { |
| 9 return navigator.serviceWorker.ready; |
| 10 }) |
| 11 .then(registration => { |
| 12 return registration.paymentAppManager.setManifest({ |
| 13 name: 'Payment App', |
| 14 icon: 'payment-app-icon', |
| 15 options: [{ |
| 16 name: 'Visa ****', |
| 17 icon: 'payment-app-icon', |
| 18 id: 'payment-app-id', |
| 19 enabledMethods: ['visa'] |
| 20 }] |
| 21 }); |
| 22 }) |
| 23 .then(result => { |
| 24 sendResultToTest('registered'); |
| 25 }) |
| 26 .catch(result => { |
| 27 sendResultToTest('error'); |
| 28 }); |
| 29 } |
| 30 |
| 31 var resultQueue = new ResultQueue(); |
| 32 navigator.serviceWorker.addEventListener('message', e => { |
| 33 resultQueue.push(e.data); |
| 34 }); |
| 35 |
| 36 </script> |
OLD | NEW |