- From: Jenan Wise <notifications@github.com>
- Date: Thu, 05 Oct 2017 19:56:09 -0700
- To: w3c/payment-request <payment-request@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 6 October 2017 02:56:31 UTC
We’ve heard from merchants that they’d like a way to update the `total` of a PaymentRequest before `.show()` is called. Concrete use case: render a button on page load after being sure that `canMakePayment()` resolves to `true`, and then `.update()` as a user selects between SKUs. Another: a donation site where the user can select how much to donate. One solution may be to just create new `PaymentRequest` instances when the user interacts with the page, but `canMakePayment()` makes network requests and can be slow, so you either end up with a race condition between the user changing the form and clicking the button or uncomfortable disabled+re-enabled UI. Payment Handlers get passed `total` when `canMakePayment` is called, so I could see an argument that `canMakePayment()` needs to be re-run as totals change, but obviously `total` can also be updated after `.show()` via the shipping callbacks. -- 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/639
Received on Friday, 6 October 2017 02:56:31 UTC