[w3c/payment-request] Add way to update `total` and `displayItems` after `.show()` but before user interaction (#645)

This is related to but different from #639.

Some users have reported to us that they may not know the total or line items at the time of attempting to open the payment sheet with `show()` -- there may be asynchronous server-based logic yet to be resolved.

Apple Pay provides an unrelated API that users can repurpose to work around this: if you listen for [onpaymentmethodselected](https://developer.apple.com/documentation/applepayjs/applepaysession/1778013-onpaymentmethodselected), you can get a loading state when the sheet opens and then asynchronously update the total and return control to the sheet. We have at least one user that has been relying on this behavior with Apple Pay.

Is it worth adding a way to signal that the browser should show a spinner or equivalent and wait to allow end user interaction until an update? The alternative is for Payment Request implementors to block the end-user action (not great) or show a manually-created loading modal (probably also not great).

-- 
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

Received on Monday, 6 November 2017 00:13:55 UTC