I believe the idea is to create a new `PaymentRequest` object for every new state of the checkout shopping cart. So your code would become:
```javascript
// User has added an item to the shopping cart.
function onShoppingCartContentsUpdated(data) {
request = new window.PaymentRequest(instruments, data);
request.canMakePayment().then((result) => {
// Perform some logic.
}
}
// User clicks on the checkout button
function onCheckoutButtonClicked() {
request.show().then((instrumentResponse) => {});
}
```
--
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/browser-payment-api/issues/403#issuecomment-297540047