Re: [w3c/browser-payment-api] canMakePayment() might be in the wrong place? (#403)

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

Received on Wednesday, 26 April 2017 21:02:36 UTC