@michelle so, given #655 requiring use activation on .show(), you could still do:
```js
let pr = new PaymentRequest (/*...*/);
const updatePromise = fetchDisplayItemsAndTotal();
// later on...
button.onclick = async ev => {
const response = await pr.show(updatePromise);
try {
// this shows the payment sheet in a loading
// state.
handlePayment(response);
} catch (err) {
handleError(err);
}
};
```
Does that work?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-request/issues/645#issuecomment-360027510